The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
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. |
#2
|
||||
|
||||
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); |
#3
|
|||
|
|||
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. |
#4
|
|||
|
|||
Try creating a plugin using hook location forumhome_loggedinuser_query and this code:
Code:
$hook_query_fields .= ", user.avatarrevision "; |
#5
|
|||
|
|||
Quote:
http://i.imgur.com/L5kcU8k.png http://i.imgur.com/6O4ZP2W.png the "$loggedin[avatarrevision]" doesn't output anything :/ |
#6
|
||||
|
||||
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?
|
Благодарность от: | ||
ye22 |
#7
|
|||
|
|||
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']; } |
#8
|
|||
|
|||
Quote:
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:
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? :/ |
#9
|
|||
|
|||
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)"; 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). |
#10
|
|||
|
|||
Quote:
Thanks dude!! |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|