MyBB Community Forums

Full Version: Random avatar PHP script: Need help!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
Hey, so I am trying to get the php script that MattRogowski posted in another thread, and I am running into some issues.

I have tryed alot of diffrent paths for
$folder = '';
But I don't think this is the problem. When I have any path set (correctly mind you) and I right click on the broken image that appears, I get a link to the php file. I think this is what is wrong (obviously) and I don't know how to fix it. Thanks, Tierney
Forgot to reply to your PM, if you can send me your FTP details I'll try and see what might be breaking.
(2010-01-07, 09:09 PM)Tierney Wrote: [ -> ]Hey, so I am trying to get the php script that MattRogowski posted in another thread, and I am running into some issues.

I have tryed alot of diffrent paths for
$folder = '';
But I don't think this is the problem. When I have any path set (correctly mind you) and I right click on the broken image that appears, I get a link to the php file. I think this is what is wrong (obviously) and I don't know how to fix it. Thanks, Tierney

No, linking to the php file is correct. If you go to your php file in your browser it should show you a random image every time. So this is either a permissions issue with your files, OR the permissions issue described in the file's leading comments where some systems break this script if there is a higher folder with bad permissions.
Auctualy, I just kinda did it myself. Very, very easily. I just searched "PHP random image script" on google, and found this one. I just uploaded it to my file with a . as the file path and presto, it works!

When I try linking my php script to my Avatar, I get the folowing message:

Please correct the following errors before continuing:
The URL you entered for your avatar does not appear to be valid. Please ensure you enter a valid URL.

Shouldn't it accpct the PHP file?
(2010-01-07, 09:23 PM)Tierney Wrote: [ -> ]Auctualy, I just kinda did it myself. Very, very easily. I just searched "PHP random image script" on google, and found this one. I just uploaded it to my file with a . as the file path and presto, it works!

If you want to use relative paths with this script (the one Matt uploaded) you need to add the trailing slash is all.
$folder = './';
Works just fine for me, and I renamed it to index.php so no one can actually get the directory listing (and I don't have to .htaccess to stop it)

Quote:When I try linking my php script to my Avatar, I get the folowing message:

Please correct the following errors before continuing:
The URL you entered for your avatar does not appear to be valid. Please ensure you enter a valid URL.

Shouldn't it accpct the PHP file?

Some forum softwares wont, but MyBB does...
http://yoururl.com/avatars/index.php
If you named it index.php of course
So how does matt post it with his script?
(2010-01-07, 09:36 PM)Tierney Wrote: [ -> ]So how does matt post it with his script?

???
Exactly like I said in the last part of my previous post...



And out of curiosity how many avatars do you guys have? I'm currently at 45 for my random avatar script
I have like 8, but I don't understand. I put

http://ohsf.comze.com/images/TierneyRandom/Randomimage.php
and it doesn't work?
It works

Testing it with img tags
[Image: Randomimage.php]

However, the one Matt uploaded is a much better script. Try putting the attached file into your folder.

That will make the img link below work

[Image: TierneyRandom]
Yay! it worked! Thanks so much!
Pages: 1 2 3 4