2007-05-04 22:23:16 +00:00
|
|
|
<?php
|
2009-08-20 23:37:17 +01:00
|
|
|
/*
|
2007-05-04 22:23:16 +00:00
|
|
|
* Name: Site Description
|
|
|
|
* Author: Shish <webmaster@shishnet.org>
|
2012-02-07 21:52:11 -05:00
|
|
|
* Link: http://code.shishnet.org/shimmie2/
|
2007-05-06 19:01:26 +00:00
|
|
|
* License: GPLv2
|
2010-01-05 13:13:11 +00:00
|
|
|
* Visibility: admin
|
2009-01-16 00:18:41 -08:00
|
|
|
* Description: A description for search engines
|
|
|
|
* Documentation:
|
|
|
|
* This extension sets the "description" meta tag in the header
|
|
|
|
* of pages so that search engines can pick it up
|
2007-05-04 22:23:16 +00:00
|
|
|
*/
|
2012-02-08 12:07:01 +00:00
|
|
|
class SiteDescription extends Extension {
|
2009-07-21 07:36:12 +01:00
|
|
|
public function onPageRequest(PageRequestEvent $event) {
|
|
|
|
global $config, $page;
|
|
|
|
if(strlen($config->get_string("site_description")) > 0) {
|
|
|
|
$description = $config->get_string("site_description");
|
2011-08-28 00:31:30 -04:00
|
|
|
$page->add_html_header("<meta name=\"description\" content=\"$description\">");
|
2007-05-04 22:23:16 +00:00
|
|
|
}
|
2009-07-24 04:35:45 +01:00
|
|
|
if(strlen($config->get_string("site_keywords")) > 0) {
|
|
|
|
$keywords = $config->get_string("site_keywords");
|
2011-08-28 00:31:30 -04:00
|
|
|
$page->add_html_header("<meta name=\"keywords\" content=\"$keywords\">");
|
2009-07-24 04:35:45 +01:00
|
|
|
}
|
2009-07-21 07:36:12 +01:00
|
|
|
}
|
2009-01-04 08:37:08 -08:00
|
|
|
|
2009-07-21 07:36:12 +01:00
|
|
|
public function onSetupBuilding(SetupBuildingEvent $event) {
|
|
|
|
$sb = new SetupBlock("Site Description");
|
2009-07-24 04:35:45 +01:00
|
|
|
$sb->add_text_option("site_description", "Description: ");
|
|
|
|
$sb->add_text_option("site_keywords", "<br>Keywords: ");
|
2009-07-21 07:36:12 +01:00
|
|
|
$event->panel->add_block($sb);
|
2007-05-04 22:23:16 +00:00
|
|
|
}
|
|
|
|
}
|
2014-04-25 22:54:51 -04:00
|
|
|
|