Dynamic content management problem...

  • optimus prime
  • Born
  • Born
  • User avatar
  • Joined: Aug 03, 2003
  • Posts: 4
  • Status: Offline

Post August 3rd, 2003, 9:23 pm

My site Tokyolounge.com, is a Japanese language learning communty. I write articles and lessons on the Japanese language and culture and post them to my site for students to read, study, and discuss in the forums.

Right now I have about 15 articles. The problem is that by the end of this year, there will be over 100 articles on my site. This becomes a problem because any time I change the layout or look of thhe site, I have to edit every html file so it all matches.

I tried to find a way around this using PHP. I wrote the bare content of the articles(text only) in html files. I then wrote a php file with a <include> statement to include the article relative to the link. ie, lessons.php?id=verbs.

This is a problem because I need every article to carry its own Title and Meta tags. And having a massive Switch statement in my php file to handle the 100 or so articles is just rediculous.

Can anything think of anyway around this.

My other problem is the User interface. Any tips on how to arrange my site to accommodate hundreds of articles. Or do you know and any sites of that magnitude that you can direct me to so I can see how they do it?

Thanks for your help!
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post August 3rd, 2003, 9:23 pm

  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Joined: May 28, 2003
  • Posts: 23403
  • Loc: Woodbridge VA
  • Status: Offline

Post August 3rd, 2003, 9:55 pm

The way this forum script does it is to use an overall_header.tpl and overall_footer.tpl file. You could use a similar approach for the header, but for the title and meta tags use variables that are queried from a database and use a "where" statement based on which article is being used., in which case you would only have to revise the database as you add articles.

I hope that makes sense. I'm still learning php, but it was the first php question I thought I understood enough to give a possible solution for.
"There's no place like 127.0.0.1 except for ::1."
Alexandria Networks. Leader in IT consulting for associations/non-profits, and small to medium sized businesses around the northern Virginia and Washington D.C. metro area.
  • b_heyer
  • Web Master
  • Web Master
  • User avatar
  • Joined: Jun 15, 2003
  • Posts: 4583
  • Loc: Maryland
  • Status: Offline

Post August 4th, 2003, 8:01 am

if you have access to sql, you could set up a database and query it with php.

If you don't, try appending the files you want with their specific content:
lesson1.txt
meta.lesson1.txt
title.lesson1.txt

then in the lessons.php?id=lesson1
Code: [ Select ]
<HTML>
<HEAD>
<? include("meta.$id.txt"); ?>
<TITLE>
<? include("title.$id.txt"); ?>
</TITLE>
<BODY>
<?include("$id.txt"); ?>
  1. <HTML>
  2. <HEAD>
  3. <? include("meta.$id.txt"); ?>
  4. <TITLE>
  5. <? include("title.$id.txt"); ?>
  6. </TITLE>
  7. <BODY>
  8. <?include("$id.txt"); ?>
Pixel Acres V2
  • optimus prime
  • Born
  • Born
  • User avatar
  • Joined: Aug 03, 2003
  • Posts: 4
  • Status: Offline

Post August 4th, 2003, 4:42 pm

I like the SQL idea. This way, I wont have 300 files sitting in one folder. This is a problem for me right now, because goggle not only reads my "lessons.php?id=" links to articles, it also reads the folder where all the article content is kept. So I think Im getting penalized for redundancy.

Another question, would I be able to add a whole article to an SQL DB? I though SQL DB's were just to hold variables and small peices of data. And if I can add a whole article to a database, do you think it would matter that some of the characters were Japanese?

Also, any links on mySQL that explain setting up a simple database?

Thanks for your help guys.
  • b_heyer
  • Web Master
  • Web Master
  • User avatar
  • Joined: Jun 15, 2003
  • Posts: 4583
  • Loc: Maryland
  • Status: Offline

Post August 4th, 2003, 4:46 pm

I believe there is a way to stop the google bot from going into that directory.

I am not sure how much the database can handle, but I know that the forum is all run on mysql, so it should be able to handle enough. And I would imagine the japanese characters to not be a problem at all.

you could try google for simple tutorials or http://www.mysql.com
Pixel Acres V2
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Joined: May 28, 2003
  • Posts: 23403
  • Loc: Woodbridge VA
  • Status: Offline

Post August 4th, 2003, 7:31 pm

You may need to check with your webhost on setting up the database, but as far as administering it this is excellent:

http://www.phpmyadmin.net/
"There's no place like 127.0.0.1 except for ::1."
Alexandria Networks. Leader in IT consulting for associations/non-profits, and small to medium sized businesses around the northern Virginia and Washington D.C. metro area.

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: No registered users and 132 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.