Conditional
Get creative. How about a conditional to make the active module graphic brighter?
Put $name in global then do something like:
if ($name==$m_title) {
/* make img src a brighter gif
} else {
/* make img src a darker gif
}
|
On-The-Fly
We could generate images on the fly, like the login security check does.
The code would look something like this and would be put in either block-Modules.php -or- mainfile.php:
(I'm not sure which)
function makeimage($img_title) {
$image = ImageCreateFromJPEG("themes/yourtheme/image_bg.jpg");
$text_color = ImageColorAllocate($image, 80, 80, 80);
Header("Content-type: image/jpeg");
ImageString ($image, 5, 12, 2, $img_title, $text_color);
ImageJPEG($image, '', 75);
ImageDestroy($image);
die();
}
|
and this code goes in our conditional section of block-Modules.php:
$content .= "<a href="modules.php?name=$m_title">"; $content .= "<img src="?makeimage=makeimage&img_title=$m_title2" border="0" alt="Downloads"></a><br>n"; |
but I haven't tested it because I think it will cause too much delay loading images on every page refresh.
JavaScript
With javascript you could use onrollover and onrollout to
change the button graphic. There are many examples on the web.
Flash
Another alternative is flash.
With flash we can generate a single button graphic,
then have the html control it. Like this:
<object id="button.swf"> <embed src="modules/PHP-Nuke_HOWTO/images/button.swf?module=AnOldMan&mod_url=http://www.anoldman.com" height="26"> </object> |
(notice that special characters are escaped)
That html code is what produces the title -and- the link for this button:
so ONE button object can be MANY links.
(it took me two nights of web searches to figure out how to do that, so give me some credit if you "borrow" it, ok?)
I use a combination of both flash and javascript.
If you visit my site, and don't have flash or javascript enabled, the menu is still there as imagelinks.
With flash, the imagelinks are replaced with a flash navbar by a javascript function.
View source on my site to see how it's done. www.anoldman.com
|
PHP-Nuke Docs modulemade by Chris Karakas pages added by AnOldMan |








