You, me, we and us BBCode

Mod BBCode Database
BBCodes that need some file editing or extra files
There is no support here! Only Read Access!
Locked
User avatar
BBCode Bot
BBCoder IV
BBCoder IV
Posts: 239
Joined: 04 Mar 2010, 15:04
Location: bbcode table

You, me, we and us BBCode

Post by BBCode Bot »

You, me, we and us BBCode

Author: Mickroz
Description: With the You, me, we and us BBCode you can use tags that will show viewers name, posters name, posters and viewers name, boardname in the posts.
Image

File edits

Open: includes/ucp/ucp_pm_viewmessage.php
Find:

Code: Select all

$message = bbcode_nl2br($message);
	$message = smiley_text($message);
Add after:

Code: Select all

$your_username = get_username_string('full', $user->data['user_id'], $user->data['username'], $user->data['user_colour'], $user->lang['GUEST']);
	$my_username = get_username_string('full', $message_row['user_id'], $message_row['username'], $message_row['user_colour']);

	$find = array('[we]', '[me]', '[you]', '[us]');
	$replace = array(
		"$your_username and $my_username",
		$my_username,
		$your_username,
		'<span style="color: red;">' . $config['sitename'] . '</span>',
	);

	$message = str_replace($find, $replace, $message);
Open: viewtopic.php
Find:

Code: Select all

$message = bbcode_nl2br($message);
	$message = smiley_text($message);
Add after:

Code: Select all

$your_username = get_username_string('full', $user->data['user_id'], $user->data['username'], $user->data['user_colour'], $user->lang['GUEST']);
	$my_username = get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']);

	$find = array('[we]', '[me]', '[you]', '[us]');
	$replace = array(
		"$your_username and $my_username",
		$my_username,
		$your_username,
		'<span style="color: red;">' . $config['sitename'] . '</span>',
	);

	$message = str_replace($find, $replace, $message);

Now we need to create 4 BBCodes

You, showing viewers name
BBCode:

Code: Select all

[you][/you]
HTML:

Code: Select all

[you]
Helpline:

Code: Select all

[you] Viewers name: [you][/you]
Example:

Code: Select all

[you][/you]
Demo:
[you][/you]

Me, showing posters name
BBCode:

Code: Select all

[me][/me]
HTML:

Code: Select all

[me]
Helpline:

Code: Select all

[me] Posters name: [me][/me]
Example:

Code: Select all

[me][/me]
Demo:
[me][/me]

We, showing posters & viewers name
BBCode:

Code: Select all

[we][/we]
HTML:

Code: Select all

[we]
Helpline:

Code: Select all

[we] Posters & Viewers name: [we][/we]
Example:

Code: Select all

[we][/we]
Demo:
[we][/we]

Us, showing board name
BBCode:

Code: Select all

[us][/us]
HTML:

Code: Select all

[us]
Helpline:

Code: Select all

[us] Board name: [us][/us]
Example:

Code: Select all

[us][/us]
Demo:
[us][/us]
andredmau5
BBCoder I
BBCoder I
Posts: 3
Joined: 10 Jun 2010, 15:37

Re: You, me, we and us BBCode

Post by andredmau5 »

it works!.. but unfortunately for the signature it doesn't =(
Eliram-p
BBCoder I
BBCoder I
Posts: 3
Joined: 10 Aug 2010, 13:39

Re: You, me, we and us BBCode

Post by Eliram-p »

Nice, i love it :)
Locked