<?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>";
?> |