Members: 16,996
Threads: 38,845
Posts: 159,389
Online: 13

Newest Member: Kl_broka@rediffmail.com


Odoo.tv - Outdoor Television


Sedo - Domains kaufen und verkaufen das Projekt mambers.com steht zum Verkauf Besucherstatistiken von mambers.com etrackerŽ Web-Controlling statt Logfile-Analyse
Old 05.08.2005, 16:20   #11 (permalink)
Junior Mamber
 
Join Date: Nov 2004
Posts: 26
jul0577 is on a distinguished road
Default Re: Main Menu Image hack

Hi all,

And anyone have an idea on how to make an image menu with javascript for another image on rollovers and with another image for the "current active menu"?

Cheers.
jul0577 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Old 05.08.2005, 16:29   #12 (permalink)
Junior Mamber
 
Join Date: Nov 2004
Posts: 26
jul0577 is on a distinguished road
Default Re: Main Menu Image hack

Hi,

And anyone have an idea on how to make a menu image with another image for the rollever state (with javascript) and anotherone for the active menu?

Cheers.
jul0577 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11.08.2005, 14:59   #13 (permalink)
chucktrukk
Guest
 
Posts: n/a
Default Re: Main Menu Image hack

On DynamicDrive.com, there is a simple java script for rollovers that uses the command:

Code:
<img src="original-image.jpg" hsrc="rollover-image.jpg" />
With this script, maybe we can upload the rollover image as "image2.jpg" in the same directory as the original image.

Then change this code:

$image = '<img src="'. $mosConfig_live_site .'/images/stories/'. $menu_image .'" border="0" alt="'. $mitem->name .'"/>';


to:


$image = '<img src="'. $mosConfig_live_site .'/images/stories/'. $menu_image .'" hsrc="'. $mosConfig_live_site .'/images/stories/'. $menu_image .'2" border="0" alt="'. $mitem->name .'"/>';


Ill try it out later today on my site and let yall know.

Chuck
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 15.08.2005, 05:18   #14 (permalink)
Mamber
 
Join Date: Apr 2004
Location: Mexico City
Posts: 68
mangoman is on a distinguished road
Send a message via AIM to mangoman Send a message via MSN to mangoman Send a message via Yahoo to mangoman
Default Re: Main Menu Image hack

Ok - please let us know - and look at - your site if this works!!

Thanks.
mangoman is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 15.08.2005, 14:56   #15 (permalink)
chucktrukk
Guest
 
Posts: n/a
Default Re: Main Menu Image hack

Well, I was wrong. That didn't work. But this is how I hacked it. Below the code is how I got it to work.

Lines 83-111:
PHP Code:
            default:    // formerly case 2
            // open in parent window
            
$txt '<a href="'$mitem->link .'" class="'$menuclass .'" '$id .'>';
        }

        if ( 
$params->get'menu_images' ) ) {
            
$menu_params = new stdClass();
            
$menu_params =& new mosParameters$mitem->params );
            
$menu_image $menu_params->def'menu_image', -);
            if ( ( 
$menu_image <> '-1' ) && $menu_image ) {
                
$image '<img src="'$mosConfig_live_site .'/images/stories/'$menu_image .'" border="0" alt="'$mitem->name .'" srcover="'$mosConfig_live_site .'/images/stories/'$mitem->name .'"/>';
                if ( 
$params->get'menu_images_align' ) ) {
                    
$txt $image;
                } else {
                    
//$txt = $image .' '. $txt;
                    
$txt $txt .' '$image;
                }
            }
        }
        
        if (
$level 0)
            
$txt.= $mitem->name;
            
$txt.='</a>';
            return 
$txt;
            break;

First I went to Dynamic Drive DOM Image Rollover and installed their script. Very easy.

The only extra step involved is renaming your menus to the new rollover image, such as home_over.gif. I wanted my submenus to stay as text links, so at the bottom, I added "if level is greater than 0, then show the text".

The website is www.radministries.com/discipleship/index.php. I didn't design the website, another designer did. I am just porting it over to Mambo for them. I am still in the process with it, so if you see anything that could be tweaked on it, please let me know.

Chuck
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 15.08.2005, 15:12   #16 (permalink)
chucktrukk
Guest
 
Posts: n/a
Default Re: Main Menu Image hack

Quote:
Originally Posted by p2020
If you add the following if statement:
PHP Code:
if (!strstr($mitem->name,'blank')) 
before this line
PHP Code:
$txt.= $mitem->name
and include the word "blank" in the menu name, all other menus work.
How could I get this to work with my solution? Is there a way to say:
PHP Code:
if (!strstr($mitem->name,'[b]any name with .gif or .jpg in it[/b]')) 
This is probably an easy answer, but I'm new to this too.


Thanks for any help,
Chuck
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 16.08.2005, 10:41   #17 (permalink)
chucktrukk
Guest
 
Posts: n/a
Default Re: Main Menu Image hack

I am now working on modifying Display Menu - Tigra 2-0-1 from Stingrey.biz. I believe this will not only allow images to be used, but also for a great drop-down menu to be used in conjuction with it.

I will let you know how it goes.
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 24.08.2005, 17:48   #18 (permalink)
Baby Mamber
 
Join Date: Aug 2005
Posts: 1
mage is on a distinguished road
Default Re: Main Menu Image hack

It´s great this thing that you have done!

Well I make some changes. This changes allows you to have a Menu only with Images, a Menu with text and images and a menu only with text; all at the same time.

In mod_mainmenu.php its the same that you already publish with a little change (in red)

PHP Code:
$txt '<a href="'$mitem->link .'" class="'$menuclass .'" '$id .'>';

