tags/keywords (Bugs)

by Mark ⌂ @, UK, Thursday, December 11, 2008, 15:37 (4130 days ago) @ Alex

Ok, but I don't want people to specify tags/keywords as 99% of the people posting are not SEO experts! And I wanted a simple message board.

I had a play around and the name of sharing knowledge:

I have made this change in page.inc.php:
$page['content'] = stripslashes($data['content']); //already there
$page['keywords'] = stripslashes($data['keywords']); //new column in db called "keywords"
$page['description'] = stripslashes($data['description']); //new column in db called "description"

And then in main.tpl:
{if strlen($page.description) > 1}
<meta name="description" content="{$page.description}" />
<meta name="description" content="{$settings.forum_description|escape:"html"}" />
{if strlen($page.keywords) > 1}
<meta name="keywords" content="{$page.keywords}" />
<meta name="keywords" content="{$keywords|default:""}" />

This takes the values from the pages table, but if it's not a custom page, it acts as normal. Admittedly you can only add the keywords directly into the database, but it's a vast improvement.

Complete thread:

 RSS Feed of thread

powered by my little forum