|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Great article
Awesome article. Gives me some good ideas for the project I am working on right now!
<br /> <br /> I just wanted to mention one thing... instead of having a get_label and get_link function why not just modify query() to take requested fields as another argument. you would only build the clause part of the SQL statement and send the requested fields as an array: <br /> <br /> $link = query("link", "WHERE id = $id"); <br /> <br /> That way you could get rid of get_link, get_label, etc. <br /> <br /> <br /> Not to critique, again the article was great. <br /> <br /> <br /> <br /> ( :nP} |
|
#2
|
|||
|
|||
|
thoroughly worthwhile
thoroughly worthwhile article, well done, thanks. shame after all this php we are still stuck with JS, but hey.
|
|
#3
|
|||
|
|||
|
Bugs in examples
Really great article, but the problem is that there are few bugs in examples.
im menu.zip -> file menu.class.php line 162 "$this -> pass" should be "$this -> password" hiermenu example is missing some files HM_Script*.js. and when I put needed files [from personal arcihve] hiermenu example won't work anyway... |
|
#4
|
|||
|
|||
|
Re: Great article
Hi cschilbe,
<br /> <br /> > instead of having a get_label and get_link function why not just modify query() to take requested fields as another argument <br /> <br /> This would contradict the objectives of object oriented programming. The function "query()" should have universal usability, so that you could be able to use it in other parts of your programm as well - even if these parts should have nothing to do with the handling of your menu. <br /> <br /> Ciao <br /> <br /> Felbi |
|
#5
|
|||
|
|||
|
Re: thoroughly worthwhile
can't you download this somewhere...already type en put in the right files..
then you only have to edit it... muck easier.... :) the artikel is oke... |
|
#6
|
|||
|
|||
|
Server load impact
Great article. Very usefull example but in my opinion, its implementation may stress a server as there are many queries to the database to build the menu system.
I'd probably change things to fill up an array in memory in just one query and work all methods over the array. This "caching" technic may loosen the load to a mysql server and speed up the process a lot. This shouldn't be an issue on a light traffic site but it may have great impact on a high traffic site. |
|
#7
|
|||
|
|||
|
Re: Bugs in examples
Yeah I know there are bugs. The example with a mysql table to run the hier system does not work. I am working on getting it working. Does anyone else want to help me?
|
|
#8
|
|||
|
|||
|
Error whe include("");
Does this tutorial apply to php3, php4 or both? When I include the menu.class.php file in my php script that forms the constructor:
$obj = new Menu(); I get the following error: Warning: Undefined variable: mysql_db_query in path/to/class/menu.class.php on line 44 Anyone know the problem? I'm assuming its talking about the $this->db variable??? I dunno. |
|
#9
|
|||
|
|||
|
Re: Bugs in examples
I tried to have a look at the HM example too, the arrays were all there so db connections were good but the example didn't succeed in doing anything with the arrays of data
|
|
#10
|
|||
|
|||
|
Re: Bugs in examples
Yeah I had the same problem. I this menu system is worth implementing with a php obj to create the arrays. ( actually I am working on it while at my day job ) heheh. email me doug or anyone else that may want to further develop this idea.
junk@firegarden.com ROb. |
|
#11
|
|||
|
|||
|
Re: Great article
My point exactly. get_label(), get_parent(), etc. are single use functions. If you had a get() and passed it the fields as an array, it would be more robust.
|
|
#12
|
|||
|
|||
|
Re: Bugs in examples
Ok, I've fixed bugs for HierMenu script.
You can get it at: http://www.e-burza.com/clicklog.php3?url=HierMenu-Tree_Dynamic.zip It's a dirty code [still some extra javascript added], but it works... :) |
|
#13
|
|||
|
|||
|
Do I have to install anything to create this?
I don't have control over the server which hosts our sites, but I have access to a mysql database, they have the latest version of PHP4 installed.
I saw a mention to some things at the end of the article that said the server was running, but do I need them installed? Thanks in advance. |
|
#14
|
|||
|
|||
|
Re: Great article
<i>My point exactly. get_label(), get_parent(), etc. are single use functions. If you had a get() and passed it the fields as an array, it would be more robust.</i>
<br /> <br /> As felbi mentioned, this would violate one of the fundamental principles of OOP. Look, for example, at EJBs, where the same design pattern is used. <br /> |
|
#15
|
|||
|
|||
|
problem-mysql_db_query is deprecated
when i run the script this problem stare at me:-
<br /> <br /> =================================== <br /> Warning: Undefined variable: id in c:program filesapache groupapachehtdocsmenuportal.php on line 11 <br /> <br /> Warning: Undefined property: pass in c:program filesapache groupapachehtdocsmenumenu.class.php on line 160 <br /> <br /> Warning: mysql_db_query is deprecated; use mysql_select_db() and mysql_query() instead in c:program filesapache groupapachehtdocsmenumenu.class.php on line 162 <br /> ========================================= <br /> <br /> any solution for that? <br /> <br /> charu |
![]() |
| Viewing: Dev Shed Forums > Other > Development Articles > Building an Extensible Menu Class |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|