My observations ... and problems i'm facing .

Help
kigoobe
2007-03-08
2013-04-11
  • kigoobe
    kigoobe
    2007-03-08

    Well, I'm trying to install this since yesterday, and still getting bugs. So I thought to post those here till I solve the issue, as that might help others, and also, between the time I post a problem and found its solution, may be someone else will visit the forum who had the same issue earlier, and can help me to resolve the issue faster.

    My first observations -

    1. This is a wonderful product. So far, the best I have found, conceptually, that's available in the open source market. A million thanks to Marko for his wonderful effort.

    2. The manual could be bundled together with the product. In this way, we just do one download, and what happened to me earlier, I downloaded the main program, and then kept looking for a readme file. Having found none, I went to look at the code at comments, tried finding a solution, etc. Or, atleast a readme file of one line, telling that there is an extensive manual, that needs to be downloaded seperately. I think this may happen to others as well.

    3. This forum lacks something. First, while reading a post in an all white background, its become difficult and very user unfriendly to read long posts, and then, this is not really search engine optimized. How many time while doing a googling for a particular issue we come across a sourceforge forum thread? Marco may think to go for a more traditional forum like sitepoint's. If hosting is an issue, I can offer that free of cost, as this is a good project.

    4. I have noticed some other things what could improve the product, but won't post now as I am yet to go through the manual from a to z (well, 90% done), may be once I have solved my problem, I will post those.

     
    • kigoobe
      kigoobe
      2007-03-08

      So, I am trying a php tree menu (non java scripted), and this is the code I am trying to use -

      include ("lib/layersmenu.inc.php");
      include ("lib/layersmenu-noscript.inc.php");
      $mid = new XLayersMenu();
      $mid->setDBConnParms("mysql://$kgbuser:$kgbpass@$kgbhost/$kgbdb_name");
      $mid->setTableName("menu_management");
      $mid->setTableFields(array(
          "id"        => "id",
          "parent_id"    => "parent_menu",
          "text"        => "menu_name",
          "link"        => "public_url",
          "title"        => "menu_name",
          "icon"        => "",
          "target"    => "",
          "orderfield"    => "position",
          "expanded"    => "display"
      ));
      $mid->setMenuStructureFile("layersmenu-vertical-1.txt");
      $mid->parseStructureForMenu("treemenu1");

      $mid->printHeader();
      print $mid->newPHPTreeMenu("treemenu1");
      $mid->printFooter();

      Error - Fatal error: Cannot instantiate non-existent class: template in /home/user/../../lib/layersmenu.inc.php on line 1324

      Marco has mentioned in the manual that we dont need to have include ("lib/template.inc.php"); in case of a php tree menu. If I don't include that, I get this error. If I do, I get a menu that has nothing to do with my database.

       
    • kigoobe
      kigoobe
      2007-03-08

      Well, I am getting a menu now, yet to check, but posting my code here before -

      include ("lib/template.inc.php");
      include ("lib/layersmenu.inc.php");
      include ("lib/layersmenu-noscript.inc.php");
      $mid = new XLayersMenu();
      $mid->setDBConnParms("mysql://$kgbuser:$kgbpass@$kgbhost/$kgbdb_name");
      $mid->setTableName("menu_management");
      $mid->setTableFields(array(
          "id"        => "id",
          "parent_id"    => "parent_menu",
          "text"        => "menu_name",
          "link"        => "public_url",
          "title"        => "",
          "icon"        => "",
          "target"    => "",
          "orderfield"    => "position",
          "expanded"    => "display"
      ));
      $mid->setMenuStructureFile("layersmenu-vertical-1.txt");
      $mid->scanTableForMenu("treemenu1");

      $mid->printHeader();
      print $mid->newPHPTreeMenu("treemenu1");
      $mid->printFooter();

      This corresponds to my database, but contrary to the manual, I had to include ("lib/template.inc.php") without which the code was not working. Will keep posting ...

       
    • kigoobe
      kigoobe
      2007-03-08

      So, here is one question I'm asking myself now -

      In case I want to set more than one menu to remain open when the page loads, by default, how can I set them using, say

      $mid->setPHPTreeMenuDefaultExpansion(23);

      What I have understood, that I can set one menu to remain open by default using the above function. Not more. Also, what about, if I want that to be done thro' database?

      Intitially I thought, while setting up "expanded" => "display" that if the value of that field is 1 the menu appears unfolded by default, and if 0, appears folded by default. I thought that would be more logical. That's how I build my database. Now I am trying to find a way to fix this issue.

      Any help will be appreciated, if I find something myself, I will post that.

      Thanks.  

       
    • kigoobe
      kigoobe
      2007-03-08

      So, one problem is solved. After visiting layersmenu-noscript.inc.php, I found that in order to set multiple menus to keep open by default, one needs to use them inside quotes, seperated by |

      $mid->setPHPTreeMenuDefaultExpansion("2|3|23"); or

      $mid->setPHPTreeMenuDefaultExpansion('2|3|23');

      The other problem still remains the same. How can I get the values from database ???

       
    • kigoobe
      kigoobe
      2007-03-08

      The solutions would be, instead of identifying individual menu items for folding and unfolding by the variable $cnt, to identify them with their id (as associated in the database).

      I believe Marko has taken this path to ensure that this can be used by everyone, those using a database and those using the script from a file / string.

      There could have been a condition there, like if data is getting fetched from a database, replace $cnt by something like $this->tree[$cnt]["parsed_id"]

       
    • kigoobe
      kigoobe
      2007-03-08

      looks like a desert here ... anyway ...

       
    • kigoobe
      kigoobe
      2007-03-08

      So, the second day is finishing here, and the results are so far pretty frustrating. I tried to modify the codes above, it seems that I could not get behind Marco's logic exactly, so, dropped the idea and tried to develop the same vertical tree menu using the $menustring method. Result - only the first menu is coming (the first line only), as a node. Height of frustration !!!

       
    • kigoobe
      kigoobe
      2007-03-08

      NOW : I am able to produce the menu using $menustring, the same menu that was fetched from the database directly, but the result is the same as before. I can't have multiple menu unfolded, with folding / unfolding getting fetched directly from the database.

      I hope that I am doing some error here, as if this function can't really be fetched from the database, and relies on an incremental counter $cnt, this is a serious drawback in an otherwise nice project, and may need to be addresses in the next update.

       
    • kigoobe
      kigoobe
      2007-03-08

      Marco, since u r silent / busy, is there a way that I can set up the default setPHPTreeMenuDefaultExpansion() value thro' a boolean of database? Say, that of "expanded". I had a few issues, I have solved during the day, but this is where I'm still blocked !!! Any help will be extremely appreciated. Thanks.

       
    • kigoobe
      kigoobe
      2007-03-09

      So, I've solved this issue. It took me about 2 days to install this product and solve this issue, but now when I look backward, the istallation could be done in less than an hour if the manual was bundled with the product (I spent my first day looking at different files and figuring out a way to customize this, as I couldn't find a read me file with the product). My fault, I agree, but a read me file of even one line with a hint that the manual can be downloaded seperately from the same location could help a lot of people I believe.

      Second, to solve the other issue I took again about a day, as nothing proper was said about this, about how to get the default expand directly from the database, while codewise, it was a 15 minutes job (well, half an hour, let's say, but certainly not more than that).

      Here is what I have done.

      1. Get the data into a string first, instead of calling data directly from the base.
      2. Once the data was in the string, it was just a matter of minutes to write a few lines of code to parse the string and see what's the boolean value for expansion of each of those datum.

      Marco, I think you might consider to add these two things to your product. May be in a future version.

      Any question, I am available at sourav [a] kigoobe.com
      Best
      Sourav Choudhury
      www.kigoobe.com