Optimization

July 28, 2004 at 3:38 pm Leave a comment

This evening I didn’t have much time to code on the next section, so I took a few minutes to look through the code a little…

On both the Category Add and Category Edit screens, I had very similar code for displaying a dropdown box of the possible Parent Categories. The major difference is that the dropdown box for the Add screen should always start with None selected, but the Edit screen should select another item. Passing a variable to the function added that distinction… While doing a bit of testing, I realized a minor problem. On the Edit screen, it was possible to select the category being edited AS the Parent category… Talk about circular logic!

This was also fixed with another variable being passed to the function. $excludeID defaults to a value of -1 (which no real category will have). If the dropdown box that I need should have a particular category excluded, I just pass the ID of the category into $excludeID.

Advertisements

Entry filed under: PHP.

Where to begin SPLIB: strip_quotes.php

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


Calendar

July 2004
S M T W T F S
    Aug »
 123
45678910
11121314151617
18192021222324
25262728293031

Most Recent Posts


%d bloggers like this: