A different kind of [you] bbcode

spit_f1re88

New Member
I want to display another information in you bbcode. instead of showing the viewer's username i want to show their real name from what they've entered in about me. Can someone please teach me what to edit in the code to display what i desire.

Here's the code that i use in you bbcode.

Code:
global $vbulletin;
        $text = str_replace("[you]","" .$vbulletin->userinfo['username']. "",$text);
        $parsedtext = str_replace("[you]","" .$vbulletin->userinfo['username']. "",$parsedtext);

*note: i did not made this code.*
 
the code displays the username of the viewer if you type "[you]"

what i want is to display the real name of the viewer instead of username.

when i type [you] that message will be converted to the username of the user viewing it.

for example:

Hello [you].

in your part it should display:

Hello monoxera

in my part it should display:

Hello spit_f1re88
 
well actually it can be made but you will have to add a new profile field like real name so it's stored in the database then it can be pulled and displayed :3 let me see if i can work something this night and i will post it tomorrow ;3 cya
 
Try this
Code:
global $vbulletin;
        $text = str_replace("$username","" .$vbulletin->userinfo['username']. "",$text);
        $parsedtext = str_replace("$username","" .$vbulletin->userinfo['username']. "",$parsedtext);
 
Itsuki Minami said:
well actually it can be made but you will have to add a new profile field like real name so it's stored in the database then it can be pulled and displayed :3 let me see if i can work something this night and i will post it tomorrow ;3 cya

exactly! that's my problem. i don't know how to fetch data from profile fields. ^^,
 
Itsuki Minami said:
well actually it can be made but you will have to add a new profile field like real name so it's stored in the database then it can be pulled and displayed :3 let me see if i can work something this night and i will post it tomorrow ;3 cya

any update sir?
 
global $vbulletin;
$text = str_replace("$realname","" .$vbulletin->$post['fieldX']. "",$text);
$parsedtext = str_replace("$realname","" .$vbulletin->$post['fieldX']. "",$parsedtext);

Try this D: haven't tested it because of lack of time tell me if it works, first make a custom profile field write down the field number and replace the x with the number like filed5 or soemthing D. and let's see if it works
 
Back
Top