![]() |
Adding Content Sections without Breaking Code
Not sure where to begin on my latest problem... :confused: :confused: :confused:
Here goes... So I am wrapping up my first website, which is a "portal" on Small-Business. It was completely hand-coded, and doesn't use anything like WordPress. (Yuck!) Everything has been working great, except for this "tiny* little problem I discovered last week... All of my effort over the last year has been spent on making my website more "interactive" by adding features like User Accounts, Private Messaging, Friending, Subscriptions, Profiles, etc. All of this works great, except I realized a few weeks ago that I didn't do a very good job planning what to do when my CONTENT grows!!! Currently, all Articles are stored in MySQL. And here is my current "Pretty URL" scheme... http://local.debbie/articles/postage-meters-can-save-you-money Once I get 20-30 Articles, this structure will be a real drag for Users, because no one will want to scroll down through 30 Articles in my Article Index Page! It would be nice to be able to add Sections "on-the-fly" and not break all of my Article-related scripts along the way. Something like this seems more scalable while keeping my "Pretty URL's"... http://local.debbie/articles/finance/postage-meters-can-save-you-moneyOr like this... http://local.debbie/finance/postage-meters-can-save-you-money I feel fairly comfortable with mod_rewrite's, but I think my problem is much more complex for this reason... In my "articles" directory, I have several scripts that relate to an Article... - "add_comment.php" - "edit_comment.php" - "rate_article.php" - "report_comment.php" - "join_thread.php" In those scripts, I have code that is looking for the Article in the "article" directory like this... PHP Code:
PHP Code:
Both of those code snippets are EXTREMELY INFLEXIBLE, because if I add "finance" and "operations" directories, then - as I see it - I would need to have TWO SCRIPTS to support the different Article locations?! Not sure if I am making sense, and I PRAY that I don't have to re-write my entire website because of this seemingly innocent oversite on how my Articles will be structured... :( :( :( Any idea of where to begin on this problem??? Thanks, Debbie |
could you have an article appear in 2 locations?
for example the article about terms exists in legal directory, however is accessible through articles folder and legal folder? www.mysite.com/articles/stuff_about_terms.html www.mysite.com/legal/stuff_about_terms.html for listing you can split it into legal etc, so its all subdivided but always reference it through articles directory? both links would take you to the same article though? does that make sense? does that help? |
| All times are GMT +1. The time now is 08:55 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.