Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 12-22-2008, 03:53 PM
pein87's Avatar
pein87 pein87 is offline
 
Join Date: Sep 2008
Posts: 352
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Mod Help

I was working on a mod to make te users avatar appeaer when they logged in but I havent made any progress. I moved the login to a side table that will be used a a nav bar but I cnat get the avatar to appear it will show the link but it willsay user not regetsered. I tried to take it straight from the postbit. Any sugestions? I was thinking about making another template for that but I`m afraid I dont know much about vbulletins progamming on how to make the avatar appaer if i make a new template. Can anyone help me out?
Reply With Quote
  #2  
Old 12-22-2008, 05:35 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Did you make sure to change the variable names from the postbit? The postbit uses $post whereas you want to use $username (like for someone else's profile) or in this case $bbusername (for the actual logged in user) in other parts of the site.
Reply With Quote
  #3  
Old 12-22-2008, 07:18 PM
pein87's Avatar
pein87 pein87 is offline
 
Join Date: Sep 2008
Posts: 352
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yup I tired $bbuserinfo but it did not show anything. I had someone do it as a paid mod but he said it added 8 queries. There isnt away to add th users avatar without making a new template or running new queries? I seen it done on subdreamer when you log in it shows your vbulletin avatar so i thought it wold be a great idea to do the same to the forum a kind of welcome back deal to make them feel appreciated. This may soudn dumb but why ouldnt i just use the postbit avatar? Is there any other array or varibale that the avatar is stored under so i can get this mod to work with out a bunch of more queries or a new template?
Reply With Quote
  #4  
Old 12-22-2008, 07:44 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've seen mods to put the avatar up near the username in the navbar area. Take a look at that modification and see how it is done. (I can't imagine it is eight extra queries!)
Reply With Quote
  #5  
Old 12-23-2008, 01:02 AM
RLShare RLShare is offline
 
Join Date: Jun 2008
Posts: 499
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

8 queries is insane, no it should not take an extra 8 queries to grab the avatar information. There are 3 tables in reguards to the the avatar. The user table holds the avatarid if the user is using an existing avatar and there is an avatar table that holds the information about the existing avatars you add through the adminCP. You can both query with a single query checking for the users id and condition where the avatarid of the user table equals the avatar id of the avatar table. If no results are returned then you know the user is not using admin added avatar.

They could still be using a custom avatar, and there is a custom avatar table that holds that information. You query it for a result based on the usersid and if it returns a result they are using a custom avatar..

At most it should only add 2 queries, and if I were you I would query the customavatar table first as more people use custom avatars.
Reply With Quote
  #6  
Old 12-23-2008, 02:11 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This can be done with no added queries. (That's right! Zero queries!) Have a look through the code for the "AVATAR_ON_NAVBAR" constant.
Reply With Quote
  #7  
Old 12-24-2008, 03:39 PM
pein87's Avatar
pein87 pein87 is offline
 
Join Date: Sep 2008
Posts: 352
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Are you for real no queries? Where can i find this at in the code? Sorry I`m fairly new to vbulletins way of programming and I only have 1 yr of php/sql experince.
Reply With Quote
  #8  
Old 12-25-2008, 08:00 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

A handy tool would be a mass search tool. Another handy hint is to look at fetch_avatar_from_userinfo().
Reply With Quote
  #9  
Old 12-30-2008, 04:24 PM
pein87's Avatar
pein87 pein87 is offline
 
Join Date: Sep 2008
Posts: 352
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, I searched found someone who already did it and made some adjustments to the code so it doesnt show an avatar if your a guest and did the side colum. Works like a charm at first thought you were joking with me thanks for making me do the work or else I neve would have learned anything.

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

One last question the code was bulky I tried this:

<if condition="$bbuser">
fetch_avatar_from_userinfo($user, true, false);
</if>
<else />

but it showed nothing Do I need to make a new template for this or am i missing something?
Reply With Quote
  #10  
Old 12-30-2008, 07:04 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

$bbuser is not valid, it is $bbuserinfo
Reply With Quote
Reply


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 12:35 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.04702 seconds
  • Memory Usage 2,250KB
  • Queries Executed 11 (?)
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
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete