vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Custom Avatars as Files (updated for vBulletin 2.2.2) (https://vborg.vbsupport.ru/showthread.php?t=11760)

Cocomiel 01-23-2002 04:05 AM

The REAL working hack be found here

but Bira will try to continue bumping this thread forever (although he stolen my code, and his instructions still does not works) to stop people downloading my hack (which in fact, works) that have more features and allows you to select the custom avatars folder and no file modifications are needed to install).

Such attitude stopped me in releasing other hacks i've developed.

Bira, you should help the vB community, not Kier.
You can BAN me, i dont care

FWC 01-23-2002 04:20 AM

Quote:

Originally posted by Cocomiel
but Bira will try to continue bumping this thread forever
Huh? What are you talking about? Bira hasn't posted in this thread since December 5. I would hardly call that bumping. Of course, you just bumped this thread with your post. :)

Jawelin 01-25-2002 04:42 PM

Quote:

Originally posted by Jawelin

Sorry but - me too - have found in this long thread a lot of CONFLICTING solutions and got confused at all.

Even, lookin' at Bira's homepage, I found the 2.0 hack only....
I agree the [2.2.1] prefix on the post means the hack itself is upgraded to work on that version.... THE HACK, not a dozen of answers from everybody to the original author..

Thank you

I'm bumpin'up now ... :rolleyes:
I gov very confused by this contest; more, as I have very hacked 2.2.1 board , none of the installer works correctly as they don't find the strings!

Could someone put an END WORD to this challenge ?
Neither I agree with the sentence 'this isn't updated any more because it'll be released NEXT YEAR with vb3 ...

What are the difference between Kier's (Bira's) and Cocomiel's ones ?

Thanks a lot.

Jawelin 01-27-2002 11:59 AM

Quote:

Originally posted by bira
DarkReaper, I think that's what I did some 6 or so posts up :D
Sorry but member.php and user.php are much different than the Kier's 2.0 version.
So many of us got confused when trying to replace - even by hand - a non existing or different texts.
Even the Cocomiel's version doesn't resolve the problem, as each of ones seems a slight cut & paste of the other ones ....
:surprised :mad:

:confused:

Is it possible after SIX MONTHS of challenge, none of you gave a DECENT version of this hack ?

Sorry for my phrases, but I think it isn't acceptable from coder or people they want to help some other.

Thanks

Jawelin 02-05-2002 08:37 AM

Finally, could someone (Kier, Bira or ... ?? ) put a final word about this contest and, WAITING the science-fiction VB v3.0, give us an upgraded and working version for 2.2.2 ?

I would expected such a prefix in this thread, but it seems absolutely forgotten by the authors, the moderators and everybody, just like the Cocomiel's version.
Both, as already said, aren't accurate and simply a cut&paste of v2.0.x code overwritten upon the not-compatible v2.2.x code.

Hope this will have finally an affirmative solution.
Thanks.

Jawelin 02-05-2002 08:46 AM

Quote:

Originally posted by Cocomiel
The REAL working hack be found here
No. Your version, along with this one, doesn't work on v2.2.x as it has copied code from 2.0.3 and pasten over 2.2.1 code without changing anything, even the underlying code is much different !

That should be the right end of a very uncomfortable story ?

Thnx

Kier 02-05-2002 09:25 AM

Oh this is getting tedious.

Give me 10 minutes and I will post some code that will work in the latest versions of vB, seeing as no one seems able to do it for themselves...

Jawelin 02-05-2002 10:03 AM

Quote:

Originally posted by Kier
Oh this is getting tedious.

Give me 10 minutes and I will post some code that will work in the latest versions of vB, seeing as no one seems able to do it for themselves...

Thanks, Kier.
Much appreciated, even I dont agree with you.
I understand all these (two) threads are tedious and boring, but they gave a not-so-good light on hacker's professionality.
I would even able to make the corrections myself (as I did for similar hacks like store attachments as files by PPN in Beta section), but that thread is much different from this' tone level.
Here and on Cocomiel's one everything was said and all the opposite, without leading to anything different from a great and diffused confusion.

