Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Undefined Variable
#1
Hi!

when I try to load the index page with flag debug actived I obtain:

Notice: Undefined variable: inter in /var/www/getsimple/admin/inc/theme_functions.php on line 96
Notice: Undefined variable: slugs in /var/www/getsimple/admin/inc/theme_functions.php on line 235
Notice: Undefined variable: slugs in /var/www/getsimple/admin/inc/theme_functions.php on line 238

the only code i have written is:

Code:
<head>
  
  <?php get_header(); ?>
  
  
</head>
<body>
  
  <?php $data = menu_data(); ?>
  
</body>
</html>

I can't run this function http://get-simple.info/forum/viewtopic.php?id=235 because the variable slug is always empty and url lacks of slug. I try to print the array with this code:

Code:
<head>
  
  <?php get_header(); ?>
  
  
</head>
<body>
  
  <?php $data = menu_data(); print("<pre>".print_r($data,true)."</pre>"); ?>
  
</body>

and this is tue output:

Code:
Array
(
    [0] => Array
        (
            [slug] =>
            [url] => http://192.168.0.2/getsimple/index.php?id=
            [parent_slug] => rooms
            [title] => Room A
            [menu_priority] => 0
            [menu_text] => Room A
            [menu_status] =>
            [private] =>
            [pub_date] => Wed, 03 Feb 2010 15:31:11 +0100
        )

    [1] => Array
        (
            [slug] =>
            [url] => http://192.168.0.2/getsimple/index.php?id=
            [parent_slug] =>
            [title] => Choose Your Room
            [menu_priority] => 0
            [menu_text] => Rooms
            [menu_status] => Y
            [private] =>
            [pub_date] => Wed, 03 Feb 2010 15:30:15 +0100
        )

    [2] => Array
        (
            [slug] =>
            [url] => http://192.168.0.2/getsimple/index.php?id=
            [parent_slug] =>
            [title] => Index
            [menu_priority] => 1
            [menu_text] => Home
            [menu_status] =>
            [private] =>
            [pub_date] => Wed, 03 Feb 2010 16:31:01 +0100
        )

)

The field 'slug' is always blank. The structure of pages is like:

+--index
|
---rooms
|
---room A

rooms ha slug 'rooms' and room a has slug 'room-a'

I cant' solve this problem, could you help me?

I'm running on Getsimple 2.0



Thank you

Pole
Reply
#2
does the same thing happen when you have fancy urls turned ON?
- Chris
Thanks for using GetSimple! - Download

Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Reply
#3
ccagle8 Wrote:does the same thing happen when you have fancy urls turned ON?
It works with fancy urls turned on.

Thank You

Pole
Reply
#4
daniele.polencic Wrote:
ccagle8 Wrote:does the same thing happen when you have fancy urls turned ON?
It works with fancy urls turned on.

Thank You

Pole

The "bug" is here:

Code:
if ($PRETTYURLS == '1') {
                        if ($parent != '') {$parent = tsl($parent); }
                        if ($slug == 'index' ) { $slugs = ''; } else { $slugs = $slug; }
                        $url = $SITEURL . @$parent . $slugs;
                    } else {
                        $url = $SITEURL .'index.php?id='.$slugs;
                    }

And I changed it to:

Code:
if ($slug == 'index' ) { $slugs = ''; } else { $slugs = $slug; }
if ($PRETTYURLS == '1') {
                        if ($parent != '') {$parent = tsl($parent); }
                        $url = $SITEURL . @$parent . $slugs;
                    } else {
                        $url = $SITEURL .'index.php?id='.$slugs;
                    }

And it works. Thank you

Pole
Reply
#5
Thanks! I will add it in and test it...
- Chris
Thanks for using GetSimple! - Download

Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Reply
#6
Hello,

I started using GetSimple CMS as of yesterday and really like it, so far. However, when building my own menu via the menu_data() function I got the same error mentioned in the opening post.

When I looked for a solution I looked at the line specified by the PHP error output and saw that all I had to do was to change $slugs into $slug to make the function not return any erros but the slugs instead :-)

I don't know if that is all there is to it but it works for me and you might want to fix that bug (if it is one) in your next release.

Thanks for an awesome piece of software,
Jan
Reply
#7
It should already be fixed in the last beta version, the next stable release is close so the bug will not exist once that one gets out.

Thanks for noticing.
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply




Users browsing this thread: 1 Guest(s)