//-------------------------------------------------------------------------------------
//Main Menu Image Hack by Sajid Saiyed of //http://www.ssdesigninteractive.com/g2
//-------------------------------------------------------------------------------------
            
if ( $params->get'menu_images' ) ) {
            
$menu_params = new stdClass();
            
$menu_params =& new mosParameters$mitem->params );
            
$menu_image $menu_params->def'menu_image', -);
            if ( ( 
$menu_image <> '-1' ) && $menu_image ) {
                
$image '<img src="'$mosConfig_live_site .'/images/stories/'$menu_image .'" border="0" alt="'$mitem->name .'"/>';
                if ( 
$params->get'menu_images_align' ) ) {
                    
$txt.= $image;
                } else {
                    
$txt .= $image .' '$txt;
                }
            }
        }
            
//-------------------------------------------------------------------------------------
//Main Menu Image Hack end
//-------------------------------------------------------------------------------------
    
if ( $params->get'just_images' ) == '0' ) {  /// CHANGE
            
$txt.= $mitem->name;
    }
           
$txt.='</a>';
            break;
        } 
AND you also add at the end, BELOW

$params->def( 'menu_images', 0 );

You put:

$params->def( 'just_images', 0 );


Then in mod_mainmenu.xml

Below

<param name="menu_images" type="radio" default="0" label="Show Menu Icons" description="">
<option value="0">No</option>
<option value="1">Yes</option>
</param>

You ADD

<param name="just_images" type="radio" default="0" label="Show Type Menu Images" description="">
<option value="0">No</option>
<option value="1">Yes</option>
</param>

So... in Modules->Site Modules->mainmenu

You will have an extra option: "Show Type Menu Images"



So when you want a menu only with text, you select NO in option "Show Menu Icons" and "Show Type Menu Images"

When you want a menu with text and an image, you select YES in option "Show Menu Icons" and NO in option "Show Type Menu Images"

And last, when you want a menu only with an image, you select YES in option "Show Menu Icons" and "Show Type Menu Images"

REMEMBER: if you have to select an image for each option in the menu.
mage is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 22.09.2005, 01:18   #19 (permalink)
Baby Mamber
 
Join Date: Sep 2005
Posts: 1
trinimayl is on a distinguished road
Default Re: Main Menu Image hack

This works for me almost. What happens is that I end up with 2 images side by side. One is the plain image and one is the linked image. What have I forgotten or done wrong? Thanks.
trinimayl is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 30.01.2006, 02:22   #20 (permalink)
Baby Mamber
 
Join Date: Jan 2006
Posts: 1
paperoga74 is on a distinguished road
Default Re: Main Menu Image hack

hello to all, I have modified the file of which that spoken here so that the images can be inserted without to show the name of the menu. In same menu yuo can see images and link normal together. I used joomla 1.0.7 and the row when modifies starts is 91.
This is the code in mod_mainmenu.php

$txt = '<a href="'. $mitem->link .'" class="'. $menuclass .'" '. $id .'>'. $mitem->name .'</a>';
break;
}

if ( $params->get( 'menu_images' ) ) {
$menu_params = new stdClass();
$menu_params = new mosParameters( $mitem->params );
$menu_image = $menu_params->def( 'menu_image', -1 );
if ( ( $menu_image != '-1' ) && $menu_image ) {
$image = '<img src="'. $mosConfig_live_site .'/images/stories/'. $menu_image .'" border="0" alt="'. $mitem->name .'"/>';
if ( $params->get( 'menu_images_align' ) ) {
$txt = $txt .' '. $image;
} else {
$txt = $image .' '. $txt;
}
}
}

return $txt;
}



them and these are the modifications:

$txt = '<a href="'. $mitem->link .'" class="'. $menuclass .'" '. $id .'>';
break;
}

$menu_params = new stdClass();
$menu_params = new mosParameters( $mitem->params );
$menu_image = $menu_params->def( 'menu_image', -1 );

if (( $menu_image != '-1') || (!$menu_image)) {
$image = '<img src="'. $mosConfig_live_site .'/images/stories/'. $menu_image .'" border="0" title="'. $mitem->name .'"/>';
if ( $params->get( 'menu_images_align' ) ) {
$txt .= $image;
} else {
$txt .= $image.' '. $txt;
}

}else{
$txt .= $mitem->name;
}

$txt .= '</a>';

return $txt;
}

i try this modifies and result is ok.

i hope that i hepled you.

p.s.
excuseme for my english.

ciao
paperoga74 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

LinkBacks (?)
LinkBack to this Thread: http://www.mambers.com/template-discussions/26417-main-menu-image-hack.html
Posted By For Type Date
Menu con immagini This thread Refback 01.03.2008 14:21
Menu con immagini This thread Refback 01.03.2008 13:46

Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to add new menu item in Main Menu Max Kaar Mambo 4.5 Installation and Upgrades 8 06.09.2006 04:02
Main Menu Hack... Anyone have an idea about this? Thanks! meek Module 'How Do I' Questions 1 27.02.2005 01:41
Interaction between main menu and top menu?? mirrie36 Mambo 4.5.1 'How Do I' Questions 0 22.02.2005 18:54
3 Level deep Main menu thomas9 Mambo 4.5.1 'How Do I' Questions 4 15.12.2004 00:33
linking direct from main menu to main body mikeh1980 Mambo 4.5 'How Do I' Questions 7 17.06.2004 16:52


All times are GMT +2. The time now is 09:47.

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0
A vBSkinworks Design
© Copyright 2004-2008 by Arthur Konze Webdesign.