Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MenuStatus Link php function problems.
#1
Ok guys, nice to meet you. I'm Leonardo and i can't speak english very well... Smile
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"){
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.
Reply
#2
did you contact the developer of the theme?
|--

Das deutschsprachige GetSimple-(Unter-)Forum:   http://get-simple.info/forums/forumdisplay.php?fid=18
Reply
#3
Hem, no. I didn't because of i bought the "basic" theme, without premium support.
I don't know how hard is to modify this, but i don't think its so hard.
I'm pretty sure where the problem is, and if someone that can program in php can help me... I bet that I don't need to contact the support. Smile
However, i will try.
Here isn't anyone that can help me?
Thank you
Reply
#4
Solved. I sent a mail to the webmaster. He sent me an answer with the "functions.php" file corrected. easy. eheh.
So, if anyone need the file update should to download this txt and rename in "functions.php", then overwrite the original in the theme folder. (Maybe they updated also the original folder on their website).
Byee
Reply




Users browsing this thread: 1 Guest(s)