Nukemods Forum  
» Log in
User Name:

Password:

Not a member yet?
Register Now!
» Online Users: 82
5 members and 77 guests
huelva9, mak9sefastmqwa3, nhghgfdumaq4pst, peardir46, ral6qkeighqenpa
Most users ever online was 611, 03-21-2008 at 10:10 PM.
» .::.
» .:.

Go Back   Nukemods Forum > General > Site design

Reply
 
LinkBack Thread Tools Display Modes
Help with Tree Menus
Old
  (#1 (permalink))
Junior Member
 
Status: Offline
Posts: 5
Join Date: Apr 2005
Help with Tree Menus - 08-21-2005, 02:31 PM

Hi,

I have checked out some websites about building TreeMenu's, and for some reason, they just don't want to work for me.

Here is what I have so far.

In sitemap.txt

Code:
.Start|http://www.sammartin.co.uk/ks/|_top|;
.[b]Home/b>
...Feedback|http://www.sammartin.co.uk/ks/modules.php?name=Feedback|_top|;
...Submit News|http://www.sammartin.co.uk/ks/modules.php?name=Submit_News|_top;
....Recommend Us|http://www.sammartin.co.uk/ks/modules.php?name=Recommend_Us|_top|;
.Email me|mailto:sam@sammartin.co.uk?subject={K*S}Killer-Squad Website
Which should read:

Home
oFeedback
oSubmit News
oRecommend Us

This is what the block-treemenu.php looks like:



Code:
<?php

/************************************************************************/
/* PHP-NUKE: Web Portal System                                          */
/* ===========================                                          */
/*                                                                      */
/* Treemenu Block                                                       */
/* ==============                                                       */
/*                                                                      */
/* Copyright (c) 2002 by Chris Karakas <chris@karakas-online.de>        */
/* http://karakas-online.de                                             */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/*                                                                      */
/* This PHPNuke 6.0 block will display a dynamic tree menu according    */
/* to the entries found in the plain text file                          */
/* blocks/treemenu/sitemap.txt                                          */
/* Edit this file to reflect your tree. As far as the syntax of it      */
/* is concerned, you practically have to remember that a "." means      */
/* "1st level entry", a ".." "2nd level" etc. The rest is just the      */
/* text, the link and an optional window name for the link to           */
/* appear in. See the file blocks/treemenu/treemenu.inc for more        */
/* information and http://www.karakas-online.de/myTreemenu/t1.html      */
/* for more documentation.                                              */
/*                                                                      */
/* Please mail me if you find any bugs and/or improvements.             */
/* In the meantime, enjoy!                                              */
/*                                                                      */
/* Chris                                                                */
/*                                                                      */
/************************************************************************/

if (eregi("block-Treemenu.php",$PHP_SELF)) {
    Header("Location: index.php");
    die();
}


ob_start();
include("blocks/treemenu/treemenu.inc");
$tree = new TreeMenu("a", "blocks/treemenu/sitemap.txt");
$tree->show();

/************************************************************************

 This is the "alternative method" to fill the tree:

 $tree2 = new TreeMenu("b"); 
 $tree2->addNode(1, "grandpa"); 
 $tree2->addNode(2, "pa"); 
 $tree2->addNode(3, "son"); 
 $tree2->addNode(2, "uncle"); 
 $tree2->show(); 

 and here is a way to load different Treemenus based on, say, 
 category id:

 global $catid;
 switch ($catid) {
   case 1:
     $tree = new TreeMenu("a", "blocks/treemenu/category1.txt");
     $tree->show();
     break;
   case 2:
     $tree = new TreeMenu("a", "blocks/treemenu/category2.txt");
     $tree->show();
     break;
   case 3:
     $tree = new TreeMenu("a", "blocks/treemenu/category3.txt");
     $tree->show();
     break;
 }

************************************************************************/

$output = ob_get_contents();
ob_end_clean();
$content = $output;
$content .= "<p align=\"left\">Block created for <A HREF=\"http://phpnuke.org\" target=\"_blank\">PHPNuke 6.0</a> by <A HREF=\"http://www.karakas-online.de\" target=\"_blank\">Chris Karakas</a></p>";

?>
Thankyou,
Supersword
   
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





vBulletin Skin developed by: vBStyles.com


LinkBacks Enabled by vBSEO 3.3.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31