View previous topic :: View next topic |
Author |
Message |
Elmdor -
Joined: 26 Jan 2007 Posts: 2
|
Posted: Fri Jan 26, 2007 12:00 pm Post subject: .htaccess / Random Avatar PhP Script question |
|
|
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 |
|
 |
cmxflash -
Joined: 11 Dec 2004 Posts: 872
|
Posted: Fri Jan 26, 2007 12:30 pm Post subject: |
|
|
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 |
|
 |
Elmdor -
Joined: 26 Jan 2007 Posts: 2
|
Posted: Fri Jan 26, 2007 12:47 pm Post subject: |
|
|
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 |
|
 |
pkSML -
Joined: 29 May 2006 Posts: 955 Location: Michigan, USA
|
Posted: Fri Jan 26, 2007 10:56 pm Post subject: |
|
|
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 |
|
 |
cmxflash -
Joined: 11 Dec 2004 Posts: 872
|
Posted: Fri Jan 26, 2007 11:10 pm Post subject: |
|
|
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 |
|
 |
|