Hello folks.. I'd need some advice here.
I'm building a menu system, with topics and items for each topic. No subtopics.
the thing is that each item is only to be shown if the user got the right permissions to see that part of the system.
how would you lay up the structure in php/sql?
one table for topics and one for items?
one table with a field marking it's a topic?
next matter is that the text displayed needs to contain different stuff, sometimes I need to put in a variable's value inside the title of an item, but mostly just plain urls to another page in the websystem.
best method to solve this?
any suggestions on how to layout this?
cheers.
Menu structure
Started by Orjan, Jul 18 2008 05:16 AM
4 replies to this topic
#1
Posted 18 July 2008 - 05:16 AM
|
|
|
#2
Posted 18 July 2008 - 07:18 AM
So it sounds like each menu requires:
1) list of topics
2) list of items with parent topic and permission value
3) list of users with permission levels.
4) list of dynamic content for each topic
5) list of dynamic content for each item
Is this about right?
1) list of topics
2) list of items with parent topic and permission value
3) list of users with permission levels.
4) list of dynamic content for each topic
5) list of dynamic content for each item
Is this about right?
#3
Posted 18 July 2008 - 08:32 AM
hmm. .well, this dynamic content is always the same for each topic/item
i'm thinking of a structure like this:
topics: id, name, evalname
where i store php-code to be eval:ed
and leave either name or evalname empty depending of it's dyminacallity(?)
i'm thinking of a structure like this:
topics: id, name, evalname
where i store php-code to be eval:ed
and leave either name or evalname empty depending of it's dyminacallity(?)
#4
Posted 20 July 2008 - 12:12 PM
All above suggestions are good, but what kind of content will be posted? how large will the site grow?
this things also matter for a good structure
this things also matter for a good structure
#5
Posted 21 July 2008 - 09:37 PM
um.. maybe max 10 topics and max 100 items totally
I actually found the way, I'd store php in database like
return "Items (".$number_of_items." items)";
and evals the info and out plots a nice text string "Items (572 items)" to show up.
I splitted the info to two tables, seemed easier and it follows the most basic database biulding schemes to split any relative info.
I actually found the way, I'd store php in database like
return "Items (".$number_of_items." items)";
and evals the info and out plots a nice text string "Items (572 items)" to show up.
I splitted the info to two tables, seemed easier and it follows the most basic database biulding schemes to split any relative info.


Sign In
Create Account

Back to top