Actually is a very small problem, but do you think 167+70 replies shouldn't have completely discovered the theme ?

Thanks for you work, hwr.
Bye

Kier 02-05-2002 12:12 PM

A new and improved install script, together with new hacking instructions are attached to the first post in this thread.

Jawelin 02-05-2002 01:19 PM

Thank you so much!!!!
Hope this'll be a conclusive word.
I'll jump there!
Thnx

kontrabass 02-06-2002 02:59 AM

Regarding your 2.2.2 update:

I think there's an error under the /admin/user.php section - the first string of code to look for is listed twice with different instructions under each occurance:

// read file
$filesize=@filesize($filename);

TECK 02-06-2002 08:35 AM

[QUOTE]Originally posted by Jawelin

No. Your version, along with this one, doesn't work on v2.2.x as it has copied code from 2.0.3 and pasten over 2.2.1 code without changing anything, even the underlying code is much different !

That should be the right end of a very uncomfortable story ?

Thnx

Kier 02-06-2002 09:29 AM

Quote:

Originally posted by kontrabass
Regarding your 2.2.2 update:

I think there's an error under the /admin/user.php section - the first string of code to look for is listed twice with different instructions under each occurance:

// read file
$filesize=@filesize($filename);

You're absolutely right... I've updated the readme file now, thanks :)

kontrabass 02-06-2002 12:06 PM

Sorry to be a pest, but I'm still seeing the discrepancy in the readme, under /admin/user.php with the same 2 instances of code.... :)

Kier 02-06-2002 01:36 PM

I'm not sure how you can have checked the new readme, as it's contained within the zip, and that shows only one download at this time, and that download was me...

Download it again, making sure you don't get a cached copy, and try again.

kontrabass 02-06-2002 01:40 PM

Thanks - I was getting a cached copy. All set now :)

mvigod 02-06-2002 02:37 PM

I've been watching this one for a long time...thanks for finally getting to the update on it!

marc

Jawelin 02-06-2002 10:10 PM

Quote:

Originally posted by nakkid
hmmm... any mods can check the veridity and close cocomiel's thread? this is the worst part.. to steal someone else's hard work and stamp it as yours.
Actually Cocomiel, at later time, put on his first post something like 'UPDATE to Kier's hack'....
I think the most annoying theme was such a never-ending contest.
Very very grateful to Kier for his updated work, most of all for having stopped the sequel.
Thanks

TECK 02-07-2002 12:26 AM

[QUOTE]Originally posted by Jawelin

Actually Cocomiel, at later time, put on his first post something like 'UPDATE to Kier's hack'....
I think the most annoying theme was such a never-ending contest.
Very very grateful to Kier for his updated work, most of all for having stopped the sequel.
Thanks

kontrabass 02-07-2002 12:54 PM

One more thing: I think you should make a mention in the readme about how a custom_avatars directory needs to exist and have 777 permissions. Also that the .php script needs to be in /admin. I was able to find the instructions to do so in the old readme that someone attached to this thread, but not in the new.

Thanks for the hack - it's working great.

MaSTaKiLLaH 02-09-2002 08:29 PM

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 ?

eva2000 02-10-2002 07:54 PM

Quote:

Originally posted by Kier
A new and improved install script, together with new hacking instructions are attached to the first post in this thread.
motivation for me to upgrade :D

thanks Kier :)

Kier 02-11-2002 08:33 AM

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.

Jawelin 02-13-2002 08:20 AM

Quote:

Originally posted by Kier
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.

Hi, Kier.
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:

$DB_site->query("INSERT INTO setting (settingid, settinggroupid, title, 
varname, value, description, optioncode, displayorder) VALUES 
('',26,'Custom Avatar File Directory', 'avatarpath', '/home/username/avatars/custom', 
'The directory where custom avatars will be stored.', '', 10)"
); 

