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

Reply
 
Thread Tools
Random avator for a specific user Details »»
Random avator for a specific user
Version: 1.00, by Thomas Heretic Thomas Heretic is offline
Developer Last Online: Mar 2008 Show Printable Version Email this Page

Version: 3.0.3 Rating:
Released: 07-05-2004 Last Update: Never Installs: 1
Is in Beta Stage  
No support by the author.

I use this for changing a specific user. It goes in functions_showthread.php after line.
Code:
}
			else
			{
				$avatarurl = '';
			}
			
		}
Code:
if ($post['userid']==##) {
			
				header("Expires: " . gmdate("D, d M Y H:i:s",time()) . "GMT");
			 	header("Last-Modified: " . gmdate("D, d M Y H:i:s",time()) . "GMT");
				if ($dir = @opendir('{full directory path}')) {
				$filecount=0;
		        while (($file = readdir($dir)) !== false) {
		            if ($file != ".." && $file != ".") {
		                $filelist[] = $file;
						$filecount++; //Keep track of the total number of files.

		            }
		        }
		            closedir($dir);
			    }
			   mt_srand ((double) microtime() * 1000000);
       
        	$filebreak = rand(1,$filecount);
        	$filecount2=0;

			   
			    while (list ($key, $val) = each ($filelist)) {
			        $val;
					$filecount2++;
					if ($filebreak==$filecount2) {
					    $avatarurl = '{relative path}'.$val;
					}
			    }
			

			   
		}
Does anybody else do something similiar or have a better way to do it?

Show Your Support

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

Comments
  #2  
Old 07-06-2004, 04:46 PM
Gaffer's Avatar
Gaffer Gaffer is offline
 
Join Date: Nov 2001
Location: Australia
Posts: 78
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i can't tell just yet cause i've not installed it (plus i'm tired as) but i made a random avatar for vb2..... i'd have trandscribed it to vb3 but i've been to busy to do it.

so if i can't find the time to convert it i might just use yours.....
Reply With Quote
  #3  
Old 07-06-2004, 06:45 PM
RixiuS RixiuS is offline
 
Join Date: Jul 2003
Posts: 89
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Gaffer
i can't tell just yet cause i've not installed it (plus i'm tired as) but i made a random avatar for vb2..... i'd have trandscribed it to vb3 but i've been to busy to do it.

so if i can't find the time to convert it i might just use yours.....
I used to just do this with template modifications, to give people with no avatar, a random one.
Reply With Quote
  #4  
Old 07-06-2004, 07:08 PM
Thomas Heretic Thomas Heretic is offline
 
Join Date: Sep 2003
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by RixiuS
I used to just do this with template modifications, to give people with no avatar, a random one.
How did you do it with pure template modification?
One of the things I like with this is it reads the file list so it you don't need to change anything to add new files and they don't need to be named anything special. It also is random per post.

To see a specific example go Here* Look at the user Squirrel Nutkin.

*There is swearing in that thread.
Reply With Quote
  #5  
Old 07-07-2004, 03:06 AM
Bad Bunny's Avatar
Bad Bunny Bad Bunny is offline
 
Join Date: Apr 2002
Posts: 555
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Thomas Heretic
How did you do it with pure template modification?
One of the things I like with this is it reads the file list so it you don't need to change anything to add new files and they don't need to be named anything special. It also is random per post.

To see a specific example go Here* Look at the user Squirrel Nutkin.

*There is swearing in that thread.
I gotta say...it didn't seem like all that special at first, but knowing it works for a random pic for each post in the same thread...well, that is cool!
Reply With Quote
  #6  
Old 07-07-2004, 04:56 PM
Gaffer's Avatar
Gaffer Gaffer is offline
 
Join Date: Nov 2001
Location: Australia
Posts: 78
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thought it would be similar to the one i did.... mine was Java script though.....

looks like i don't need to remake it then.... thanks tom.... *wishes weekend would hurry up so it can be installed.*
Reply With Quote
  #7  
Old 07-20-2004, 05:30 PM
rinkrat's Avatar
rinkrat rinkrat is offline
 
Join Date: Jan 2002
Location: Long Beach
Posts: 530
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This would be good for a certain usergroup so I could give it to usenet posts. How can I limit it to one usergroup?
Reply With Quote
  #8  
Old 07-20-2004, 05:50 PM
Thomas Heretic Thomas Heretic is offline
 
Join Date: Sep 2003
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by rinkrat
This would be good for a certain usergroup so I could give it to usenet posts. How can I limit it to one usergroup?
Change ($post['userid']==##) to ($post['displaygroupid'] = ##)

Where ## is the usergroup id that you want to target.
Reply With Quote
  #9  
Old 01-31-2005, 12:19 AM
Berethorn Berethorn is offline
 
Join Date: Jun 2004
Posts: 69
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm.I'm having a problem...in a thread it says:

Quote:
Warning: Variable passed to each() is not an array or object in /home/bere/public_html/forum/includes/functions_showthread.php on line 430
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 06:36 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.07043 seconds
  • Memory Usage 2,278KB
  • Queries Executed 22 (?)
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
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (8)postbit
  • (9)postbit_onlinestatus
  • (9)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete