I made this hack for more modules, but to make it easier to overview I will start by documenting only the "Topics" and the "Submit_News" modules. (Version 0.723)
I also posted this as "News"
Here
Find a demo here:
LEXeBus.NET
What this hack does is to give you the option of having a imagelogo instead of the modulename as header text "Current active topics", or what ever you changed it to.
When creating this I wanted to have a solution that was Theme-dependant so when ever changing colors in my theme, the logo skould also be different - and as working on this a guy asked me to make it multilingual as well - so I did. I was also using 2 modules that already had a logoimage (Members_List + I-mod Downloads hack) - and I was tired of not having a imagelogo to go with the more and more different themes I created and used.
After implementing the hack:
If you want a logoimage in the header, make a folder called "modlogos" in your themedirectory. Put the gif, jpg og png file in there and call it "modulename.languagecode.filetype".
Example: "Topics-eng.gif" or "Topics-dan.png"
If you have used the hack but you dont want a imagelogo, then dont put an image in there. The original text will then be used instead.
The Hack:
Open the file: "modules/Topics/index.php"
Find and replace this:
echo "<center><font class=\"pn-title\">"._ACTIVETOPICS.
"</font><br>\n" .
"<font class=\"pn-normal\">"._CLICK2LIST.
"</font></center><br>\n" .
"<table border=\"0\" width=\"100%\" align=\"center\" cellpadding=\"2\"><tr>\n";
to this:
$language = pnUserGetLang
();
$modlogo =
"<center><font class=\"pn-title\">"._ACTIVETOPICS.
"</font>";
if (file_exists("themes/$GLOBALS[thename]/modlogos/$ModName-$language.gif")) { $modlogo =
"<center><img src=\"themes/$GLOBALS[thename]/modlogos/$ModName-$language.gif\">";
}elseif (file_exists("themes/$GLOBALS[thename]/modlogos/$ModName-$language.png")) { $modlogo =
"<center><img src=\"themes/$GLOBALS[thename]/modlogos/$ModName-$language.png\">";
}elseif (file_exists("themes/$GLOBALS[thename]/modlogos/$ModName-$language.jpg")) { $modlogo =
"<center><img src=\"themes/$GLOBALS[thename]/modlogos/$ModName-$language.jpg\">";
}echo $modlogo ;
echo "<br>".
"<font class=\"pn-normal\">"._CLICK2LIST.
"</font></center><br>\n" .
"<table border=\"0\" width=\"100%\" align=\"center\" cellpadding=\"2\"><tr>\n";
Open the file: "modules/Submit_News/index.php"
Find and replace this:
echo "<center><font class=\"pn-pagetitle\">"._SUBMITNEWS.
"</font><br><br>";
to this:
$language = pnUserGetLang
();
$modlogo =
"<center><font class=\"pn-pagetitle\">"._SUBMITNEWS.
"</font><br>";
if (file_exists("themes/$GLOBALS[thename]/modlogos/$ModName-$language.gif")) { $modlogo =
"<center><img src=\"themes/$GLOBALS[thename]/modlogos/$ModName-$language.gif\">";
}elseif (file_exists("themes/$GLOBALS[thename]/modlogos/$ModName-$language.png")) { $modlogo =
"<center><img src=\"themes/$GLOBALS[thename]/modlogos/$ModName-$language.png\">";
}elseif (file_exists("themes/$GLOBALS[thename]/modlogos/$ModName-$language.jpg")) { $modlogo =
"<center><img src=\"themes/$GLOBALS[thename]/modlogos/$ModName-$language.jpg\">";
}echo $modlogo ;
echo "<br>";
As you can see the hack does not care what the module or the theme is called, so the same code can be used in almost any module, granting the option of having a theme-color-based image.