but realized that the directory name (unlike the PPN's attachment as files hack from which I took the tip) has to be a relative one, not absolute. Infact the same name is used the same time for http purposes and server side ones (copy/unlink/etc.). So that $avatarpath should be valued like 'images/avatars/custom' (without leading slashes) and simply replaced to your custom_avatars directory name.
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:

$avatarpath=trim($GLOBALS['avatarpath']); 

somewhere, but it seems not working...
I haven't any idea how to manage global settings... ;)

Thanks a lot for your attention.
Bye

Kier 02-13-2002 03:12 PM

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

Jawelin 02-13-2002 06:00 PM

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.

Jawelin 02-13-2002 08:22 PM

Quote:

Originally posted by Jawelin
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.

[...]

1) I think was forgotten a hack point.
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 '';
    }
  }
}

(I would put in bold main differences from the original... but ... :( )

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.

Erwin 02-16-2002 12:32 PM

This is a revolutionary hack!

Thanks!!!

Erwin 02-17-2002 09:29 AM

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?

Erwin 02-17-2002 09:39 AM

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.

newvbuser 02-18-2002 04:11 PM

If I install this hack, what happens to the 20 or so users who are already using custom avatars and those are all stored in the dbase? Do I have to redo each of them? Thx !!

Jawelin 02-18-2002 04:22 PM

Quote:

Originally posted by Erwin Loh
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.
Mine isn't a 'fix', but a variation... as I used a parameter to setup the custom avatar directories.

If you always see the avatar.php? link instead of the image directly on the server, most probably your code doesn't enter the main if clause to that url.
Are all the settings correct ?

Erwin 02-18-2002 05:13 PM

I only see the avatar.php in the instances that I listed out. In all other cases (eg. in the postbit), I see the avatar on the server.

Jawelin 02-18-2002 05:54 PM

I think that was exactly the goal the author of this hack would reach: obtain a sensitive decrease of db queries to show avatars.

:)

Erwin 02-18-2002 06:02 PM

I understand. :)

Thanks! The goal was reached admirably by the talented author.

newvbuser 02-19-2002 03:19 AM

This hack creates mod to the database. When and if we upgrade to 3.x or something in between 2.2.2 and 3.x, would it affect the upgrade or would we hvae to manually drop the tables or it'll just ignore the extra tables? :confused:

newvbuser 02-19-2002 04:09 AM

Yes I installed this hack and it works great (PM's and messages show filed avatars). clicking on Profile still shows avatars via database so I'm not sure what'll happen when a new custom avatar is added.

My question is how to make sure the database will work with the new version when it is released? :)

Thanks kier for the great hack!

Wolf42 02-19-2002 07:16 AM

Thanks for this hack Kier, works perfectly! :D

X-Fan 02-21-2002 03:29 AM

Works great, Kier, thanks!!!!

I didn't see any mention in the readme of where to create the custom_avatars folder or that it had to be chmod set to 777, but managed to glean that from posts in the thread. Still, should be something included in the readme.

Just my 2c Australian, +GST ;)

Jawelin 02-22-2002 02:22 PM

Kier, excuse if I'm still here.... :greedy:
Well. As I often said, your hack v2.2.2 works very well....

But, alone... :china: I tried installing other hacks like welcome panel and generally those which use getavatarurl() function to retrieve the name...
As already said, I even tried to modify myself that function you seem having forgotten in readme.htm.
Also tried to use the Bira's upgrade to 2.2.1 some posts above.

But still I see some image holes linking :
http://forumurl/images/avatars/custom/avatar1_0.gif
if I have a standard forum avatar and not a custom one....
(I'm UserId=1 and, remember, I changed the default directory, but it's seen correctly and this isn't the problem)...

It means that somehow the above fuction doesn't recognize I have a standard avatar and not a custom one.... :confused:
Instead, in postbit and elsewhere (where the function isn't called), the right standard avatar is displayed linking to the image and not to the avatar.php? script, correctly as your hack makes it.

Are you planning to modify - also standing on all the above difficulties users found - that function too ?
Why not ???
:noid:

Thanks


All times are GMT. The time now is 12:39 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.03248 seconds
  • Memory Usage 1,844KB
  • 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
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (11)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete