vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Add-On Releases - UKBL ~ Auto Rotating Avatars (https://vborg.vbsupport.ru/showthread.php?t=220738)

UKBusinessLive 08-11-2009 10:00 PM

UKBL ~ Auto Rotating Avatars
 
1 Attachment(s)
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.

https://vborg.vbsupport.ru/external/2009/08/19.png

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 :D

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

vB Tree 08-12-2009 05:56 PM

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.

UKBusinessLive 08-12-2009 06:04 PM

Quote:

Originally Posted by vB Tree (Post 1866018)
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 ;):D

Manoel J?nior 08-12-2009 10:30 PM

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?

dengbej 08-12-2009 10:38 PM

very good.i will try.thanks.

goxy63 08-12-2009 10:47 PM

Quote:

Originally Posted by Manoel J?nior (Post 1866157)
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

UKBusinessLive 08-13-2009 04:47 AM

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 ;)

HMBeaty 08-13-2009 04:57 AM

Quote:

Originally Posted by Manoel J?nior (Post 1866157)
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 (Post 1866292)
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.

Saint_I_Am 08-13-2009 01:12 PM

Couple questions

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

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

Thanks

valdet 08-13-2009 01:20 PM

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.

UKBusinessLive 08-13-2009 04:22 PM

Quote:

Originally Posted by valdet (Post 1866467)
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.

Hi Val,

Great to see your still about buddy and that fatherhood has not kept you from your friends here ;)

This was just a quick get together, using a .htaccess file so that the PHP file could be read as a gif file.

I have been looking at another way of making this work, but by using it for Signatures, Its slightly different in the code and you don't need an .htaccess file, so i guess you could use either code for the same purpose, i'll list it later and peeps can decide which to go for.

By all means use this code for any improvements, you can do, afterall we're all for helping each other :D

Hope that lovely Daughter of yours is letting you sleep :rolleyes:

UKBusinessLive 08-13-2009 04:25 PM

Quote:

Originally Posted by Saint_I_Am (Post 1866461)
Couple questions

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

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

Thanks

Hi Buddy,

You can pic and mix your graphics in this one, but the hack i'm uploading tonight which does auto rotating signatures, you'll be able to use that for your avatars, and upload whatever graphics allowed by the site admin ;)

Avatars are held in the "Avatar" directory and the filename which you need to add in your Avatar Url box is the one called rotate.gif - which really is the .php code ;)

UKBusinessLive 08-13-2009 04:26 PM

Quote:

Originally Posted by Redlinemotorsports (Post 1866295)
Well, I have something else is mind for getting this to work. I might work on this tomorrow if I have time.

Be my guest ;)

I'm all for improvement :up:

4nawadir.com 08-13-2009 04:30 PM

Verry nice ,
Thanks , installed
Thank you ...
رمضان مبارك للجميع

UKBusinessLive 08-13-2009 04:34 PM

Quote:

Originally Posted by 4nawadir.com (Post 1866592)
Verry nice ,
Thanks , installed
Thank you ...
رمضان مبارك للجميع

Your Welcomed Abdallah,

Wait till you see my Rotating "Clickable" Signature hack :eek: here goes https://vborg.vbsupport.ru/showthread.php?t=220807

Have fun ;)

Manoel J?nior 08-13-2009 10:33 PM

Quote:

Originally Posted by UKBusinessLive (Post 1866292)
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 ;)

Quote:

Originally Posted by Redlinemotorsports (Post 1866295)
Well, I have something else is mind for getting this to work. I might work on this tomorrow if I have time.

Cool

We are all waiting for that change. Thank you very much!

Daisyboo 08-16-2009 09:26 AM

Is there a limit on how many avatars will rotate?
Sorry I'm a bit confused lol

Does this mean a member can add their own avatars to rotate or just the ones provided by me?

nomoreturn 08-16-2009 03:24 PM

Need help i did as you told to do but its not works goterror when i submit link in usercp

