The Arcive of vBulletin Modifications Site. |
|
Details »»
|
|||||||||||||||||||||||||
Hi,
I'm in the process of switching boards from UltraBoard to vBulletin. Now what most of my UB2K users were used to is a "login"-button which changes to "logout" if a member is logged in. Is there a possibility to do it like: [pseudocode] if logged_in { <img scr="top_logout" (...) > else <img scr="top_login" (...) > } [/pseudocode] Unfortunately I'm totally new to php as I only was confronted with perl in UB2K. Can anyone post how to do this or at least give a hint were to look for? Thanks, -Tom P.S: I mean the top_buttons, e.g. and ![]() btw: I changed my mind since my last post in maybe the wrong place ( http://www.vbulletin.com/forum/showt...threadid=16465 ) Show Your Support
|
|||||||||||||||||||||||||
| Comments |
|
#2
|
||||
|
||||
|
Modify your header template to contain the variable $loginlogout where you want this image and place this in your phpinclude template:
if ($bbuserinfo[userid]) { $loginlogout = "<a href=(...)><img src="login.gif"(...)>"; } else { $loginlogout = "<a href=(...)><img src="logout.gif"(...)>"; } |
|
#3
|
|||
|
|||
|
Hi,
thanks for your help! I don't have php4 installed, so afaik the phpinclude template won't be parsed, but I pasted the code into the global.php and it worked. This is what I used: Code:
// Register button swapping
if ($bbuserinfo[userid]) {
$registerbutton = "<a href=\"member.php?s=$session[sessionhash]&action=logout\"><img src=\"images/top_logout.gif\" alt=\"Logout\" border=\"0\"></a>";
} else {
$registerbutton = "<a href=\"register.php?s=$session[sessionhash]&action=signup\"><img src=\"images/top_register.gif\" alt=\"Register\" border=\"0\"></a>";
}
Thanks a bunch for your help freddie ![]() -Tom |
|
#4
|
||||
|
||||
|
The phpinclude template works with PHP3 or PHP4. Perhaps you are referring to the comments that are in there by default. That specific command if uncommented is a PHP4 only command and is there to give you pointers on how to include a file for your header.
|
|
#5
|
|||
|
|||
|
Aaah, I see. Gee, thanks for the hint!
-Tom
|
|
#6
|
||||
|
||||
|
can someone post the exact place to put this in the templates please to replace the register button with the logout button on my forums.
Other forum hackers say In so and so template, after Quote:
Quote:
Please post it like that as I am a complete no hope with PHP and dont really want to use trial and error until I get it right. |
![]() |
|
|