vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Rotate Avatars Hack (https://vborg.vbsupport.ru/showthread.php?t=47931)

nulltone 01-20-2003 05:33 PM

Rotate Avatars Hack
 
I have searched on this forum multiple times for some type of modification which will enable me to use multiple avatars.
I am the admin of my forum. I don't really care if other people have this feature, infact, it would be best if they do not. I have about 30 avatars which I really like, all somewhat similar. Is there any way for me to place these all in a folder on my server, and have vBulletin randomize upon loading the page?
If that can't happen, the next best thing would be to have vBulletin change the avatar (in a sequence, from 1.jpg, 2.jpg...30.jpg) on my account every few minutes?
If there is already a mod like this, please point me in the right direction. I have spent at least an hour searching here, the vbulletin.com, and google.

Neo 01-20-2003 06:00 PM

In admin/functions.php find

PHP Code:

        if ($post[avatarid]!=0) {
            
$avatarurl=$post[avatarpath];
        } else {
            if (
$post[hascustomavatar] and $avatarenabled) {
                
$avatarurl="avatar.php?userid=$post[userid]&dateline=$post[avatardateline]";
            } else {
                
$avatarurl="";
            }
        } 

and place this under it

PHP Code:

        if ($bbuserinfo[userid]==1) {
            
srand(time());
            
$rand rand(1,30);
            
$avatarurl="http://www.yourdomain.com/forum/images/avatars/ava[$rand].gif"// edit this to your own settings
        


as you can see this is manually done but its fast and it should work.

nulltone 01-20-2003 06:04 PM

I LOVE You.
Seriously, you are great. Thank you so much.
If you ever need anything, just let me know via email or PM.

nulltone 01-20-2003 06:20 PM

Ok, it isn't really working.
The problem somehow lies in

if ($bbuserinfo[userid]="1") {

For some reason it isn't being limited to just user # 1
all users have my avatars now

Neo 01-20-2003 08:54 PM

Just responded to your PM.

Neo 01-20-2003 08:55 PM

and make sure thay when you have your images.. have the files names like

ava[1].gif
ava[2].gif


All times are GMT. The time now is 12:34 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.01075 seconds
  • Memory Usage 1,725KB
  • 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
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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