vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   need help with avatarrevision (https://vborg.vbsupport.ru/showthread.php?t=311195)

ye22 05-09-2014 01:15 PM

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.

Lynne 05-09-2014 04:31 PM

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);


ye22 05-09-2014 06:05 PM

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.

kh99 05-09-2014 07:59 PM

Try creating a plugin using hook location forumhome_loggedinuser_query and this code:
Code:

$hook_query_fields .= ", user.avatarrevision ";

ye22 05-09-2014 08:13 PM

Quote:

Originally Posted by kh99 (Post 2497038)
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 :/

Lynne 05-09-2014 08:59 PM

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?

kh99 05-09-2014 09:13 PM

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'];
}


ye22 05-09-2014 09:19 PM

Quote:

Originally Posted by Lynne (Post 2497053)
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 (Post 2497054)
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!! :D
Thanks alot dude! :)

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

Just asking.., is it the same with "avatarid" and "hascustom"? :D
i mean.. how to check if user has an avatar or not? :/

kh99 05-10-2014 05:01 PM

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).

ye22 05-10-2014 11:26 PM

Quote:

Originally Posted by kh99 (Post 2497173)
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!!


All times are GMT. The time now is 05:26 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.01105 seconds
  • Memory Usage 1,745KB
  • 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
  • (8)bbcode_code_printable
  • (1)bbcode_html_printable
  • (4)bbcode_quote_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