.htaccess / Random Avatar PhP Script question

 
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions
View previous topic :: View next topic  
Author Message
Elmdor
-


Joined: 26 Jan 2007
Posts: 2

PostPosted: Fri Jan 26, 2007 12:00 pm    Post subject: .htaccess / Random Avatar PhP Script question Reply with quote

Hello, I've found Abyss to be extremely n00b friendly (IE - me) and I couldn't be happier with it. Thanks for such a great program.

Recently I tried to use a random image php script I found, but it required .htaccess file rewriting. I found a few topics discussing that here, and I upgraded to 2.4, but I didn't understand what I needed to do to make my script work. The script is very small, here's a link to a .txt version of it:

http://www.neverletitgo.org/avatar/avatar.txt

And the htaccess file:

http://www.neverletitgo.org/avatar/av.txt

If you could help me get this working, I'd appreciate it a lot! Thank you in advance.
Back to top View user's profile Send private message
cmxflash
-


Joined: 11 Dec 2004
Posts: 872

PostPosted: Fri Jan 26, 2007 12:30 pm    Post subject: Reply with quote

Here's an easier way to have a random avatar without htaccess.

Code:
<?php
header("Content-type: image/png");

$display = rand(1, 3);

if ($display == 1) { readfile("avatar1.png"); }
if ($display == 2) { readfile("anotheravatar.png"); }
if ($display == 3) { readfile("avatar2.png"); }

?>


Just put the images in the same folder as the PHP-script and you should be fine.
Back to top View user's profile Send private message
Elmdor
-


Joined: 26 Jan 2007
Posts: 2

PostPosted: Fri Jan 26, 2007 12:47 pm    Post subject: Reply with quote

Will this work on message boards? That was my original problem, I could only use image filename extensions. I'm sorry if this is an obvious question, I don't know anything about php.
Back to top View user's profile Send private message
pkSML
-


Joined: 29 May 2006
Posts: 955
Location: Michigan, USA

PostPosted: Fri Jan 26, 2007 10:56 pm    Post subject: Reply with quote

Elmdor wrote:
Will this work on message boards? That was my original problem, I could only use image filename extensions. I'm sorry if this is an obvious question, I don't know anything about php.


It depends on the message board. If they allow you to have an avatar hosted from your server, then yes. Just use yoursite.com/avatar.php/avatar.png.
The bold portion makes the message board think it's just an image, though it's really a php script generating the image.

See my sig below? The URL is http://stephen.calvarybucyrus.org/aprelium/info.php/info.gif and it works just fine.
_________________
Stephen
Need a LitlURL?


http://CodeBin.yi.org
Back to top View user's profile Send private message Visit poster's website
cmxflash
-


Joined: 11 Dec 2004
Posts: 872

PostPosted: Fri Jan 26, 2007 11:10 pm    Post subject: Reply with quote

Create a folder named image.png and put the PHP-file in it as index.php. This will trick the forums into thinking it is an image.

Then use http://server/image.png as your avatar.
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group