The Geek Forum

  • May 11, 2024, 03:34:17 PM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

Due to the prolific nature of these forums, poster aggression is advised.

*

Recent Forum Posts

Shout Box

Members
Stats
  • Total Posts: 129628
  • Total Topics: 7187
  • Online Today: 158
  • Online Ever: 1013
  • (January 12, 2023, 01:18:11 AM)

Author Topic: Random Avatar!  (Read 3792 times)

hob goblin

  • Professional Blogger
  • ***
  • Coolio Points: +2/-2
  • Offline Offline
  • Posts: 651
    • View Profile
    • http://www.ice-on-fire.net
Random Avatar!
« on: July 26, 2002, 12:25:21 AM »

As some of may have not noticed, I have a random avatar! If you don't believe me, refresh the page a couple times..

anyways, heres what you need:

1) Common Sense
2) A website with PHP support

and heres what you do...

1) Make a new directory called like "avatar"
2) In it, upload a file named "image.php" containing the following code:

Code: [Select]

<?php 
Header
&#40;"Cache-Control&#58; no-store, no-cache, must-revalidate, post-check=0, pre-check=0"&#41;; 
Header&#40;"Expires&#58; Thu, 19 Nov 1981 08&#58;52&#58;00 GMT"&#41;; 
Header&#40;"Pragma&#58; no-cache"&#41;; 
Header&#40;"Content-Type&#58; image/gif"&#41;; 
srand&#40;&#40;double&#41;microtime&#40;&#41;*1000000&#41;; 

$i 0
$dir opendir&#40;"./"&#41;; 
while&#40;&#40;$im = readdir&#40;$dir&#41;&#41;&#41; &#123; 
    
if&#40;$im != ".." && $im != "." && $im != "image.php"&#41;&#123; 
       
$image[$i&#93; = $im; 
       
$i++; 
    &
#125; 
&#125;  
closedir&#40;$dir&#41;; 

$len count&#40;$image&#41;-1; 
$n rand&#40;0,$len&#41;; 

if&#40;!readfile&#40;"./".$image[$n&#93;&#41;&#41;&#123; 
   
readfile&#40;"./error.gif"&#41;; 
&#125; 

?>


3) Upload your images, make sure they are named in the sence like, 1.gif, 2.gif, 3.gif, 4.gif, etc... (the script will pick up how many images there are)

4) Since phpbb will check the file extension link to your avatar as such:
 http://www.yoursite.com/avatar/image.php/sig.gif

  *** If you want to use jpegs, change "Header("Content-Type: image/gif"); " to "Header("Content-Type: image/jpeg"); " and that should do the trick..
Logged

Roshin

  • Annoying Newbie
  • *
  • Coolio Points: +0/-0
  • Offline Offline
  • Posts: 1
    • View Profile
Random Avatar!
« Reply #1 on: July 26, 2002, 05:41:07 AM »

pssh fancy
Logged

hob goblin

  • Professional Blogger
  • ***
  • Coolio Points: +2/-2
  • Offline Offline
  • Posts: 651
    • View Profile
    • http://www.ice-on-fire.net
Random Avatar!
« Reply #2 on: July 26, 2002, 06:54:50 AM »

fancy? hmm... just nifty how you can trick file extensions and encode images
Logged

hob goblin

  • Professional Blogger
  • ***
  • Coolio Points: +2/-2
  • Offline Offline
  • Posts: 651
    • View Profile
    • http://www.ice-on-fire.net
Random Avatar!
« Reply #3 on: August 01, 2002, 06:59:04 AM »

DID ANYONE FUCKING CARE? GOD! You guys are making me feel insignificant.

*runs off and pouts*






...
Logged

Jon

  • Computer Whore
  • **
  • Coolio Points: +0/-1
  • Offline Offline
  • Posts: 381
    • View Profile
    • http://www.gotthegeek.com
Random Avatar!
« Reply #4 on: August 01, 2002, 07:24:23 AM »

lol, i just woke up. Thats pretty cool Hobby. I can call you hobby right?
Logged

Demosthenes

  • Evil Ex-HN Moderator
  • Administrator
  • Hacker
  • *
  • Coolio Points: +567/-72
  • Offline Offline
  • Gender: Male
  • Posts: 9904
  • Just try me. See what happens.
    • View Profile
    • Zombo
Random Avatar!
« Reply #5 on: August 01, 2002, 11:21:25 AM »

LOL!  "hobby"...  :P
Logged

Coolio Points: 89,000,998,776,554,211,222
Detta Puzzle Points: 45

Banning forum idiots since 2001

Anonymous

  • Guest
Random Avatar!
« Reply #6 on: August 01, 2002, 12:15:21 PM »

That "making me feel insignificant" comment reminds me of a certain someone from Hacker Network
Logged

Demosthenes

  • Evil Ex-HN Moderator
  • Administrator
  • Hacker
  • *
  • Coolio Points: +567/-72
  • Offline Offline
  • Gender: Male
  • Posts: 9904
  • Just try me. See what happens.
    • View Profile
    • Zombo
Random Avatar!
« Reply #7 on: August 01, 2002, 12:30:15 PM »

Shhhhhh.... he's gone now, Neb.  It's okay.   :cry:
Logged

Coolio Points: 89,000,998,776,554,211,222
Detta Puzzle Points: 45

Banning forum idiots since 2001

hob goblin

  • Professional Blogger
  • ***
  • Coolio Points: +2/-2
  • Offline Offline
  • Posts: 651
    • View Profile
    • http://www.ice-on-fire.net
Random Avatar!
« Reply #8 on: August 01, 2002, 02:28:18 PM »

call me whatever.. i don't care
Logged

Jon

  • Computer Whore
  • **
  • Coolio Points: +0/-1
  • Offline Offline
  • Posts: 381
    • View Profile
    • http://www.gotthegeek.com
Random Avatar!
« Reply #9 on: August 01, 2002, 04:48:20 PM »

Ok...Hobby.
Logged