b_hole
04-22-2007, 07:21 AM
Hi,
I'm trying to build a system that allow the admin to add & edit pages (not real pages - using mod_rewrite to fake pages), and give the admin the possibility to add "sub folders".
Another thing I need to implement is a menu with some relevant links:
- In every page, I need to display links to top-level pages (pages with no "parent").
- In every page, I need to display links to pages that are "sons" of the current page.
The things I can't figure out how to solve:
1. how should my .htaccess ReWriteRule should look like? should I use many different ReWriteRule? This option looks stupid to me:
RewriteRule ^([a-zA-Z\-]+)/([a-zA-Z\-]+)/([a-zA-Z\-]+)/?$ /index.php?parent_title2=$2&parent_title=$2&title=$3
RewriteRule ^([a-zA-Z\-]+)/([a-zA-Z\-]+)/?$ /index.php?parent_title=$1&title=$2
RewriteRule ^([a-zA-Z\-]+)/?$ index.php?title=$1Also, I need to give the admin the possibility to endless number of "sub-folders".
2. How should my DB tables look like? Any structure I think of seems bad :confused: Do you think I should have 2 tables: 1 for pages info and 1 for links info?
Sorry for the long post, and thanks a lot for your time :)
I'm trying to build a system that allow the admin to add & edit pages (not real pages - using mod_rewrite to fake pages), and give the admin the possibility to add "sub folders".
Another thing I need to implement is a menu with some relevant links:
- In every page, I need to display links to top-level pages (pages with no "parent").
- In every page, I need to display links to pages that are "sons" of the current page.
The things I can't figure out how to solve:
1. how should my .htaccess ReWriteRule should look like? should I use many different ReWriteRule? This option looks stupid to me:
RewriteRule ^([a-zA-Z\-]+)/([a-zA-Z\-]+)/([a-zA-Z\-]+)/?$ /index.php?parent_title2=$2&parent_title=$2&title=$3
RewriteRule ^([a-zA-Z\-]+)/([a-zA-Z\-]+)/?$ /index.php?parent_title=$1&title=$2
RewriteRule ^([a-zA-Z\-]+)/?$ index.php?title=$1Also, I need to give the admin the possibility to endless number of "sub-folders".
2. How should my DB tables look like? Any structure I think of seems bad :confused: Do you think I should have 2 tables: 1 for pages info and 1 for links info?
Sorry for the long post, and thanks a lot for your time :)