miniBB ® miniBB®
miniBB Support Forums
 | Forums | Register | Reply | Search | Statistics | Manual |
Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /   

Adding link to UserInfo page in header menu

Author Anonymous
Guest
#1 | Posted: 10 Oct 2007 16:17 
How can I add the link:

http://forum.myforum.com/index.php?action=userinfo&user=1

as MyStats in the header menu. I know how to add the html code in the template/main_header but how do I get the user=1 to change with whatever the users id is signed in? So if user 78 signs in the link <a href="http://forum.myforum.com/index.php?action=userinfo&user=78">MyStats</a> will appear in the header menu. I hope I was clear enough.

Author lime
Registered
#2 | Posted: 11 Oct 2007 00:13 
Try using {$user_id} in your template, for example:

<a href="http://forum.myforum.com/index.php?action=userinfo&user={$user_id}">MyStats</a>

Author Anonymous
Guest
#3 | Posted: 11 Oct 2007 09:32 
Works great, thanks man, I didn't know the variable $user_id was declared yet. If your not logged in and click it, it says User does not exist!!! because the user_id == 0 which is find.

Author Paul
Lead Developer
#4 | Posted: 11 Oct 2007 09:54 | Edited by: Paul 
Paste this in bb_plugins.php:

/* Link to UserInfo page */

if($user_id>0) $myStatsLnk="<a href=\"{$main_url}/{$indexphp}action=userinfo&amp;user={$user_id}\">MyStats</a> {$l_sepr} ";

/* --Link to UserInfo page */

Then paste in templates/main_header.html:

{$myStatsLnk}

;-)

Author Anonymous
Guest
#5 | Posted: 11 Oct 2007 10:16 
That works better :)

Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications / Adding link to UserInfo page in header menu Top

Your Reply Click this icon to move up to the quoted message

 Short link for this topic:

 ?
You are welcome to post anonymously, by entering a nickname with no password (if the similar Username has not been taken yet), or by leaving both fields empty. If you have a forums account, you can also sign in from this page without posting a message, or sign in and post at once.


Before posting, make sure your message is compliant with our forum posting rules. If not, it may be locked or deleted with no explanation.
 
miniBB Support Forums Powered by Forum Software miniBB ® Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contacts
Install the Captcha add-on: protect your miniBB-forums from the automated spam and flood.
Captcha Addon for miniBB