This will enable your custom Download and Weblink graphics for your Matching themes to change with the theme selection. If an image for the Downloads or weblinks module is not found in the themes images folder, then those Modules will revert back to their original Images.
You must upload your themes matching web.gif and down-logo.gif to the theme/YourTheme/images folder
Ok If anyone wants to try it..here is the code changes.
For the Downloads module
Open modules/Downloads/index.php
find
Code:
global $prefix, $dbi, $user_adddownload, $module_name;
change it to
Code:
global $prefix, $dbi, $user_adddownload, $module_name, $ThemeSel;
then change this
Code:
echo "
<center><a href=\"modules.php?name=$module_name\"><img src=\"modules/$module_name/images/down-logo.gif\" border=\"0\" alt=\"\"></a>
";
to this
Code:
if (file_exists("themes/$ThemeSel/images/down-logo.gif")) {
echo "
<center><a href=\"modules.php?name=$module_name\"><img src=\"themes/$ThemeSel/images/down-logo.gif\" border=\"0\" alt=\"Downloads\"></a>
";
} else {
echo "
<center><a href=\"modules.php?name=$module_name\"><img src=\"modules/$module_name/images/down-logo.gif\" border=\"0\" alt=\"Downloads\"></a>
";
}
For the Weblinks Module
open modules/WebLinks/index.php
find and change this
Code:
global $module_name;
to this
Code:
global $module_name, $ThemeSel;
and then change this
Code:
echo "
<center><a href=\"modules.php?name=Web_Links\"><img src=\"modules/$module_name/images/web.gif\" border=\"0\" alt=\"\"></a>
";
to this
Code:
if (file_exists("themes/$ThemeSel/images/web.gif")) {
echo "
<center><a href=\"modules.php?name=$module_name\"><img src=\"themes/$ThemeSel/images/web.gif\" border=\"0\" alt=\"Weblinks\"></a>
";
} else {
echo "
<center><a href=\"modules.php?name=$module_name\"><img src=\"modules/$module_name/images/web.gif\" border=\"0\" alt=\"Weblinks\"></a>
";
}
mikem