Jump to content

Newbie help with archiving


us2guys
 Share

Recommended Posts

I am building a site that has content and articles added on different days. I have created an archive page that can direct the surfer to either a page where articles are sorted by author or by month. As you can imagine, this has become a very time-consuming, manual process (I have to physically code each article under each section).Is there a way that I can create a file that will automatically return results when the link is clicked (i.e. When May 2010 button is clicked, it returns a chronological list of articles for May)? In other words, how do I archive these and return a search? What tags/ languages would be appropriate for such a venture?I imagine this will require different languages to accomplish and I am not afraid to learn them, but I need to be pointed in the right direction.Thank you very much for your help!

Link to comment
Share on other sites

There are several different ways in which this can be handled. You're doing something by hand that would ideally be handled by a scripting language. I'd say you should look into something called PHP, a sever-side scripting language that allows you to do things behind the scenes when, for example, a user clicks on a link and is taken to another page. For this, you would basically be using PHP to access a database on your website, usually MySQL to get a list of all the files available for the user to look at. You would then have to program the script to sort based on what the user wants, in this case the author or the month; from there the script would generate an HTML page (PHP can be used to write the HTML before the user sees it) with everything ready to go. The PHP script would use the database to make HTML links on the fly.A second option would be to use a client-side scripting language like JavaScript and it could read in an XML that contains links to all of your articles, along with the dates and authors. Your script could sort them out based on whatever the user wants and then generate a page of links by altering the current page's HTML. Of the two, I'd go for the first as it's more commonly implemented and PHP can't be disabled from the user-end unlike JavaScript. There are dozens of other options to consider, but these are the two I've found to be most convenient. With each, though, you'll still have to update the database or XML file whenever you add more content and articles. But because you'll have a sorting script, you'd need only input basic information once, regardless of where in the database of XML file you put it in. Either way, it's far less work than what you're doing now.W3Schools has all you need to get up and running with PHP and MySQL.

Edited by Shonumi
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...