The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Comments |
#182
|
|||
|
|||
Where did you creat the custom_avatars directory ?
I made one in every sub-directory of my board an chmod them all 777, but it doesn't work Do I have to upgrade to 2.2.2 ? |
#183
|
||||
|
||||
Quote:
thanks Kier |
#184
|
|||
|
|||
The custom_avatars folder needs to be created in same directory as the forumdisplay.php.
Instructions for this are in the install script, rather than the readme file. |
#185
|
|||
|
|||
Quote:
I successfully installed the hack, Great! Just some question: 1) The avatardata in db (customavatar table) is filled the same. I guess the hack purpose is not to make a smaller db, but to unload the db itself when showing posts/threads giving a direct html link. Is it true ? 2) The filename in db (customavatar table) - the original filename - is not filled any more.... File is renamed ok, but if i would keep the original name as before ? Even, if i switched settings from file to db, again ? 3) Why the avatarrevision field is in user table and not in customavatar one ? 4) I tried to parametrize the directory name: infact I added in setting table a row with a setup instruction like this: PHP Code:
Well. The problem is how to make read that global var to php's that don't import ./global.php... ? I though to something like PHP Code:
I haven't any idea how to manage global settings... Thanks a lot for your attention. Bye |
#186
|
|||
|
|||
1) The purpose of the hack is not to reduce the size of the database, but to dramatically reduce the number of queries required to display a page showing avatars.
It's much easier to simply show an image using the webserver than to have PHP query the database and grab the avatar from there. 2) Not sure about that... it should still store the filename 3) Because storing the avatar revision in the customavatar table would mean that the custom avatar table would still need to be queried = bad. 4) Um... not sure what you are trying to do here... |
#187
|
|||
|
|||
FoA, thanx for such a complete answer...
1) Agree! Will check better but seems is still a point in which avatar.php is accessed: userCP when updating avatar. I'll let you know if interested. 2) The filename isn't stored if the admin uploads a custom avatar for an user. Have no idea about the 'traditional' behavior of VB222 this case. 3) Elementar but right 4) In functions.php there's no global.php import, so the global variables aren't defined unless explicitly red. An assignment like mine just right before using the variable works fine (is the same way you read the usefileavatar global/setting var. Thanks again. |
#188
|
|||
|
|||
Quote:
Infact, I understand that'll not affect performance purposes - the first goal of this hack - but for a complete job, I think also the getavatarulr() function should be modified, and become as follows: Code:
// ###################### Start getavatarurl ####################### function getavatarurl($userid) { global $DB_site,$session; if ($avatarinfo=$DB_site->query_first("SELECT user.avatarid,user.avatarrevision,avatarpath,NOT ISNULL(avatardata) AS hascustom,customavatar.dateline FROM user LEFT JOIN avatar ON avatar.avatarid=user.avatarid LEFT JOIN customavatar ON customavatar.userid=user.userid WHERE user.userid='$userid'")) { if ($avatarinfo[avatarpath]!="") { return $avatarinfo[avatarpath]; } else if ($avatarinfo['hascustom']) { $avatarpath=trim($GLOBALS['avatarpath']); if ($GLOBALS['usefileavatar'] && $avatarpath>"") { $avatarurl = "$avatarpath/avatar$userid"."_$avatarinfo[avatarrevision].gif"; } else { $avatarurl = "avatar.php?userid=$userid&dateline=$avatarinfo[dateline]"; } return $avatarurl; } else { return ''; } } } Of course, I put my 'version' with the $avatarpath global variable. Your original, it should be replaced with the stored directory name... What do you think ? Thnx. |
#189
|
||||
|
||||
This is a revolutionary hack!
Thanks!!! |
#190
|
||||
|
||||
It works fine. I even made it work with the memberlist avatar hack.
However, I was wondering if someone could give me some advice. I still get avatars displayed using avatar.php rather than using the custom_avatar files with the following: 1) Avatar in a member's profile (member.php/ getinfo) 2) Avatar in the Welcome Panel 3) Avatar in the vBPortal logout panel Any suggestions? |
#191
|
||||
|
||||
Another note: Jawelin, your fix for the Welcome Panel and the User Profile does not help - avatar.php is still being used to display the avatars.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|