Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 05-09-2014, 01:15 PM
ye22 ye22 is offline
 
Join Date: Dec 2002
Location: cairo
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default need help with avatarrevision

hey all.. i need help getting "$loggedin[avatarrevision]" to work in Template: "forumhome_loggedinuser"
As when i use it in that template it just doesn't return any value at all.

Thanks in advanced.
Reply With Quote
  #2  
Old 05-09-2014, 04:31 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is that variable even defined there? Located where the template is rendered in the files (do a global search in the vbulletin directory for it) and then look at the code above where the template is rendered. Do you see that variable defined? If not, you will need to write a plugin to define it first before you can use it.

You could *try* adding this line to your config.php file after the <?php and see if it works, but I am guessing it won't but it's worth a try.
HTML Code:
// Force all userinfo queries to include avatar information. 
define('AVATAR_ON_NAVBAR', 1);
Reply With Quote
  #3  
Old 05-09-2014, 06:05 PM
ye22 ye22 is offline
 
Join Date: Dec 2002
Location: cairo
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

and how to make such plugin?
sorry but i'm bad in such stuff :/
i tried the config.php thing but it didn't work.
Reply With Quote
  #4  
Old 05-09-2014, 07:59 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try creating a plugin using hook location forumhome_loggedinuser_query and this code:
Code:
$hook_query_fields .= ", user.avatarrevision ";
Reply With Quote
  #5  
Old 05-09-2014, 08:13 PM
ye22 ye22 is offline
 
Join Date: Dec 2002
Location: cairo
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
Try creating a plugin using hook location forumhome_loggedinuser_query and this code:
Code:
$hook_query_fields .= ", user.avatarrevision ";
tried.. but still :/

http://i.imgur.com/L5kcU8k.png
http://i.imgur.com/6O4ZP2W.png

the "$loggedin[avatarrevision]" doesn't output anything :/
Reply With Quote
  #6  
Old 05-09-2014, 08:59 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Have you looked at the database to verify it is there? Have you tried disabling all other plugins to make sure it isn't a plugin conflict? Are you looking at the correct style on your site?
Reply With Quote
Благодарность от:
ye22
  #7  
Old 05-09-2014, 09:13 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, you need an additional plugin because the current user is handled differently. Use hook location forumhome_loggedinuser and code:
Code:
if ($loggedin['userid'] == $vbulletin->userinfo['userid'])
{
   $loggedin['avatarrevision'] = $vbulletin->userinfo['avatarrevision'];
}
Reply With Quote
2 благодарности(ей) от:
Lynne, ye22
  #8  
Old 05-09-2014, 09:19 PM
ye22 ye22 is offline
 
Join Date: Dec 2002
Location: cairo
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
Have you looked at the database to verify it is there? Have you tried disabling all other plugins to make sure it isn't a plugin conflict? Are you looking at the correct style on your site?
Well..
i was using : https://vborg.vbsupport.ru/showthrea...light=XFAvatar
for the avatar thing.. and yea i am tring to disable other plugins atm(as i am using alot of them) but still.
and about the style.. yea i am sure about it.

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

Quote:
Originally Posted by kh99 View Post
OK, you need an additional plugin because the current user is handled differently. Use hook location forumhome_loggedinuser and code:
Code:
if ($loggedin['userid'] == $vbulletin->userinfo['userid'])
{
   $loggedin['avatarrevision'] = $vbulletin->userinfo['avatarrevision'];
}
IT WORKS!!
Thanks alot dude!

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

Just asking.., is it the same with "avatarid" and "hascustom"?
i mean.. how to check if user has an avatar or not? :/
Reply With Quote
  #9  
Old 05-10-2014, 05:01 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I guess to get all the avatar info, for the first plugin it would be something like:
Code:
$hook_query_fields .= ", user.avatarrevision, avatar.avatarpath, customavatar.dateline AS avatardateline, customavatar.width AS avatarwidth, customavatar.height AS avatarheight, NOT ISNULL(customavatar.userid) AS hascustomavatar ";
$hook_query_joins .= " LEFT JOIN " . TABLE_PREFIX . "avatar AS avatar ON(avatar.avatarid = user.avatarid)
			LEFT JOIN " . TABLE_PREFIX . "customavatar AS customavatar ON(customavatar.userid = user.userid)";
then in the second , maybe:
Code:
if ($loggedin['userid'] == $vbulletin->userinfo['userid'])
{
   $loggedin['avatarrevision'] = $vbulletin->userinfo['avatarrevision'];
   $loggedin['avatarpath'] = $vbulletin->userinfo['avatarpath'];
   $loggedin['avatardateline'] = $vbulletin->userinfo['avatardateline'];
   $loggedin['avatarwidth'] = $vbulletin->userinfo['avatarwidth'];
   $loggedin['avatarheight'] = $vbulletin->userinfo['avatarheight'];
   $loggedin['hascustomavatar'] = $vbulletin->userinfo['hascustomavatar'];
}

But I haven't tried it, so I don't know if all those fields are there for the current user (but I think they should be).
Reply With Quote
  #10  
Old 05-10-2014, 11:26 PM
ye22 ye22 is offline
 
Join Date: Dec 2002
Location: cairo
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
I guess to get all the avatar info, for the first plugin it would be something like:
Code:
$hook_query_fields .= ", user.avatarrevision, avatar.avatarpath, customavatar.dateline AS avatardateline, customavatar.width AS avatarwidth, customavatar.height AS avatarheight, NOT ISNULL(customavatar.userid) AS hascustomavatar ";
$hook_query_joins .= " LEFT JOIN " . TABLE_PREFIX . "avatar AS avatar ON(avatar.avatarid = user.avatarid)
			LEFT JOIN " . TABLE_PREFIX . "customavatar AS customavatar ON(customavatar.userid = user.userid)";
then in the second , maybe:
Code:
if ($loggedin['userid'] == $vbulletin->userinfo['userid'])
{
   $loggedin['avatarrevision'] = $vbulletin->userinfo['avatarrevision'];
   $loggedin['avatarpath'] = $vbulletin->userinfo['avatarpath'];
   $loggedin['avatardateline'] = $vbulletin->userinfo['avatardateline'];
   $loggedin['avatarwidth'] = $vbulletin->userinfo['avatarwidth'];
   $loggedin['avatarheight'] = $vbulletin->userinfo['avatarheight'];
   $loggedin['hascustomavatar'] = $vbulletin->userinfo['hascustomavatar'];
}

But I haven't tried it, so I don't know if all those fields are there for the current user (but I think they should be).
IT WORKS TOO!

Thanks dude!!
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 07: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.04267 seconds
  • Memory Usage 2,267KB
  • Queries Executed 13 (?)
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
  • (8)bbcode_code
  • (1)bbcode_html
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (3)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (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_postinfo_query
  • fetch_postinfo
  • 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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete