Development Articles
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherDevelopment Articles

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 10th, 2001, 08:44 PM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
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}

Reply With Quote
  #2  
Old August 11th, 2001, 05:39 PM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
thoroughly worthwhile

thoroughly worthwhile article, well done, thanks. shame after all this php we are still stuck with JS, but hey.

Reply With Quote
  #3  
Old August 11th, 2001, 08:07 PM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
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...


Reply With Quote
  #4  
Old August 13th, 2001, 06:16 AM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
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

Reply With Quote
  #5  
Old August 13th, 2001, 09:09 AM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
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...


Reply With Quote
  #6  
Old August 13th, 2001, 11:38 AM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
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.

Reply With Quote
  #7  
Old August 13th, 2001, 11:50 AM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
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?

Reply With Quote
  #8  
Old August 13th, 2001, 11:57 AM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
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.

Reply With Quote
  #9  
Old August 13th, 2001, 12:45 PM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
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

Reply With Quote
  #10  
Old August 13th, 2001, 12:55 PM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
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.

Reply With Quote
  #11  
Old August 13th, 2001, 01:47 PM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
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.

Reply With Quote
  #12  
Old August 13th, 2001, 02:58 PM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
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... :)

Reply With Quote
  #13  
Old August 13th, 2001, 03:59 PM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
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.

Reply With Quote
  #14  
Old August 13th, 2001, 06:41 PM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
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 />

Reply With Quote
  #15  
Old August 14th, 2001, 02:11 AM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherDevelopment Articles > Building an Extensible Menu Class


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT