Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Function: multi-level navigation. / Plugin for version 2!
#76
[Update: see comment 79, below]

New dev environment hiccup now that I'm using a live server.

I get a blank screen when attempting to save a modified page. The site health check is clean, aside from the version status, line 51 of health-check.php:

Code:
$verstatus = $apikey->status;

The multi-level menu's mentioned in two error messages:

Code:
Warning: Cannot modify header information - headers already sent by (output started at /home3/grassygn/public_html/getsimple/admin/plugins/zegnat-multilevelmenu.php:1) in /home3/grassygn/public_html/getsimple/admin/changedata.php on line 166

Line 166:

Code:
// redirect user back to edit page
header("Location: edit.php?uri=". $url ."&upd=edit-success&type=edit");

And the second error message:

Code:
Warning: Cannot modify header information - headers already sent by (output started at /home3/grassygn/public_html/getsimple/admin/plugins/zegnat-multilevelmenu.php:1) in /home3/grassygn/public_html/getsimple/admin/inc/cookie_functions.php on line 24

Line 24:

Code:
setcookie($saltCOOKIE, sha1($saltUSR), time() + $cookie_time);

I'm stuck. Any help would be awesome.

Jeff

Edit: PHP 5.2.11
Reply
#77
What happens when you disable the plugin?
Clients always want to be able to change the content of their pages, but they are unwilling to do so.

Have you ever coded in your underwear before?
Reply
#78
internet54 Wrote:What happens when you disable the plugin?

Page saves, no error messages.

I may just switch to a sidebar submenu. Gotta start building this puppy!
Reply
#79
I re-installed pristine files to the live server and everything worked perfectly (even cURL). I then added my tweaked version of the plugin and got the error.

What's mystifying me is that my changes are limited to echoed lines. Am I tripping up a custom DTD or something?
  • moved the class attribute string out of the ternary operator
  • added a few new class values
  • nested the child UL within a DIV
  • added a <b>

This is the block of code containing the modifications.

Code:
echo '<ul class="level1">';
foreach ($menu as $link) {
     if ("$link->slug" == "") $link->slug = "index";
     $prnt = count($data->xpath('//item[slug="'.$a.'"][parent="'.$link->slug.'"]'));
     echo '<li class="level1-li'.("$link->slug"==$a?' active':($prnt>0?' parent':'')).'"><a class="level1-a drop" href="'.$link->url.'">'.($link->menu!=""?$link->menu:$link->title).'</a><b></b>';
     $menu = $data->xpath('//*[menuStatus="Y"][parent="'.$link->slug.'"]');
     usort($menu,"menu_sorting");
     if (count($menu) > 0) {
          echo '<div><ul>';
          foreach ($menu as $link) {
                echo '<li class="'.("$link->slug"==$a?' active':'').'"><a href="'.$link->url.'">'.($link->menu!=""?$link->menu:$link->title).'</a></li>';
          }
          echo '</ul></div>';
     }
     echo '</li>';
}
echo '</ul>';

(Fyi, I was building for this menu design: http://www.cssplay.co.uk/menus/black-any...tered.html).

I think I'm missing a fundamental in how GS works.

Any illumination would be great.

Jeff
Reply
#80
Do you get any specific error, or does it just turn blank? It would help to see where the script fails.
“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
#81
Zegnåt Wrote:Do you get any specific error, or does it just turn blank? It would help to see where the script fails.

The only difference with a clean install is the code above.

I spoke with my client today and we decided to drop GS, alas. Sad

I'm rolling a quick PHP site and when GS matures (i.e., documentation) we'll migrate so they can benefit from the content management.

When my time frees up I'll be back to help out. This is shaping up as my Drupal alternative.

Best,

Jeff
Reply
#82
Jeff Wrote:The only difference with a clean install is the code above.
Yes, I just didn’t see a direct mistake in it so I hoped you could give me a PHP error to show me where it went wrong somewhere.

Jeff Wrote:I'm rolling a quick PHP site and when GS matures (i.e., documentation) we'll migrate so they can benefit from the content management.
Please let us know what documentation you think is missing. If it’s just that documentation to this plugin is missing, well, I really can’t be bothered to write any. As the first post is pretty clear about; it is provided as is. Still it seems people use this little creation a lot.

Jeff Wrote:I spoke with my client today and we decided to drop GS, alas.
That’s too bad. Would you consider moving back if I could successfully implement CSSplay’s Black and white anywidth centered menu?

Edit: I was bored and couldn’t wait for your answer so I already implemented it … however my FTP client tells me it’s going to take at least half an hour to upload it to my server (lousy mobile connection in the woods). I’ll get back to you once it’s done. The best I can do for now is a screenshot.
“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
#83
Zegnåt Wrote:Please let us know what documentation you think is missing.

What's missing is what Joe asks for in the thread beneath Chris's 2.01 plugins page -- "an architect(ural) / design overview of how the system pieces come together at runtime."

Zegnåt Wrote:If it’s just that documentation to this plugin is missing, well, I really can’t be bothered to write any.

Enough said.
Reply
#84
Jeff Wrote:What's missing is what Joe asks for in the thread beneath Chris's 2.01 plugins page -- "an architect(ural) / design overview of how the system pieces come together at runtime."
Well, I think the best we could do is a list of functions. But most functions are already being used in the default theme so can easily be picked up from there.

As for documentation to this plugin, there is none because it is offered as is and because there is little to write about that you can’t find in the PHP documentation. If you don’t want to run with the HTML it is outputting you’re best of writing your own menu function. There are no real helping functions for this, you’ll just have to query all the information you need from the back-end XML. In the case of a menu this is made somewhat easier by the menu_data-function as it will give you an object to work with.

I do agree there needs to come some sort of documentation for menu_data(). It was first added, buggy, because it was a quick way to query a lot of information. Now that it’s becoming a solid part of the core it should be documented.

Jeff Wrote:Fyi, I was building for this menu design: http://www.cssplay.co.uk/menus/black-any...tered.html.
Please take a look here and tell me what you think: http://zegnat.net/gsmenu/
“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
#85
The current menu system works, but it is not mature by any means. Once I get this contract signed, I will be working on a new menu plugin that allows full control of the menu items, their placement on the page, their links, and their structure.
Clients always want to be able to change the content of their pages, but they are unwilling to do so.

Have you ever coded in your underwear before?
Reply
#86
<< also working on one as we speak...

8)
My Github Repos: Github
Website: DigiMute
Reply
#87
The menu looks good, Zegnåt.

