<?php if (!defined('PmWiki')) exit ();

/*  
  PmWiki module to generate a that allows you to adding extra words to the 
  title tag in the head.
  Copyright (C) 2009  Andy Gaskell ag@ssofb.co.uk
  
  -----------------------------------------------------------------------

  Created July 09
  Andy Gaskell, 
  Designer and Developer @ Software Systems: Open For Business
  www.ssofb.co.uk
  A web design and development company based in Aberdeen, UK.

  This is a really simple receipe for adding extra words to the title tag in the head.
  
  It is intended for use with SEO, so you want the head->title tag to have extra 
  words in it that are not in the title text in the body of the page.

  Most search engines put a high value on the title tag when deciding relevance 
  to search terms, it is, I think the simplest and most effective SEO option 

  More info: http://www.pmwiki.org/wiki/Cookbook/ExtraWordsInTitleTag
  
  Related Cookbooks / Recepies
    http://www.pmwiki.org/wiki/Cookbook/EditTitle
    http://www.pmwiki.org/wiki/Cookbook/SEO

  -----------------------------------------------------------------------

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 3 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.

  -----------------------------------------------------------------------
 
  Revision History
	Revision 1.0.20090707	Andy Gaskell	
*/
// meta info
$RecipeInfo['Extra Words In Title Tag']['Version'] = '1.0.20090707';

Markup("ExtraTitleWords", "directives", '/\\(:ExtraTitleWords (.*?):\\)/e', 'fExtraTitleWords("$1")');

function fExtraTitleWords ($extrawordstring) {
  // take the title and add the extrawordstring to the end after a comma.
  $GLOBALS["WikiTitle"] .= $GLOBALS["WikiTitle"] . ", " . $extrawordstring;
}