Members: 16,996
Threads: 38,846
Posts: 159,391
Online: 23

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

Go Back   Mambers.com > Archive > Mambo 4.5 > Mambo 4.5 'How Do I' Questions

 
 
LinkBack Thread Tools Display Modes
Old 26.08.2004, 01:29   #1 (permalink)
Baby Mamber
 
Join Date: Aug 2004
Posts: 3
mattymattmatt is on a distinguished road
Default php code to tell me what main menu i am in??

hey guys, i am a perl coder, and i have just installed mambo, and i don't really have a clue how to code php. can you send me a snippit of code that will tell me which main menu level i am in.

i'm trying to have a different header image for each section of the site. i tried to create a module to do it, but that didn't work. now, i'm just planning to hardcode the template, but i have to be able to know which section i am in.

if you have the code or a better way to do it, i'd be much obliged!

thanks!
mattymattmatt is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Sponsored Links
Old 26.08.2004, 02:02   #2 (permalink)
Professional Mamber
 
crash777's Avatar
 
Join Date: Apr 2004
Location: North East USA
Posts: 931
crash777 will become famous soon enough
Talking Re: php code to tell me what main menu i am in??

Quote:
Originally Posted by mattymattmatt
hey guys, i am a perl coder, and i have just installed mambo, and i don't really have a clue how to code php. can you send me a snippit of code that will tell me which main menu level i am in.

i'm trying to have a different header image for each section of the site. i tried to create a module to do it, but that didn't work. now, i'm just planning to hardcode the template, but i have to be able to know which section i am in.

if you have the code or a better way to do it, i'd be much obliged!

thanks!
I am pretty sure what you are looking to do is built into 4.6! Not sure exactly when it is coming out though!
Aaron
crash777 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 26.08.2004, 02:23   #3 (permalink)
Professional Mamber
 
zorkhh's Avatar
 
Join Date: Apr 2004
Location: Northern Germany
Posts: 713
zorkhh is on a distinguished road
Default Re: php code to tell me what main menu i am in??

Hi,

there is a little script called "titledata", used to add the menutitle to the titlebar of the Browser.

PHP Code:
<?php
// titledata.php
/**
// Based on metadata.php
* @package Mambo Open Source
* @Copyright (C) 2000 - 2003 Miro International Pty Ltd
* @ All rights reserved
* @ Mambo Open Source is Free Software
* @ Released under GNU/GPL License : http://www.gnu.org/copyleft/gpl.html
**/

defined'_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

function 
showTitle( &$database$option) {

  
$task mosGetParam$_REQUEST'task'0);
  
$pageTitle '';

  if (
$option == 'content') {
    
$id mosGetParam$_REQUEST'id');
    if (
$id) {
      switch (
$task) {
        case 
"view":
          
$row = new mosContent$database );
          
$row->load$id );
          
$pageTitle $row->title_alias;
          if(
$pageTitle == '') {
            
$pageTitle $row->title;
          }
          break;
        case 
"category":
        case 
"blogcategory":
        case 
"archivecategory":
          
$row = new mosCategory$database );
          
$row->load$id );
          
$pageTitle $row->title;
          break;
        case 
"section":
        case 
"blogsection":
        case 
"archivesection":
          
$row = new mosSection$database );
          
$row->load$id );
          
$pageTitle $row->title;
          break;
        default:
          break;
      }
    }
  }else {
    
$id mosGetParam$_REQUEST'Itemid');
    if (
$id) {
         
$row = new mosMenu$database );
         
$row->load$id );
         
$pageTitle $row->name;
      }
   }
  echo 
$pageTitle;
}
showTitle$database$option );
?>
Maybe yiu can use it or it shows you the way to code it on your own.

hth

ZorkHH

BTW: the usage for the title tag is like this:
PHP Code:
<TITLE><?php echo $mosConfig_sitename?>-<?php include ("includes/titledata.php"); ?></TITLE>
__________________
News and stories around Joomla! PlanetJoomla.com
For individual Joomla-AddOns visit Joomlaexpert.com
zorkhh is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 22.09.2004, 14:26   #4 (permalink)
Baby Mamber
 
Join Date: Jun 2004
Posts: 4
terry73 is on a distinguished road
Default Re: php code to tell me what main menu i am in??

I think I have what you are doing, using peekfresh as my template.

In their case, a config file associated with the template controls the header image. Code snippet below:
// ***Header Images Configuration*** IMAGES MUST HAVE THIS SIZE: 464x84
// don't screw this up if you don't know what you're doing!!
// All header images must be placed on templates/peekfresh/images/ directory, use your ftp client to upload your custom pictures.

$headerimage = "header_picture.jpg"; // your default image




switch ($Itemid) {

case 1:
$headerimage = "header_picture.jpg";
break;

case 2:
$headerimage = "header_picture_news.gif";
break;


case 25:
$headerimage = "header_picture_faq.gif";
break;

case 3:
$headerimage = "header_picture_contact.gif";
break;


case 4:
$headerimage = "header_picture_links.gif";
break;


case 53:
$headerimage = "calendar_picture.jpg";
break;

Hope this helps, my website in development is below which illustrates.


http://www.newhopefellowship.org/mam...tpage&Itemid=1
terry73 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 

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


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
How do I use Main Menu to display only sub areas? chambers777 Mambo 4.5 'How Do I' Questions 7 21.02.2005 17:48
linking direct from main menu to main body mikeh1980 Mambo 4.5 'How Do I' Questions 7 17.06.2004 16:52
PHP Code to catch SubMenus only in Template Gunnar Template Discussions 3 10.06.2004 13:30
How to link content items to main menu afru Mambo 4.5 'How Do I' Questions 3 11.04.2004 16:16


All times are GMT +2. The time now is 06:10.

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.