vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Design and Graphics Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=168)
-   -   logged in user name in header template?? (https://vborg.vbsupport.ru/showthread.php?t=160413)

bobjones 10-16-2007 11:01 PM

logged in user name in header template??
 
does anyone know a variable that contains the actual username of the logged in user that I can put in the header template? eval() wont read $vbulletin->userinfo['username']...

I tried stabbing in the dark at $show[user], $show[username], and [user, username] on $foruminfo, $threadinfo, $userinfo, and $vbotions to no avail

--------------- Added [DATE]1192602033[/DATE] at [TIME]1192602033[/TIME] ---------------

hrm. I don't know how koesher this is, but I just hacked the record in the template table and changed
Code:

".(($show['guest']) ? ("
        <a href=\"/forum_login.php\">Sign In</a> | <a href=\"/forum/register.php\">Register</a>
") : ("
        Welcome Back!
"))."

to
Code:

".(($show['guest']) ? ("
        <a href=\"/forum_login.php\">Sign In</a> | <a href=\"/forum/register.php\">Register</a>
") : ("
        Welcome, <b>".$vbulletin->userinfo['username']."</b>!
        <a href=\"/forum/login.php?do=logout&logouthash=".$vbulletin->userinfo['logouthash']."\">
        <font size=\"1\">Log Out</font></a>
"))."

It's a little buggy on the logout, but basically works. Hope this is useful to someone...

if you are wondering about the wierd PHP syntax, it's called a ternary operator. Read: http://www.php.net/manual/en/languag...arison.ternary

Dismounted 10-17-2007 05:38 AM

$bbuserinfo[username]

bobjones 10-17-2007 10:46 AM

$bbuserinfo!!! awesome. It gave me [username], [userid], and [logouthash], which is exactly what i needed.

Thank you very much.

Any insight on checking $bbuserinfo or $show[guest] accurately on the logout page? As of now, when I click logout, it logs me out, but still shows $show[guest] = '' in the header until i go to another page...

Dismounted 10-18-2007 04:54 AM

The user is technically still logged in until the end of execution of the logout page.


All times are GMT. The time now is 08:11 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.01605 seconds
  • Memory Usage 1,716KB
  • 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
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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