2012-02-10, 05:53:05
Ok guys, nice to meet you. I'm Leonardo and i can't speak english very well...
However, I'm having trouble with the variable "menu status" with the theme i bought: if i check or not "show in menu" in the pages control panel it doesn't work, and i see every time all pages and child pages in main nav.
So, i can't program in php, but I think that I've understood where the problem is and i just need help to correct it:
I found in admin/inc/theme_functions.php this:
But in the theme "SimpleCorp" bought from getsimplethemes, in the file "functions.php" i have this code:
Well, i see that is not written anything about this variable:
How can I correct this? If you need that, the address of the website is: http://www.grupposorbo.it/getsimple
Thanks a lot,
Regards,
Leonardo.
However, I'm having trouble with the variable "menu status" with the theme i bought: if i check or not "show in menu" in the pages control panel it doesn't work, and i see every time all pages and child pages in main nav.
So, i can't program in php, but I think that I've understood where the problem is and i just need help to correct it:
I found in admin/inc/theme_functions.php this:
Code:
if ($page['menuStatus'] == 'Y') {
if($page['linkmenu'] == "yes"){
$menu .= '<li class="'. $classes .'"><a href="'. $page['linkmenuurl'] . '" title="'. strip_quotes($page['title']) .'">'.$page['menu'].'</a></li>'."\n";
}else{
if ("$currentpage" == "$url_nav") { $classes = "current ". $page['parent'] ." ". $url_nav; } else { $classes = trim($page['parent'] ." ". $url_nav); }
if ($page['menu'] == '') { $page['menu'] = $page['title']; }
if ($page['title'] == '') { $page['title'] = $page['menu']; }
$menu .= '<li class="'. $classes .'"><a href="'. find_url($page['url'],$page['parent']) . '" title="'. strip_quotes($page['title']) .'">'.$page['menu'].'</a></li>'."\n";
}
}
}
}
closedir($dir_handle);
echo exec_filter('menuitems',$menu);
}
But in the theme "SimpleCorp" bought from getsimplethemes, in the file "functions.php" i have this code:
Code:
<?php
function gst_navigation($page){
$menudata = menu_data();
//get $page's parent
$temp = get_content($page);
$page_parent = $temp['parent'];
foreach($menudata as $item) {
if($item['parent_slug'] == '') {//parent items first
echo '<div>';
//current item?
if($item['slug'] == $page || $item['slug'] == $page_parent) {
echo '<a href="'.$item['url'].'" class="current">'.$item['title'].'</a>';
} else {
echo '<a href="'.$item['url'].'">'.$item['title'].'</a>';
}
//check for children
$counter = 0;
$kids = '';//will contain the kids as string if any
foreach($menudata as $kid) {
if($kid['parent_slug'] == $item['slug'] && $item['slug'] != 'index') {
$kids .= '<a href="'.$kid['url'].'">'.$kid['title'].'</a>';
$counter++;
}
}
if($counter > 0) {
echo '<span>';
echo $kids;
echo '</span>';
}
echo '</div>';
}
}
}
function gst_childpages($parent, $orderby = 'title') {
$data = menu_data();
$parent = $parent;
$output = array();
if($orderby == 'title') {
usort($data, "cmp_title");
}
if($orderby == 'date') {
usort($data, "cmp_date");
}
if($orderby == 'menuOrder') {
usort($data, "cmp_menuorder");
}
$items = array();
foreach($data as $block) {
if ($block['parent_slug'] == $parent && $block['title'] != 'sidebar'){
array_push($items, get_content($block['slug']));
}
}
return $items;
}
function get_content($page){
$item = array();
$path = "data/pages";
$thisfile = @file_get_contents('data/pages/'.$page.'.xml');
$data = simplexml_load_string($thisfile);
//print_r($data);
$item['content'] = stripslashes(htmlspecialchars_decode($data->content, ENT_QUOTES));
$item['title'] = $data->title;
$item['pubDate'] = $data->pubDate;
$item['url'] = $data->url;
$item['private'] = $data->private;
$item['parent'] = $data->parent;
$item['menuOrder'] = $data->menuOrder;
return $item;
}
function cmp_title($a, $b) {
if ($a['title'] == $b['title']) {
return 0;
}
return ($a['title'] < $b['title']) ? -1 : 1;
}
function cmp_date($a, $b) {
if (strtotime($a['pub_date']) == strtotime($b['pub_date'])) {
return 0;
}
return (strtotime($a['pub_date']) > strtotime($b['pub_date'])) ? -1 : 1;
}
function cmp_menuorder($a, $b) {
if ($a['menu_priority'] == $b['menu_priority']) {
return 0;
}
return ($a['menu_priority'] < $b['menu_priority']) ? -1 : 1;
}
Well, i see that is not written anything about this variable:
Code:
if ($page['menuStatus'] == 'Y') {
if($page['linkmenu'] == "yes"){
Thanks a lot,
Regards,
Leonardo.