Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
  #1  
Old 01-09-2003, 05:07 PM
Auero Auero is offline
 
Join Date: Aug 2002
Posts: 50
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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.
Reply With Quote
  #2  
Old 01-09-2003, 05:08 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

so the complete $bbuserinfo array is useable there
Reply With Quote
  #3  
Old 01-09-2003, 05:21 PM
Auero Auero is offline
 
Join Date: Aug 2002
Posts: 50
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Could you just give me a short example of this please?
Reply With Quote
  #4  
Old 01-09-2003, 05:25 PM
Auero Auero is offline
 
Join Date: Aug 2002
Posts: 50
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 01-09-2003, 05:32 PM
Auero Auero is offline
 
Join Date: Aug 2002
Posts: 50
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 01-09-2003, 08:15 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #7  
Old 01-09-2003, 10:35 PM
Auero Auero is offline
 
Join Date: Aug 2002
Posts: 50
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you so much Xenon this is great, it helps a lot
Reply With Quote
  #8  
Old 01-10-2003, 04:26 PM
Auero Auero is offline
 
Join Date: Aug 2002
Posts: 50
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #9  
Old 01-10-2003, 05:10 PM
NTLDR's Avatar
NTLDR NTLDR is offline
Coder
 
Join Date: Apr 2002
Location: Bristol, UK
Posts: 3,644
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #10  
Old 01-10-2003, 06:12 PM
Auero Auero is offline
 
Join Date: Aug 2002
Posts: 50
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:04 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.08333 seconds
  • Memory Usage 2,264KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete