Web Hosting Forum | Lunarpages

Author Topic: How to have a random avatar in Lunarforums  (Read 39785 times)

Offline mark363

  • Über Jedi
  • *****
  • Posts: 2611
How to have a random avatar in Lunarforums
« Reply #15 on: November 27, 2003, 03:28:33 PM »
I know how it works... and I'm willing to go as low as $2.50!! Going once...going twice...   :lol:

Danielle

  • Guest
How to have a random avatar in Lunarforums
« Reply #16 on: November 27, 2003, 04:09:17 PM »
Shh, mussavcom, you don't want Kata to come after you like he did us for telling people ;)  Why do you think I became a site admin, it was b/c they "assimilated" me into the fold of people who know how this works.  Next, they will come after you   :D


Offline mark363

  • Über Jedi
  • *****
  • Posts: 2611
How to have a random avatar in Lunarforums
« Reply #18 on: November 28, 2003, 02:58:22 PM »
Nooooooooooo!!!  :twisted:

Offline mark363

  • Über Jedi
  • *****
  • Posts: 2611
How to have a random avatar in Lunarforums
« Reply #19 on: November 28, 2003, 08:50:54 PM »
I did it!  :yey:

Danielle

  • Guest
How to have a random avatar in Lunarforums
« Reply #20 on: November 28, 2003, 09:03:39 PM »
Hi mussavcom,

Glad you like the script.  You will make taglio thrilled, he kept asking me for more cats, and you have cats aplenty ;)  Well, I might add some more cats to mine someday, but I don't like to be whipped about it lol  :whip:

Offline Coon

  • Adi
  • Über Jedi
  • *****
  • Posts: 2359
    • Freestyle Football
How to have a random avatar in Lunarforums
« Reply #21 on: November 28, 2003, 09:39:01 PM »
Cool stuff mussavcome. I really like those cats, hehe. :P
Soccer Forum - Established freestyle soccer forum!
Freestyle Football - Cool soccer freestyle videos! Must SEE!
Frisco Painting - Faux painting for Dallas, TX area.


Offline Jwink3101

  • Über Jedi
  • *****
  • Posts: 1831
  • The one and only.
How to have a random avatar in Lunarforums
« Reply #23 on: November 29, 2003, 08:14:37 PM »
I know it but i will not tell for my life, unless you say, "please with a cherry on top"

Then...maybe. I will hint, dfad pide aif drear

What is that, that is my encrypted hint.

Offline Jwink3101

  • Über Jedi
  • *****
  • Posts: 1831
  • The one and only.
How to have a random avatar in Lunarforums
« Reply #24 on: November 29, 2003, 08:17:32 PM »
This should be moved to the how-to section for both the original post and the magic trick.


Offline Trey

  • Jedi
  • *****
  • Posts: 933
    • http://www.singfreemusic.com
How to have a random avatar in Lunarforums
« Reply #26 on: November 30, 2003, 10:29:19 AM »
Quote from: Kata
HeHe :-)

I am Kata.. I will assimilate you..


ah, you'll only do that cuz i assimilated you...

<----good at selling and global domination
This space for rent.  Reasonable rates!

Offline Ripta

  • Master Jedi
  • *****
  • Posts: 1271
How to have a random avatar in Lunarforums
« Reply #27 on: March 09, 2004, 12:38:21 PM »
Back to the topic of this thread, I'm using a PHP script I wrote myself. This is the source code:

Code: [Select]

<?

/**
* Change the following array to an array of extensions:
* For example, if your images have the extension gif, use:
*   $extensions = array('gif');
* If the extensions are gif and jpg, use:
*   $extensions = array('gif', 'jpg');
* And so on. Don't forget the ; in the end of the line!
**/

$extensions = array('gif', 'jpg', 'jpeg');



/**
* This script should function properly without any changes below.
**/

$avatars = array();
$dh = opendir('.');
$regex = '\.(' . implode('|', $extensions) . ')$';
while(($filename = readdir($dh)) !== false) {
        if (!eregi($regex, $filename)) continue;
        array_push($avatars, $filename);
}
$file = rand(0, count($avatars) - 1);

$handle = fopen($avatars[$file], "r");
$content = "";
while(!feof($handle)) $content .= fgets($handle);
fclose($handle);

echo $content;
?>


Just copy the above to a text editor (such as notepad on Windows) and save as index.php. Now open FTP, create a new directory to put this file on your server so that you can access it through the web. Change directory, and upload the index.php you just saved, along with a bunch of gif and/or jpeg images. This script will take all gif/jpeg images in that directory and choose one randomly. It also works with hotlinking on and you don't need to add http://www.lunarforums.com/ to the hotlinking list.

This script's just for fun :D. Once I get the chance, I might do a script that'll resize stuff. Enjoy! :thumb:
GetAFreelancer! (This service is not affiliated with Lunarpages)

Offline Ripta

  • Master Jedi
  • *****
  • Posts: 1271
How to have a random avatar in Lunarforums
« Reply #28 on: March 09, 2004, 12:39:31 PM »
While I'm on this thread, Trey, how's the global domination going? :D
GetAFreelancer! (This service is not affiliated with Lunarpages)

Offline martinez

  • Trekkie
  • **
  • Posts: 17
hehehehe
« Reply #29 on: March 12, 2004, 06:04:02 PM »
Does anyone not know how it works yet? cuz, I know too... A little secret you can play on people at casino's around three a.m. you don't need a computer, a just quick hand and devilish mind will do the trick. but I won't spoil the fun for everyone...

PM if you'd like to know
Where are you from?

 

Share |