Adding Content Sections without Breaking Code
Not sure where to begin on my latest problem... :confused: :confused: :confused:
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...
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"...
Or like this...
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...
In those scripts, I have code that is looking for the Article in the "article" directory like this...
// Set Return Path. *
// Store Path to Original Article.
$_SESSION['articleReturnPath'] = (isset($_SESSION['returnToPage']) ? $_SESSION['returnToPage'] : "/articles/$slug");
// Change Redirect from "article.php" to "rate_this_article.php"
$_SESSION['returnToPage'] = "/articles/rate-this-article/$slug";
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???