Browse Source

Merge pull request #94 from Kanti/master

Added Webmaster tool verification by @Kanti.
pull/93/merge
Danang Probo Sayekti 11 years ago
parent
commit
fdb93641bc
2 changed files with 13 additions and 4 deletions
  1. +4
    -1
      config/config.ini.example
  2. +9
    -3
      system/includes/functions.php

+ 4
- 1
config/config.ini.example View File

@ -32,6 +32,9 @@ fb.color = "light"
; Disqus comments ; Disqus comments
disqus.shortname = "" disqus.shortname = ""
; Google Web Master Tool ID verification
google.wmt.id = ""
; Google+ publisher ; Google+ publisher
google.publisher = "" google.publisher = ""
@ -84,4 +87,4 @@ views.root = "themes/logs"
views.counter = "true" views.counter = "true"
; Framework config. No need to edit. ; Framework config. No need to edit.
views.layout = "layout"
views.layout = "layout"

+ 9
- 3
system/includes/functions.php View File

@ -1561,6 +1561,7 @@ function head_contents($title, $description, $canonical) {
$styleImage = config('lightbox'); $styleImage = config('lightbox');
$jq = config('jquery'); $jq = config('jquery');
$output = ''; $output = '';
$wmt_id = config('google.wmt.id');
$title = '<title>' . $title . '</title>'; $title = '<title>' . $title . '</title>';
$favicon = '<link href="' . site_url() . 'favicon.ico" rel="icon" type="image/x-icon"/>'; $favicon = '<link href="' . site_url() . 'favicon.ico" rel="icon" type="image/x-icon"/>';
@ -1576,14 +1577,19 @@ function head_contents($title, $description, $canonical) {
$jquery = '<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>'; $jquery = '<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>';
$lightbox = '<script src="' . site_url() . 'system/plugins/lightbox/js/lightbox-2.6.min.js"></script>'; $lightbox = '<script src="' . site_url() . 'system/plugins/lightbox/js/lightbox-2.6.min.js"></script>';
$corejs = '<script src="' . site_url() . 'system/resources/htmly.js"></script>'; $corejs = '<script src="' . site_url() . 'system/resources/htmly.js"></script>';
$webmasterTools = '';
if(!empty($wmt_id))
{
$webmasterTools = '<meta name="google-site-verification" content="' . $wmt_id . '" />';
}
if ($styleImage == 'on') { if ($styleImage == 'on') {
$output .= $title . "\n" . $favicon . "\n" . $charset . "\n" . $generator . "\n" . $xua . "\n" . $viewport . "\n" . $description . "\n" . $sitemap . "\n" . $canonical . "\n" . $feed . "\n" . $lightboxcss . "\n" . $jquery . "\n" . $lightbox . "\n" . $corejs . "\n";
$output .= $title . "\n" . $favicon . "\n" . $charset . "\n" . $generator . "\n" . $xua . "\n" . $viewport . "\n" . $description . "\n" . $sitemap . "\n" . $canonical . "\n" . $feed . "\n" . $lightboxcss . "\n" . $jquery . "\n" . $lightbox . "\n" . $corejs . "\n" . $webmasterTools . "\n";
} else { } else {
if ($jq == 'enable') { if ($jq == 'enable') {
$output .= $title . "\n" . $favicon . "\n" . $charset . "\n" . $generator . "\n" . $xua . "\n" . $viewport . "\n" . $description . "\n" . $sitemap . "\n" . $canonical . "\n" . $feed . "\n" . $jquery . "\n";
$output .= $title . "\n" . $favicon . "\n" . $charset . "\n" . $generator . "\n" . $xua . "\n" . $viewport . "\n" . $description . "\n" . $sitemap . "\n" . $canonical . "\n" . $feed . "\n" . $jquery . "\n" . $webmasterTools . "\n";
} else { } else {
$output .= $title . "\n" . $favicon . "\n" . $charset . "\n" . $generator . "\n" . $xua . "\n" . $viewport . "\n" . $description . "\n" . $sitemap . "\n" . $canonical . "\n" . $feed . "\n";
$output .= $title . "\n" . $favicon . "\n" . $charset . "\n" . $generator . "\n" . $xua . "\n" . $viewport . "\n" . $description . "\n" . $sitemap . "\n" . $canonical . "\n" . $feed . "\n" . $webmasterTools . "\n";
} }
} }


Loading…
Cancel
Save