Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
09-15-2012, 07:36 PM #1
Adding Content Sections without Breaking Code
Not sure where to begin on my latest problem...
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???
09-29-2012, 12:09 PM #2
- Join Date
- Feb 2009
- United Kingdom
- Thanked 33 Times in 33 Posts
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?
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?
<DmncAtrny> I will write on a huge cement block "BY ACCEPTING THIS BRICK THROUGH YOUR WINDOW, YOU ACCEPT IT AS IS AND AGREE TO MY DISCLAIMER OF ALL WARRANTIES, EXPRESS OR IMPLIED, AS WELL AS DISCLAIMERS OF ALL LIABILITY, DIRECT, INDIRECT, CONSEQUENTIAL OR INCIDENTAL, THAT MAY ARISE FROM THE INSTALLATION OF THIS BRICK INTO YOUR BUILDING."
<DmncAtrny> And then hurl it through the window of a Sony officer
<DmncAtrny> and run like hell
Portfolio, Tutorials - http://www.nomanic.biz/