Dynamic content management problem...

  • optimus prime
  • Born
  • Born
  • User avatar
  • Posts: 4

Post 3+ Months Ago

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
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

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.
  • b_heyer
  • Web Master
  • Web Master
  • User avatar
  • Posts: 4581
  • Loc: Maryland

Post 3+ Months Ago

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"); ?>
  • optimus prime
  • Born
  • Born
  • User avatar
  • Posts: 4

Post 3+ Months Ago

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
  • Posts: 4581
  • Loc: Maryland

Post 3+ Months Ago

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
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

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/

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: No registered users and 83 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
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.