PDA

View Full Version : Avatar URL doesn't seem to be working...



Andrew
September 4th, 2004, 11:01
Not a biggie, but I can't post URL's in the avatar URL field.

I wanted to try a random avatar script but it won't let me do that or even link to a simple image.

Easily fixed?

ProfClayton
September 4th, 2004, 15:47
If you have an avatar on your our server, you can just link to it via the 'Avatar URL' field. By clicking on the avatar you'll see that it just goes to your member profile.

But I think you already know that.

Andrew
September 4th, 2004, 16:04
Yeah, that's what I was trying to do. It keeps on giving me this error:
Error - cannot find an image at the specified URL. Please make sure that you have entered a valid URL.

I tested it on a remote server using the same image I'm using now, so it's not the image ;)

Here's the url... http://www.host000.com/cid/images/hellboy501.gif

ProfClayton
September 4th, 2004, 16:11
Hmmm... I can't even change it from the Admin Control Panel.

It's probably a bug in this new version. I'll look into it.

Andrew
September 4th, 2004, 16:17
I found a thread here at vBulletin: http://www.vbulletin.com/forum/showthread.php?t=98056&highlight=error+avatar+url
(there are actually a lot, but this is the only one I found with an answer)

It's no biggie though, so if it takes too long don't worry about it ;)

Thanks!

ProfClayton
September 4th, 2004, 19:23
Thanks for the link.

Hey, could you post the 'random image' php file that you are using in your sig:

http://www.host000.com/cid/images/blazeq/rand.php

I'd like to see how you did it (or tell me where you got it from).

Thanks.

Andrew
September 5th, 2004, 06:35
After looking at a couple scripts and combining several, I ended up with this:


<?php
Header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
Header("Expires: Thu, 19 Nov 1981 08:52:00 GMT");
Header("Pragma: no-cache");

srand((double)microtime()*1000000);

$images = array();
$name = '';
$fh = 0;
$nr = 0;

$fh = opendir('.');
while ( $name = readdir($fh) )
{
if ( eregi("(gif|jpg|png|jpeg)$", $name) && $name != "avatar.jpg" )
{
$images[] = $name;
}
}

$nr=rand(0,count($images)-1);

if ( eregi("(jpg|jpeg)$", $images[$nr]) )
{
Header("Content-Type: image/jpeg");
}
else if ( eregi("(gif)$", $images[$nr]) )
{
Header("Content-Type: image/gif");
}
else if ( eregi("(png)$", $images[$nr]) )
{
Header("Content-Type: image/png");
}

readfile($images[$nr]);
?>

Just put it in a php file in a dir with images and it will randomly call one when you exec the file.

'twould be cool if we could use it as an avatar, but in the sig is fine :D