Hi, I am not a programmer and this is my first post.
I run a illustration community website here:
http://www.amateurillustrator.com/I need to run a check for jpg, gif or png files...but in a slightly unusualy way.
here is the code i need to add the check to:
CODE
if($cpg_udb->can_join()){
if ($CONFIG['enable_avatar']){
($row['avatar_url'] != "") ? $avatar_url= "<img src='".AVATAR_PATH.$row["avatar_url"].".gif' class='image' style='float: left; margin-right: 5px;' alt='' />" : $avatar_url = '';
}
if you look right now it says .gif in there...so what is happening is that it is only find files that are gif's, and I want it to be able to check weather is has found a gif and if it hasn't then it looks for a jpg and then a png.
I tried this:
CODE
if($cpg_udb->can_join()){
if ($CONFIG['enable_avatar']){
($row['avatar_url'] != "") ? $avatar_url= "<img src='".AVATAR_PATH.$row["avatar_url"].".gif' class='image' style='float: left; margin-right: 5px;' alt='' />" : $avatar_url = '';
($row['avatar_url'] != "") ? $avatar_url= "<img src='".AVATAR_PATH.$row["avatar_url"].".png' class='image' style='float: left; margin-right: 5px;' alt='' />" : $avatar_url = '';
($row['avatar_url'] != "") ? $avatar_url= "<img src='".AVATAR_PATH.$row["avatar_url"].".jpg' class='image' style='float: left; margin-right: 5px;' alt='' />" : $avatar_url = '';
}
but that just uses the last repetition and returns only jpg images.
How could I set this up.
If you are interested I am wanting to retrieve avatars from a folder...I have a few users and they have been uploading avatars in these 3 formats.
Help on this would be much appreciated.
All the best
Nick
This post has been edited by nickfzx: 14 Nov, 2006 - 01:10 PM