MyBB Community Forums

Full Version: Display User Name in Profile
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hello, I want to add another table to a users profile, and in that I want it to display their username. Not the one browsing, but the persons profile name.

Ultimately, I want it to be able to link to something along the lines of: http://www.example.com/personal.php?name=NAMEHERE

Is there a way to do this?

Also, could someone link me on how to make a {$XXXXX} to add in a template?
Do you mean a modified members list or something else?
Add this code to the index.php file in the root of your MyBB dir make sure you put it at the top a line below the <?php tag
eval("\$X = \"".$templates->get("Y")."\";");
Where $X is the code you use in the template and Y being the template you want included

For example the header_welcomeblock_member uses {$mocplink} to get header_welcomeblock_member_moderator the code for this would be
eval("\$modcplink = \"".$templates->get("header_welcomeblock_member_moderator")."\";");
(2012-09-01, 03:19 PM)al7bar Wrote: [ -> ]Ultimately, I want it to be able to link to something along the lines of: http://www.example.com/personal.php?name=NAMEHERE

www.example.com/personal.php?name={$memprofile['username']}

But it seems that it is not sanitized for you ( urlencode($memprofile['username']) ), so you probably will be better off editing the core (or a plugin) to do it your self, or otherwise make us of the UID instead:

www.example.com/personal.php?name={$memprofile['uid']}

Quote:Add this code to the index.php file in the root of your MyBB dir make sure you put it at the top a line below the <?php tag

He shouldn't put it right after global.php has been included.
Omar thank you very much, that solved that problem.

Let me explain my self a little more....

-I want users to have to validate their username (if that makes sense), so when they are validated the URL I showed above will appear on their forum profile. Now, I know this seems like an intense request, but hopefully it can be done.

To recap, I want users to validate their forum profile name, which I will be doing, upon validation this would appear in their profile www.example.com/personal.php?name={$memprofile['username']} That's where I thought the {$XXX} would come in handy.
I apologize If I don't seem to fully understand your question but the username is already validated upon registration. What kind of validation you want to apply?

I will be moving this to the Plugins Development section, I think it will fit better there.
Sorry to not explain my self better, I will try again.

Basically, they have a username on a different database, they will need to verify with me (at my discretion) if their usernames on my database, and the other one match. Once I verify it, I want them to be able to see the URL previously stated.

Also, I don't want to add another thread. Another question of mine is how do I get users name to appear in the postbit? When I try the same link 'www.example.com/personal.php?=XXXX' the XXXX part gets left blank, instead of inserting the username of the poster.

Thank you for all your help Omar.
Quote:Basically, they have a username on a different database, they will need to verify with me (at my discretion) if their usernames on my database, and the other one match. Once I verify it, I want them to be able to see the URL previously stated.

Is this other DB in your server? Or are you trying to use an external service to grab it and verify it?

Quote:Also, I don't want to add another thread. Another question of mine is how do I get users name to appear in the postbit? When I try the same link 'www.example.com/personal.php?=XXXX' the XXXX part gets left blank, instead of inserting the username of the poster.
You can use {$post['username']} in the postbit/postbit_* templates.
(2012-09-02, 05:38 AM)Omar G. Wrote: [ -> ]
Quote:Basically, they have a username on a different database, they will need to verify with me (at my discretion) if their usernames on my database, and the other one match. Once I verify it, I want them to be able to see the URL previously stated.

Is this other DB in your server? Or are you trying to use an external service to grab it and verify it?
No it is not on my server, my staff and I will handle verifying the usernames. But, once the user is verified I want the URL to appear in their profile page, and in their postbit. Thank you once again.
I would write a plugin to add a new users column and update that for each user once I have accepted their username as valid, then using Templates Conditionals I would do something like:
<if $memprofile['mynewcolumn'] == 1 then>
<a href="www.example.com/personal.php?name={$memprofile['username']}">Visit My Personal Page</a>
</if>

($memprofile['mynewcolumn'] will be "0" if user was not validated.)
Pages: 1 2