creating a multi-level category search/navigation system

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
cali_dotcom
Forum Commoner
Posts: 49
Joined: Fri Aug 22, 2008 7:28 pm
Location: Rancho Cucamonga, CA

creating a multi-level category search/navigation system

Post by cali_dotcom »

hi, i'm creating the admin section for a multi-level category search/navigation system. i mean like, when a visitor comes to the site and they are looking for data, first a list of categories appears. for example ..... states....departments......etc. so when a user clicks on states, he gets another list of subcategories, and it can go on till he reaches the file/info he's looking for. i also wanted to make it multi dimensional so that a particular piece of information could be reached by different paths.

on the admin side, i dont want to put a limit on the number of categories/levels an administrator can put in.

Now my problem is figuring out the logic necessary to sort and store the data when the administrator uploads them so that in the front end, it would be easy for visitors to find them.

does anyone have any ideas how i can go about this?
Randwulf
Forum Commoner
Posts: 63
Joined: Wed Jan 07, 2009 7:07 am

Re: creating a multi-level category search/navigation system

Post by Randwulf »

Is the information uploaded as a file? If so, you could use the very handy scandir() function to scan each directory into arrays. You could then use file_get_contents() on each file if you need to search the files for specific text. That can take a lot of time and processing power though. It's better to have a keyword file or something of that sort if you need to search individual files.
cali_dotcom
Forum Commoner
Posts: 49
Joined: Fri Aug 22, 2008 7:28 pm
Location: Rancho Cucamonga, CA

Re: creating a multi-level category search/navigation system

Post by cali_dotcom »

the information could be anything from videos to pics to articles etc..
i was thinking of prompting the admin to sort the contents during upload into different categories. then i could store those id's along with the contents in the database.
Post Reply