ok i have the advanced downloads block.. v2 i think w/ the featured download listed also
well i want the featured/newest/popular images to show up dif colors for dif themes.
i got it to work. for changing themes. the image changes but thats if they upload featured1/newest1/popular1 to there themes/$themesel/images folder.
now if they don't upload those images to there images folder, i want it to change back to the way it was by using $image_color = "blue/black/or grey";
how would this work?
so far i have this but it dosen't work. any help is appreciated.
(so far i have added this part (below the imagecolor line))
|
Code:
|
$image_color = "black"; // Options include grey, black, blue
$default_featured = "images/$image_color/featured1.gif";
$default_newest = "images/$image_color/newest1.gif";
$default_popular = "images/$image_color/popular1.gif"; |
(function to get the image from the themes folder if exists)
|
Code:
|
function featuredimg($gfile) {
$ThemeSel = get_theme();
if (file_exists("themes/$ThemeSel/images/$gfile")) {
$featuredimg = "themes/$ThemeSel/images/$gfile";
} else {
$featuredimg = $default_featured;
}
return($featuredimg);
} |
(code to display the image)
|
Code:
|
$featuredimg = featuredimg("featured1.gif");
$content .= "<center>
<img src=\"featuredimg\" align=\"center\" border=\"0\">
</center>
"; |
again it works. if i have the images uploaded to the themes/images folder but not if they don't exist.
any help is appreciated thnx.
EDIT.. That is only code for the featured image. also there for newest/popular just did not show it