p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   PHP How-To (http://p2p.wrox.com/forumdisplay.php?f=98)
-   -   Database Driven Website w/ META tags (http://p2p.wrox.com/showthread.php?t=502)

Dan Jallits June 12th, 2003 11:39 AM

Database Driven Website w/ META tags
 
I am in the process of completing a web site for a friend that took it up as a project. The inital site was never completed because the original designer/developer didn't know boo about anything.

So now I am looking for a resource that explains how to add dynamic META tags to a Database Driven Website. The tags, stored in the database along with the content, need to be relevant to the page that is currently being viewed, not randomly generated.

This in theory will generate better Search results from Google, Yahoo, etc. The Keyword field will also be utilized to search the site, generating a results page that includes a linked page tile, its relevance, and the page description. Possibly even the creation/modify date and author.

I should also mention that I am using what I like to call "the three-file simple template method". That is a header file that contains the head section and the begining of the body section. A main file that contains the main content of the site. Last a footer file that contains the copyright information, and closes the body and html tags.

Any help would be greatly appreciated.

Best Regards,
Dan Jallits

cmiller June 13th, 2003 12:39 AM

While I do not have a specific resource that explains this, I have done similar things millions of times.

My thoughts are this: For database structure, there are 3 core tables, one containing the body code forthe document, the next containing all of the unique keywords that you may use on your site (emphasis on unique, no need for dupes), and the last table for linking it all together. The body table will contain cells for the last updated date and time, as well as the author and any other relevant information you need.

Now how this all comes together is this. You make some sort of admin section that allows you to "assign" keywords to specific pages. When you assign a keyword to a page, a resord will be added to the 3rd table. That table would essentially only contain 3 columns. The first being a unique id number for that record, the second holding the id number of the body document, and the last containing the id of the keyword. Multiple records can be added for each body document with different keywords assigned to each.

Now of course comes the question of what the heck to do with all of it once it's gotten this far. Well, when you tell the page to pull the specific body document from the database, you tell it to select all of the instances of that body showing up in the linking table. This in turn will give you all of the unique id's of keywords associated with that document. Now with a while look, you have the database pull the record for each keyword based on the id number and build the meta keyword string as it goes.

As for showing the date modified and author info in the meta tags as well, just select those cells from the body document table when you select the body content. Should be pretty straight forward.

If you'r still lost, respond to this and I will try to explain it more.

----------
~cmiller

Dan Jallits June 16th, 2003 11:42 AM

Thanks for quick synopsis. I am now in the process of taking your approach. If I run into a problem I will email. Thanks again.

Best Regards,
Dan Jallits


All times are GMT -4. The time now is 09:25 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.