Homestar Runner Wiki Forum
http://forum.hrwiki.org/

Rotating Sigs and Avatars
http://forum.hrwiki.org/viewtopic.php?f=3&t=10902
Page 3 of 3

Author:  Coleslaw [ Tue Jun 17, 2008 4:06 pm ]
Post subject:  Re: Rotating Sigs and Avatars

It worked, thanks a lot.

Author:  MikeMcG [ Mon Jun 30, 2008 7:56 pm ]
Post subject:  Re: Rotating Sigs and Avatars

I'm going to test out my paired random images.

Image
Image

Author:  Potates [ Mon Jun 30, 2008 8:00 pm ]
Post subject:  Re: Rotating Sigs and Avatars

MikeMcG wrote:
I'm going to test out my paired random images.

Image
Image

Every time I refresh, one or both images are broken.

Author:  MikeMcG [ Mon Jun 30, 2008 8:02 pm ]
Post subject:  Re: Rotating Sigs and Avatars

Yeah, I'm testing them out. I'm using the cookie method and I'm fumbling with cookie domains or scope or whatever.

Edit: So I'm getting predictable results. The next second image will always be what the first current image is. Still not what I want.

Author:  ed 'lim' smilde [ Mon Jun 30, 2008 8:26 pm ]
Post subject:  Re: Rotating Sigs and Avatars

MikeMcG wrote:
Yeah, I'm testing them out. I'm using the cookie method and I'm fumbling with cookie domains or scope or whatever.

Edit: So I'm getting predictable results. The next second image will always be what the first current image is. Still not what I want.

What order does Firefox/whatever browser make those image requests in? If I open the two in separate tabs, refresh the avatar, and then refresh the sig, it works. Maybe Firefox sends the requests for the images in reverse order that they appear on the page.

EDIT: Eh, never mind, I flipped them around in a preview and it did the same thing... Apparently cookies don't actually update for different images until the whole page is done loading. You could try having the second image set the cookies for the next time, and then assume the current images would use the cookies that were set the last time, if that's possible.

Author:  MikeMcG [ Mon Jun 30, 2008 9:07 pm ]
Post subject:  Re: Rotating Sigs and Avatars

I can try that next, but I went for the text file method. She works now.

Directory set up:

Code:
/paired/
   /av.png/
      1.png
      2.jpg
      3.gif
      4.png
   /sig.png/
      /*
      Contents with the same name as the other directory
      */
   dataDump.txt /*This file is only temporary and exists between the first script's
         execution and the second script's execution*/


Code:
<?php

$dataHold = '../pairedData.txt';
$dirHandle = opendir('./');
$dirContents = array();
while($dirItem = readdir($dirHandle)){
   if(is_file($dirItem) && $dirItem != 'index.php') $dirContents[] = $dirItem;
}

if(!file_exists($dataHold)){
   $numberOfItems = sizeof($dirContents) - 1;
   $displayImage = './' . $dirContents[rand(0, $numberOfItems)];

   $mime = getimagesize($displayImage);
   $mime = image_type_to_mime_type($mime[2]);
   
   $dataDump = array('mime' => $mime, 'display' => $displayImage);
   $fh = fopen($dataHold, 'w');
   fwrite($fh, serialize($dataDump));
   fclose($fh);
}else{
   $fh = fopen($dataHold, 'r');
   $dataDump = unserialize(fread($fh, filesize($dataHold)));
   fclose($fh);
   $mime = $dataDump['mime'];
   $displayImage = $dataDump['display'];
   unlink($dataHold);
}

header('Content-type: ' . $mime);
readfile($displayImage);

?>

Author:  OneGyT [ Tue Aug 19, 2008 2:21 am ]
Post subject:  Re: Rotating Sigs and Avatars

I think ripway doesn't allow periods in folder names anymore. :(

Author:  SnakeBoxer202 [ Tue Aug 19, 2008 10:25 pm ]
Post subject:  Re: Rotating Sigs and Avatars

I'm looking for a Municipality icon or something to use as an avator. Can anyone help?

Author:  ed 'lim' smilde [ Wed Aug 20, 2008 4:07 pm ]
Post subject:  Re: Rotating Sigs and Avatars

OneGyT wrote:
I think ripway doesn't allow periods in folder names anymore. :(

You can just add /anything.png to the end of the index.php file instead (unless Ripway uses IIS servers or something), e.g., instead of linking to avatar.png, link to avatar.png/index.php/anything.png. Except the first folder can't be called avatar.png anymore, obviously, but whatever it's called.

Author:  Mr. Daniel Goss [ Fri Mar 20, 2009 11:30 pm ]
Post subject:  Re: Rotating Sigs and Avatars

Why not Freewebs? You can host a photo album there.

Author:  StrotherG123 [ Wed Aug 31, 2011 4:24 am ]
Post subject:  Re: Rotating Sigs and Avatars

Okay this is what I don't understand when it comes to the signatures... I've got a picture saved on my desktop that I created because the image I wanted to use wasn't available anywhere else...

Yeah so anyway I had it hosted by imageshack.com and I'd like it to be bigger than it is but... the forum rules say max 100 pixels right? Or did I read that wrong?
At the same time, I look at other people's signatures and it seems to be much larger... I don't understand...

Anyone know what the deal is?

Author:  StrotherG123 [ Wed Aug 31, 2011 4:34 am ]
Post subject:  Re: Rotating Sigs and Avatars

Oops. Nevermind. I'm dumb :)

Page 3 of 3 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/