Like I said, it was a pristine install with just the modified code above, and a clear site health check. I don't know why it didn't work.

Zegnåt Wrote:Well, I think the best we could do is a list of functions.

Good luck expanding your user base.
Reply
#88
Jeff Wrote:Good luck expanding your user base.
Good luck finding anything else we should document but the standard functions we have in the core.

Funny to see how everyone figured out they need to make their own menu functions. As my signature has read for quiet a while, I too am working on a new one. I already launched bits of it in a commisioned menu script that split up a large menu into smaller parts per character.
“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
#89
Zegnåt Wrote:
Jeff Wrote:Good luck expanding your user base.
Good luck finding anything else we should document but the standard functions we have in the core.

A little documentation of the GS data flow would go a long way to giving expert designers with modest PHP skillz a foothold.

I know enough PHP to roll brochure websites for side gigs, and I can read and interpret advanced PHP and MySQL well enough to theme around them and tweak functions and queries. But I don't know PHP well enough, nor do I have enough time, to follow dozens of function names across dozens of files just to get a sense of the flow of the data.

Check out the Mapix CMS documentation: http://mapixcms.org/doc/.

The 'whatness' of a technology can also be instantly communicated with a DFD or similar visualization: e.g., http://drupal.org/node/354202.

Jeff
Reply
#90
Since Zegnåts download don't work anymore. Does anyone got this plugin where I can download it? I really need a solution like this, but doesen't got the skills to make one myself.
Reply
#91
Aah, sorry about that, I’m working on my website and took most files down. Attached you’ll find the plugin.

Now that version 2.01 has officially launched I’ll probably be fixing some minor things in the plugin soon. So be sure to report problems so I can take care of them in the next update!
“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
#92
Hey guys, I just downloaded the plugin and installed into my Plugins directory. I also changed the original menu function to:
Quote:<?php menu_master(); ?>
The menu was working fine before but now none of the links are showing up. I know only a little about coding so I am not sure if I am missing something. I have fancy url's turned off.

Here is a sample page of my problem: http://www.redemptionoutreachcenter.com/...?id=sample

Any help would be greatly appreciated.
Reply
#93
Could you turn on debug mode to see possible PHP errors? I currently don’t know about any problem with the script that will make it turn blank.
“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
#94
Zegnåt Wrote:Now that version 2.01 has officially launched

Hi Zegnat, I'm new on GS, could you attach the readme file for your plugin?

Thanks
Reply
#95
You just swap get_navigation() with menu_master(), as described in the first post of this topic.

I don’t think a README is needed as that is the only thing you have to do. There are no extra options (as of this version) to think about.
“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
#96
Zegnåt Wrote:You just swap get_navigation() with menu_master() .

Sorry,
I forgot to delete the menu_master() in my functions.php file :lol:

Thanks for the plugin!
Reply
#97
Zegnåt Wrote:Could you turn on debug mode to see possible PHP errors? I currently don’t know about any problem with the script that will make it turn blank.
Thanks for the reply, after turning on debug mode this was included in the error log:
Quote:[19-Mar-2010 09:15:49] PHP Warning: Missing argument 1 for menu_master(), called in /home/content/80/5809980/html/gscms/theme/Redemption Outreach/template.php on line 47 and defined in /home/content/80/5809980/html/gscms/plugins/zegnat-multilevelmenu.php on line 74
Reply
#98
Well, that’s a bit weird. But as it’s just a PHP warning it shouldn’t be a reason for the script not to run. So I really don’t know why text isn’t showing. Anything else related to the problem you can show?
“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
#99
As I said before, I am not very good at coding but I noticed something in my code that might be a problem, you would know best. I am using a drop-down menu script to create the menu via CSS and I have it coded as follows:
Code:
<td><ul id="nav-one" class="dropmenu">
<?php menu_master(); ?>
</ul>
But once the page is online and the plugin generates the code it adds its own class:
Code:
<td><ul id="nav-one" class="dropmenu">
<ul class="menu"><li><a href="http://www.redemptionoutreachcenter.com/gscms/">Home</a> etc........

Would the two conflicting classes cause nothing to be showing up? If so, is there a way to solve this problem? Thank you so much for helping out.
Reply
It could be conflicting, depending on your CSS. It’s wrong in any case to have an UL-element as a direct child of an other UL-element anyway. You’ll have to edit the plugin to get it right.

Simply search plugin file for this:
Code:
echo '<ul class="menu">';
I think you can guess what you want to edit… Once you edited the plugin to output the right UL-element, remove the one that is wrapping <?php menu_master(); ?> in your template.
“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: 2 Guest(s)