Forum Moderators: coopster
I'm here to ask for some advice on how to approach a few new projects I'm about to embark on. Much of this will be new to me, and I want to start correctly from the beginning. I'll try and explain what I'm doing the best I can.
I figure if I learn how to write a site that will be constantly updated, database integrated and modularized like a news/entertainment site, I will have more than enough knowledge to start coding all of the sites I do with PHP/MySQL.
---------------------------------------------------------------------------------
My Project.
I have a site that needs to be updated every other day with stories, news, events and movie listings etc...
Basically, there are four or five main sections to the site. I plan on turning the sections into four or five templates that rotate information in and out of a central database.
The sections are:
1. Home Page - With boxes containing links to the other areas of the site.
2. Music Page - Article, pic and other links.
3. News Page - Article, pic and other links.
4. Entertainment Page - Article, pic and other links.
5. Music Page[2] - Links to various types of music and articles.
To me it would be easiest to create templates out of these and rotate (for example) the newest links and articles dynamically from a database - the authors should have an interface to upload their stories.
- Am I looking at this correctly?
- Where can I learn how to rotate the information when submitted to the database. For example, say article A on the home page has been there for a week and needs to be replaced by article B...but article A needs to be pushed down into the second position and article B now takes the top spot in the list of links.
When clicking the link to go to article A, article A's story pops up in the template, if instead B was clicked- B would pop up in the same template.
Basically just looking to see if I have the right direction, where I can go to get a better understanding of what I'm trying to do...
Does this make sense...
Most appreciated-
If you want the updates delayed (you mentioned every other day) I would setup a pseudo-cron job...that way you don't have to worrry about a special hosting setup. In a nutshell it uses a naturally occuring trigger (usually a page view) and runs the backup, update etc. on the schedule you specify. You should be able to find a turn-key script in one of the many PHP script sites.
You might want to look at PHP and MySQL Web Development, by Luje Welling and Laura Thomson.
Chapter 26 uses a news site as an example of building a content management system. Headlines, graphics, articles, user interface are all there.
WBF
When clicking the link to go to article A, article A's story pops up in the template, if instead B was clicked- B would pop up in the same template.
As you enter each article into the database, you'll need to generate a unique identifier for it. Most databases support at least one method of generating this(ms sql has two). (look up identity, and possibly random numbers)
When you build the listing pages(the ones that show what articles are available(and/or current), you'll create your <a href> link with a flag that says "pick article number 123". Clicking that link would cause the script to pull that specific article(#123 in this example) out of the database and display it to the user.