http://www.mysite.com/avatar/rotate.gif
got this message
Imageinfo Failed:

Frondy 08-18-2009 12:39 PM

At last step, when I put the link to rotate.gif following error apears:

"Imageinfo Failed: "

what could be wrong?

Thanks

Edit:
Ops, I see the same post above mine, sorry

just.b.jealous 10-29-2009 04:20 AM

Quote:

Originally Posted by nomoreturn@hotm (Post 1868572)
Need help i did as you told to do but its not works goterror when i submit link in usercp

http://www.mysite.com/avatar/rotate.gif
got this message
Imageinfo Failed:

Quote:

Originally Posted by Frondy (Post 1869752)
At last step, when I put the link to rotate.gif following error apears:

"Imageinfo Failed: "

what could be wrong?

Thanks

Edit:
Ops, I see the same post above mine, sorry



Likewise- I get the "Imageinfo Failed: " error message as soon as I try to upload the rotate.gif (/php'd file)

just.b.jealous 10-30-2009 06:08 PM

Help from anyone would be greatly appreciated by many.

TheLastSuperman 12-06-2009 07:24 PM

Quote:

Originally Posted by Daisyboo (Post 1868388)
Is there a limit on how many avatars will rotate?
Sorry I'm a bit confused lol

Does this mean a member can add their own avatars to rotate or just the ones provided by me?

I believe it will read number one up until it ends i.e. 1.gif, 2.gif, 3.gif...33.gif etc per the code here:

Code:

srand((double)microtime()*1000000);
$picnum = rand(0, sizeof($filelist) - 1);
 
header("Location: " . $filelist[$picnum]);

Where I take it filelist means it's reading for the 1/2/3.gif's etc

Quote:

Originally Posted by nomoreturn@hotm (Post 1868572)
Need help i did as you told to do but its not works goterror when i submit link in usercp

http://www.mysite.com/avatar/rotate.gif
got this message
Imageinfo Failed:

Quote:

Originally Posted by Frondy (Post 1869752)
At last step, when I put the link to rotate.gif following error apears:

"Imageinfo Failed: "

what could be wrong?

Thanks

Edit:
Ops, I see the same post above mine, sorry

See below ;)

Quote:

Originally Posted by just.b.jealous (Post 1907676)
Likewise- I get the "Imageinfo Failed: " error message as soon as I try to upload the rotate.gif (/php'd file)

See below ;)

Quote:

Originally Posted by just.b.jealous (Post 1908414)
Help from anyone would be greatly appreciated by many.

Make sure you have modified your current .htaccess file with this:

Code:

<Files rotate.gif>
                ForceType application/x-httpd-php
</Files>

That has to be done, if your not familiar with .htaccess please post below, IF you have followed all the instructions, dotted all i's and crossed all t's then next thing we need to determine is whether it's something else in your htaccess or perhaps a avatar type of mod you have previously installed.

Mike

PM me if I do not reply promptly and provide a link to this thread - thanks!

kalisekj 12-09-2009 02:34 AM

No Matter what I try I get "Invalid URL" when I try and choose the rotate.gif, if I selectively choose a .gif file in that directory it works. I have tried with editing my .htaccess file on forum root as well as having .htaccess file in the avatar directory. I cannot get this to work any ideas whats causing this issue?

TheLastSuperman 12-09-2009 02:18 PM

Quote:

Originally Posted by kalisekj (Post 1927566)
No Matter what I try I get "Invalid URL" when I try and choose the rotate.gif, if I selectively choose a .gif file in that directory it works. I have tried with editing my .htaccess file on forum root as well as having .htaccess file in the avatar directory. I cannot get this to work any ideas whats causing this issue?

Do you have Dj's AME mod installed? That causes issues with a few mods other then that I would need access to see all this myself so let me know.

Mike


All times are GMT. The time now is 05:46 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.01348 seconds
  • Memory Usage 1,824KB
  • 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
  • (4)bbcode_code_printable
  • (1)bbcode_php_printable
  • (18)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (24)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete