Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by Kier Kier is offline
Developer Last Online: May 2011 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 03-18-2001 Last Update: Never Installs: 52
 
No support by the author.

Updated for vBulletin 2.2.2, 5th February 2002

Since there has been so much demand for this, I wrote a hack that will allow you to store all your custom avatars as files, rather than in the mySQL database.



Doing this will have the following benefits:
  • Avatars folder can be protected by .htaccess (Apache only) to prevent bandwidth stealing
  • No SQL queries or PHP code required to display custom avatars - server load decreases
  • No cacheing issues with Internet Explorer 5.5, so server bandwidth use should decrease
The install script will make the necessary modifications to your database, install a control panel option to switch the file-based avatars on, and convert your existing custom avatars from the database into files.

All avatar options that are present when using the standard mySQL avatar system are still present, and users will not notice a difference in the interface.

Full instructions for altering your PHP files are included in the zip file.

Once you have made the necessary modifications to the PHP scripts, you should run the enclosed install_favatar.php script from your admin/ folder.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 03-19-2001, 04:16 PM
Guest
 
Posts: n/a
Default

They are just RENAMED to GIFs or are they converted to GIFs?
Reply With Quote
  #23  
Old 03-19-2001, 04:21 PM
Guest
 
Posts: n/a
Default

Quote:
They are just RENAMED to GIFs or are they converted to GIFs?
There is no "conversion" from one type to another. The data is stored as binary, and when "displayed" using avatar.php, it adds
Code:
header("Content-type: image/gif");
so your browser will believe it's a gif file. The contents of your jpg are unchanged, just sent to the browser as image/gif so it can be displayed.
Reply With Quote
  #24  
Old 03-19-2001, 04:22 PM
Guest
 
Posts: n/a
Default

Quote:
Originally posted by -saturn-
They are just RENAMED to GIFs or are they converted to GIFs?
They are just renamed to GIF. This also happens (in a roundabout sort of way) with custom avatars stored in the database (they send a content header which describes their content to the browser as 'image/gif')
Reply With Quote
  #25  
Old 03-19-2001, 04:25 PM
Guest
 
Posts: n/a
Default

problem with showthread.php, private.php, announcement.php, admin/functions.php logic.

If there exists a customavatar record for the poster, it works great. But if you deleted all the customavatar table records, there's a problem.

Code:
if ($post[hascustomavatar] and $avatarenabled) {
        if ($usefileavatar) $avatarurl="custom_avatars/avatar$post[userid]_$post[avatarrevision].gif";
        else $avatarurl="avatar.php?userid=$post[userid]";
hascustomavatar is false because customavatar.avatardata is null, therefore, it can never check to see if $usefileavatar is true or not. There needs to be a way of determining if a customavatar that's saved as a file exists for that user. Maybe checking avatarrevision > 0.

Code:
 if ($post[avatarrevision]>0 and $usefileavatar and $avatarenabled) {
             $avatarurl="custom_avatars/avatar$post[userid]_$post[avatarrevision].gif";
            } else {
              if ($post[hascustomavatar] and $avatarenabled) $avatarurl="avatar.php?userid=$post[userid]";
          }
member.php - Also, when a customavatar is deleted or changed to a predefined avatar, the user record needs to be updated to change avatarrevision=0.

Let me know if I am way off base here.
Reply With Quote
  #26  
Old 03-19-2001, 04:45 PM
Guest
 
Posts: n/a
Default

You're right. I'll look into it.
Reply With Quote
  #27  
Old 03-19-2001, 04:51 PM
Guest
 
Posts: n/a
Default

I know you can already do this, but this isn't the way it should be done. Its a pain if users want to change all the time or test new ones out.



Quote:
Originally posted by tubedogg


You can already do this, in a round-about-sort-of-way. Just set Custom Avatars to No (in Options) then go into User > Find > username > Edit > change avatar and you can set a custom avatar even if it's disabled for the board at large.
Reply With Quote
  #28  
Old 03-19-2001, 05:44 PM
Guest
 
Posts: n/a
Default

As Pfunk pointed out, there was a logic error which occurred if you deleted the contents of your customavatar table...

I did sat in the instructions and in the install script that I did not recommend that you empty the custom avatar table unless you really (really) had a good reason to do so.

In any case, the code is now fixed. Visit the instructions page and make the necessary modifications to member.php - the other files do not need to be altered if you have already hacked them.

If any of your members' avatars are not showing up, simply get them to re-upload their avatar and it will fix itself.
Reply With Quote
  #29  
Old 03-19-2001, 05:55 PM
Guest
 
Posts: n/a
Default

Thank you Kier!
Reply With Quote
  #30  
Old 03-19-2001, 06:14 PM
Guest
 
Posts: n/a
Default

Quote:
Originally posted by pestilence
yet another fine hack well done kier btw when does your new website open to the general public ?
not yet
Reply With Quote
  #31  
Old 03-19-2001, 06:34 PM
Guest
 
Posts: n/a
Default

Another great hack Kier!
Thanks a lot
Reply With Quote
Reply


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 03:18 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06769 seconds
  • Memory Usage 2,285KB
  • Queries Executed 25 (?)
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
  • (3)bbcode_code
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_onlinestatus
  • (11)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_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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete