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
  #32  
Old 03-19-2001, 07:19 PM
Guest
 
Posts: n/a
Default

Another stunning effort. Just one question. I know you have been in close connection with the developers on this issue, so do you know if this hack will be in Beta 4? I just don't want to install it then re-install when beat 4 comes out.
Reply With Quote
  #33  
Old 03-19-2001, 07:32 PM
Guest
 
Posts: n/a
Default

Ok, this is the final thorn I will use today.

How about one last modification to avatar.php to prevent bandwidth stealers from circumventing the security measures people may put on the custom_avatars folder. Only bring this up because now there is a customavatar record again.

Either returning nothing, or the clear.gif image.

Ok, that's it... I promise. =) No, really! heheheh

Great work on the hack, and responding so quickly with a fix to the previous post of mine.
Reply With Quote
  #34  
Old 03-19-2001, 07:55 PM
Guest
 
Posts: n/a
Default

one more kier
you are the best of the best!
Reply With Quote
  #35  
Old 03-19-2001, 09:15 PM
Guest
 
Posts: n/a
Default

Quote:
Originally posted by PFunk
Either returning nothing, or the clear.gif image.
Easy, if you use avatars-as-files, just edit avatar.php and at the top of the file, under <?php just put

exit;

I'm not going to do anything more fancy than that, as it would add extra queries to avatar.php, which I am not prepared to do.
Reply With Quote
  #36  
Old 03-19-2001, 10:16 PM
Guest
 
Posts: n/a
Default

If you installed the hack previous to this message, please revisit the instructions and follow the steps to modify admin/user.php... I completely forgot to hack that file before
Reply With Quote
  #37  
Old 03-20-2001, 02:15 AM
Guest
 
Posts: n/a
Default

<< removed >>
Reply With Quote
  #38  
Old 03-20-2001, 02:58 AM
Guest
 
Posts: n/a
Default

Quote:
Originally posted by PFunk
Add this:

Code:
require("./global.php");
if ($usefileavatar) exit;
This will cause avatar.php not to return the graphic if Use File Avatars is enabled, otherwise, it works as before.
Oh my god do you not want to add that!!!!

If you use require("./global.php") in avatar.php, you will be executing huge numbers of queries every time an avatar is displayed...

This code should really (really) not be added!
Reply With Quote
  #39  
Old 03-30-2001, 03:55 PM
Guest
 
Posts: n/a
Default

Kier,

Great hack! This should speed up my forum a lot.

One thing before I install this hack. Will the database change that this hack does cause any problems when I upgrade to beta4? (Other than changing the php files of course)

Thanks again!
Reply With Quote
  #40  
Old 03-30-2001, 07:51 PM
Guest
 
Posts: n/a
Default

Hello Kier,

Would I be able to use this hack in conjunction with upgrading my 1.13 forum.

See, right now the current VB 2.0 upgrade1.php script does not upgrade my "custom_avatar" table from freddies VB 1.13 "Custom Avatar HAck"...which means my users will have to all re-upload their custom avatars.

You seem to be a hack master around here lately...do you think you could figure it out?

If so here is the information:
Here is my old 1.13 "custom_avatar" table:
Code:
CREATE TABLE custom_avatar (
   id int(6) NOT NULL auto_increment,
   bin_data longblob NOT NULL,
   filename varchar(50) NOT NULL,
   filesize varchar(50) NOT NULL,
   filetype varchar(50) NOT NULL,
   userid int(10) unsigned DEFAULT '0' NOT NULL,
   PRIMARY KEY (id),
   UNIQUE userid (userid),
   KEY userid_2 (userid)
);
And here is the new VB 2.0 "customavatar" table:
Code:
CREATE TABLE customavatar (
   userid int(10) unsigned DEFAULT '0' NOT NULL,
   avatardata mediumtext NOT NULL,
   PRIMARY KEY (userid)
);
Anything you could do to help me salvage my current user's custom avaatrs would be fantastic. Even if it means upgrading the custom avatars into your hack...which I want to store them outside the database anyway.

Thanks for your time.
Reply With Quote
  #41  
Old 03-30-2001, 07:59 PM
Guest
 
Posts: n/a
Default

drop the new customavatar table.

rename custom_avatar to customavatar.

Drop the fields id, filename,filesize, & filetype

rename bin_data to avatardata, change the type to mediumtext.

Drop the second index userid_2

p.s. now watch your avatars blow up in size as my hack made no checks on image height/width, only filesize. It used img tags to force all images to be the same size when displayed.
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 07:52 PM.


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.04460 seconds
  • Memory Usage 2,284KB
  • 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
  • (2)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