vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   User Info in header (https://vborg.vbsupport.ru/showthread.php?t=47537)

Auero 01-09-2003 05:07 PM

User Info in header
 
I want to be able to put the user information into the header template.

Such info as .... Username, PM information, Time, Avatar. Is this possible??

Also having this information in the header will it work on all pages such as showthread, member etc...

Thanks.

Xenon 01-09-2003 05:08 PM

You can just have in the header what is defined in global.php

so the complete $bbuserinfo array is useable there :)

Auero 01-09-2003 05:21 PM

Could you just give me a short example of this please?

Auero 01-09-2003 05:25 PM

1 Attachment(s)
Okay I have the Username in the header now :)

But what variables would I use to display the info in the image I've attached below.

Auero 01-09-2003 05:32 PM

Ah okay lol I'm getting this myself now. I should try before asking for help.

I've done the username and the posts. I'm a little unsure of what to use for the time, PM info and the avatar. Any help.

Xenon 01-09-2003 08:15 PM

well, pms are not saved this time, you have to add a query....

try to add this into your phpinclude template:
PHP Code:

$allpm=$DB_site->query_first("SELECT COUNT(*) AS messages,
                                SUM(IF(dateline>
$bbuserinfo[lastvisit] AND folderid=0,1,0)) AS newpm,
                                SUM(IF(messageread=0 AND folderid=0,1,0)) AS unreadpm
                                FROM privatemessage WHERE userid=
$bbuserinfo[userid] $ignoreusers"); 

then you can use $allpm[messages] as the numer of all messages, and $allpm[newpm] as the number of new pms

avatars you have to add this into phpinclude:
PHP Code:

if ($bbuserinfo[hascustomavatar] and $avatarenabled) {
                
$bbuserinfo[showavatar]="<img src=\"avatar.php?userid=$post[userid]&dateline=$post[avatardateline]\">";
            } else {
                
$bbuserinfo[showavatar]="";
            } 

then use $bbuserinfo[showavatar]

it will show the custom avatar of a user :)

Auero 01-09-2003 10:35 PM

Thank you so much Xenon this is great, it helps a lot :D

Auero 01-10-2003 04:26 PM

Okay, I've tried the code you've given me and the Avatar part doesn't work. I can get a default unregistered avatar to show.
} else {
$bbuserinfo[showavatar]="";
}
- If I put an image tag into here It will display.

Although I have a avatar set for my user It will not show.

NTLDR 01-10-2003 05:10 PM

PHP Code:

$bbuserinfo[showavatar]="<img src=\"avatar.php?userid=$post[userid]&dateline=$post[avatardateline]\">"

Needs to be:

PHP Code:

$bbuserinfo[showavatar]=getavatarurl($bbuserinfo[userid]); 

Note this will add another query too ;)

Auero 01-10-2003 06:12 PM

Thanks, I couldn't wait though as it was for a client. So I got help from Mist. Thanks a lot though :D


All times are GMT. The time now is 06:03 AM.

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.02212 seconds
  • Memory Usage 1,729KB
  • 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
  • (4)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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