Posted: Tue 13. Jul 2004, 21:40
I also edited the original with my own code.
you can find an example of my site on: http://www.esol.be (site is in dutch)
you can find an example of my site on: http://www.esol.be (site is in dutch)
The phpwcms support forum will help to find answers to your questions. The small but strong community is here since more than 10 years.
https://forum.phpwcms.org/
I don't know why but I get regexp error when I put this into the file... and can't seem to be able to use the new cool table... which is annoying... a bit...david wrote:Hello. I just started using phpwcms and am trying to make it completely CSS based (XHTML-Strict). I implemented my own <ul> version of the NAV_COLUMN_TABLE by simply editing the functions a bit and renaming them. NAV_LIST_CURRENT and NAV_LIST_TOP just didn't do it for me. I hope that someone can use this.
DavidCode: Select all
// ------------------------------------------------------------- // <ul>-list based Navigation table if( ! ( strpos($content["all"],'{NAV_LIST_ALL')==false ) ) { $content["all"] = str_replace('{NAV_LIST_ALL}','{NAV_LIST_ALL:0}',$content["all"]); $replace = 'css_list_all($content["struct"],intval($content["cat_id"]),"$1",$template_default["nav_table_struct"]);'; $content["all"] = preg_replace('/\{NAV_LIST_ALL:(\d+)\}/e', $replace, $content["all"]); }
Code: Select all
<div class="MenuItem_lvl_2" id="activeSection"><a href="index.php?" title="active link">My active link</a></div>
Code: Select all
function build_levels_list ($struct, $level, $temp_tree, $act_cat_id, $nav_table_struct, $count, $div, $link_to) {
// this returns the level structure based on given arrays
// it is special for browsing from root levels
$depth = sizeof($temp_tree)-$div; $count++; $depth2 = $depth-$count+2;
$temp_menu = "";
foreach($struct as $key => $value) {
if($_SESSION["frontend_user_in"] && $struct[$key]["acat_regonly"]) $struct[$key]["acat_regonly"] = 0;
if($struct[$key]["acat_struct"] == $level && $key && !$struct[$key]["acat_hidden"] && !$struct[$key]["acat_regonly"]) {
$link_image_id = "linkid".randpassword(6);
$link_name_id = ' name="'.$link_image_id.'" id="'.$link_image_id.'"';
if(!$struct[$key]["acat_redirect"]){
$link = $link_to."?";
$link .= ($struct[$key]["acat_alias"]) ? html_specialchars($struct[$key]["acat_alias"]) : 'id='.$key.',0,0,1,0,0';
}
else{
$redirect = get_redirect_link($GLOBALS['content']['struct'][$key]["acat_redirect"], ' ', '');
$link = $redirect['link'];
}
if($temp_tree[$key]) {
if($act_cat_id == $key) {
$temp_menu .= "<div class=\"MenuItem_lvl_".$count."\" id=\"activeSection\"><a href=\"".$link."\" ";
if($struct[$key]["acat_redirect"])$temp_menu .= "target = \"".$redirect['target']."\" ";
$temp_menu .= "title=\"".html_specialchars($struct[$key]["acat_name"])."\">".html_specialchars($struct[$key]["acat_name"])."</a></div>\n";
} else {
$temp_menu .= "<div class=\"MenuItem_lvl_".$count."\"><a href=\"".$link."\" ";
if($struct[$key]["acat_redirect"])$temp_menu .= "target = \"".$redirect['target']."\" ";
$temp_menu .= "title=\"".html_specialchars($struct[$key]["acat_name"])."\">".html_specialchars($struct[$key]["acat_name"])."</a></div>\n";
}
$temp_menu .= build_levels_list ($struct, $key, $temp_tree, $act_cat_id, $nav_table_struct, $count, $div, $link_to);
} else {
$temp_menu .= "<div class=\"MenuItem_lvl_".$count."\"><a href=\"".$link."\" ";
if($struct[$key]["acat_redirect"])$temp_menu .= "target = \"".$redirect['target']."\" ";
$temp_menu .= "title=\"".html_specialchars($struct[$key]["acat_name"])."\">".html_specialchars($struct[$key]["acat_name"])."</a></div>\n";
}
}
}
return $temp_menu;
}