Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Add-ons

Reply
 
Thread Tools
UKBL ~ Auto Rotating Avatars Details »»
UKBL ~ Auto Rotating Avatars
Version: 1.00, by UKBusinessLive UKBusinessLive is offline
Developer Last Online: Feb 2012 Show Printable Version Email this Page

Category: Add-On Releases - Version: 3.8.3 Rating:
Released: 08-11-2009 Last Update: Never Installs: 14
Re-useable Code Additional Files Translations Is in Beta Stage  
No support by the author.

UKBL ~ Auto Rotating Avatars


Heres a nice hack which will let you, your moderators, and perhaps as a treat for your members, the ability to rotate their avatars on every frefresh.

Imagine having an avatar directory and a nice collection of avatars, which will automatically refresh every time you open a new page or refresh your screen.

You can use this just for yourself, your staff and perhaps offer it as a paid item to your members.

Interested ? Lets get going............

Step 1

First step is to create a .htaccess file,add the following line to it

Code:
<Files rotate.gif> 
                ForceType application/x-httpd-php 
</Files>
What this does is, it makes the PHP file parse as a graphic file readable by VBulletin, If you just added the rotate.php as a url in your upload avatar box it would simply come back as invaild file.

The Apache Web server provides a feature called .htaccess file, which provides commands to control a Web site. This file is simply a text file containing Apache directives. Those directives apply to the documents in the directory where the file is located, and to all subdirectories under it as well. Other .htaccess files in subdirectories may change or nullify the effects of those in parent directories.

You can use any text editor to create or make changes to .htaccess files. Keep in mind that commands in these files should be placed on one line only, so if your text editor uses word-wrap, make sure it's disabled. Be sure .htaccess file is uploaded in ASCII mode, not BINARY, or it won't work.

Your text editor or operating system may probably not allow to save file as .htaccess. The solution is to save the file as htaccess.txt and upload it to your server. After doing that, you should use your FTP client and rename the file to it's proper name.


Referance: .htaccess file - short tutorial and the most notable and useful htaccess examples. http://www.buildwebsite4u.com/advanc...ess-file.shtml

Ok guys, thats part one done

Now Lets get the coding done..

Step 2

Open Notebook or a similar text editor on your PC and copy the following .PHP code

PHP Code:
<?php 
 
Header
('Cache-Control: no-cache'); 
Header('Pragma: no-cache'); 
 
$dh opendir("."); 
while (
false !== ($file readdir($dh)))  

  if (
preg_match('/\.gif$/i'$file) and $file != "rotate.gif")  
  { 
         
$filelist[] = $file
  } 

 
srand((double)microtime()*1000000); 
$picnum rand(0sizeof($filelist) - 1); 
 
header("Location: " $filelist[$picnum]); 
 
closedir($dh); 
?>
Save the file as rotate.gif. Once thats done, Just make a new directory on your server, called "avatar" and upload all your Avatar graphics to this directory using your FTP package or even Cpanel, whatever your comfortable with.

I have made this for Gif files only, you need to make sure the avatar files are all in gif format, any others will not load, if you want to use a diffent graphics format, you need to edit the .htaccess code as well as changing the gif referance in the php code.

Now we need to upload our rotate.gif file (the one with the php code in) Our graphics and our .htaccess file all to the avatar directory.

Then all we need to do is go to our UserCP and enter our Avatar directory url, pointing to our rotate.gif file, something like this..

Code:
http://www.myforum/avatars/rotate.gif
Just add your url to your box shown below.



Remember you also need to keep within the avatar rules of the site, if the rules state 70 x 70 px avatars, it won't work if you upload 80 x 80 or even a larger file file than is permissable.

Thats its, I've no screenshots, but if you would like your site to be listed as a demo site please PM me, First 3 requests only please

As always please click install and i'll support you 100%

Download Now

File Type: zip Rotating Avatars.zip (103.5 KB, 75 views)

Screenshots

File Type: png Rotating Avatars.png (35.1 KB, 0 views)

Show Your Support

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

Comments
  #2  
Old 08-12-2009, 05:56 PM
vB Tree vB Tree is offline
 
Join Date: Dec 2008
Location: England
Posts: 125
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Congratulations on the release of this, and a thumbs up for getting this in 4 versions

Definitely will use this soon.

Thanks for the effort.
Reply With Quote
  #3  
Old 08-12-2009, 06:04 PM
UKBusinessLive UKBusinessLive is offline
 
Join Date: Sep 2008
Location: Essex, United Kingdom
Posts: 1,637
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by vB Tree View Post
Congratulations on the release of this, and a thumbs up for getting this in 4 versions

Definitely will use this soon.

Thanks for the effort.
Thanks VB Tree, Its pretty bog standard should work on any version really, Never forget the 3.5 guys
Reply With Quote
  #4  
Old 08-12-2009, 10:30 PM
Manoel J?nior Manoel J?nior is offline
 
Join Date: Feb 2009
Location: SP / Brasil
Posts: 778
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very good .. Congratulations!

But I want something different, I would turn this option only for users who have no avatar.

It would be possible to include this option?
Reply With Quote
  #5  
Old 08-12-2009, 10:38 PM
dengbej's Avatar
dengbej dengbej is offline
 
Join Date: Aug 2008
Posts: 30
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

very good.i will try.thanks.
Reply With Quote
  #6  
Old 08-12-2009, 10:47 PM
goxy63 goxy63 is offline
 
Join Date: Oct 2008
Location: its like another planet:D
Posts: 657
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Manoel J?nior View Post
Very good .. Congratulations!

But I want something different, I would turn this option only for users who have no avatar.

It would be possible to include this option?
That would be cool
Reply With Quote
  #7  
Old 08-13-2009, 04:47 AM
UKBusinessLive UKBusinessLive is offline
 
Join Date: Sep 2008
Location: Essex, United Kingdom
Posts: 1,637
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The only way i could think of anything like that would be if you used it with that hack that adds an avatar for members that don't have one??

i guess that would be cool
Reply With Quote
  #8  
Old 08-13-2009, 04:57 AM
HMBeaty's Avatar
HMBeaty HMBeaty is offline
 
Join Date: Sep 2005
Posts: 4,141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Manoel J?nior View Post
Very good .. Congratulations!

But I want something different, I would turn this option only for users who have no avatar.

It would be possible to include this option?
Quote:
Originally Posted by UKBusinessLive View Post
The only way i could think of anything like that would be if you used it with that hack that adds an avatar for members that don't have one??

i guess that would be cool
Well, I have something else is mind for getting this to work. I might work on this tomorrow if I have time.
Reply With Quote
  #9  
Old 08-13-2009, 01:12 PM
Saint_I_Am Saint_I_Am is offline
 
Join Date: Aug 2008
Posts: 81
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Couple questions

1 - How can we have both gif and jpg images allowable?

2 - Can avatars be uploaded using the "Browse" button?

Thanks
Reply With Quote
  #10  
Old 08-13-2009, 01:20 PM
valdet's Avatar
valdet valdet is offline
 
Join Date: Feb 2007
Posts: 505
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Gerry this is a great hack. I was rotating avatars through a simple plugin on April 1-st last year. Everyone liked it.

But your version is much better and there is still room for more improvement.
Reply With Quote
Reply

Thread Tools

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 10:36 AM.


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.04642 seconds
  • Memory Usage 2,330KB
  • Queries Executed 24 (?)
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
  • (2)bbcode_code
  • (1)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (2)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)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_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete