vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Login / Logout button little hack... (https://vborg.vbsupport.ru/showthread.php?t=16815)

ThomasP 05-14-2001 05:29 PM

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. http://mcseboard.de/forum/images/top_login.gif and http://mcseboard.de/forum/images/top_logout.gif

btw: I changed my mind since my last post in maybe the wrong place ( http://www.vbulletin.com/forum/showt...threadid=16465 )

Freddie Bingham 05-14-2001 06:16 PM

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"(...)>";
}

ThomasP 05-14-2001 09:07 PM

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>";
}

The thing with an extra login/logout wasn't that slick as I thought so I stuck to the previous idea to swap the "register" button with the "logout" button.

Thanks a bunch for your help freddie :)
-Tom

Freddie Bingham 05-14-2001 09:46 PM

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.

ThomasP 05-15-2001 12:19 PM

Aaah, I see. Gee, thanks for the hint!
-Tom :)

Airwaves 12-31-2001 09:57 PM

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:

someline of code
put

Quote:

this piece of code


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.


All times are GMT. The time now is 08:57 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01006 seconds
  • Memory Usage 1,724KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete