summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-06-13 14:58:06 -0400
committerEvan Prodromou <evan@status.net>2010-06-13 14:58:06 -0400
commit4b750b75da05e32bf8676883ad01e8b5965eceae (patch)
treee9abf4f73621ce0bc44a2d0f9b411e5a66f6054f
parent3da8914edb81a1789d69ee6c32092959630e4e1c (diff)
show site claim keys on top page
-rw-r--r--plugins/Sitemap/SitemapPlugin.php39
1 files changed, 39 insertions, 0 deletions
diff --git a/plugins/Sitemap/SitemapPlugin.php b/plugins/Sitemap/SitemapPlugin.php
index 7ef5f1aa9..87a70585e 100644
--- a/plugins/Sitemap/SitemapPlugin.php
+++ b/plugins/Sitemap/SitemapPlugin.php
@@ -128,6 +128,45 @@ class SitemapPlugin extends Plugin
}
/**
+ * Meta tags for "claiming" a site
+ *
+ * We add extra meta tags that search engines like Yahoo!, Google, and Bing
+ * require to let you claim your site.
+ *
+ * @param Action $action Action being executed
+ *
+ * @return boolean hook value.
+ */
+
+ function onStartShowHeadElements($action)
+ {
+ $actionName = $action->trimmed('action');
+
+ $singleUser = common_config('singleuser', 'enabled');
+
+ // Different "top" pages if it's single user or not
+
+ if (($singleUser && $actionName == 'showstream') ||
+ (!$singleUser && $actionName == 'public')) {
+
+ $keys = array('googlekey' => 'google-site-verification',
+ 'yahookey' => 'y_key',
+ 'bingkey' => 'msvalidate.01'); // XXX: is this the same for all sites?
+
+ foreach ($keys as $config => $metaname) {
+ $content = common_config('sitemap', $config);
+
+ if (!empty($content)) {
+ $action->element('meta', array('name' => $metaname,
+ 'content' => $content));
+ }
+ }
+ }
+
+ return true;
+ }
+
+ /**
* Database schema setup
*
* We cache some data persistently to avoid overlong queries.