|
|
@ -600,6 +600,26 @@ function publisher(){ |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Google Analytics
|
|
|
|
|
|
function analytics(){ |
|
|
|
|
|
$analytics = config('google.analytics.id'); |
|
|
|
|
|
$script = <<<EOF |
|
|
|
|
|
<script type="text/javascript"> |
|
|
|
|
|
var _gaq = _gaq || []; |
|
|
|
|
|
_gaq.push(['_setAccount', '{$analytics}']); |
|
|
|
|
|
_gaq.push(['_trackPageview']); |
|
|
|
|
|
(function() { |
|
|
|
|
|
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; |
|
|
|
|
|
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; |
|
|
|
|
|
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); |
|
|
|
|
|
})(); |
|
|
|
|
|
</script> |
|
|
|
|
|
EOF; |
|
|
|
|
|
if (!empty($analytics)) { |
|
|
|
|
|
return $script; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// Menu
|
|
|
// Menu
|
|
|
function menu(){ |
|
|
function menu(){ |
|
|
$menu = config('blog.menu'); |
|
|
$menu = config('blog.menu'); |
|
|
@ -641,4 +661,4 @@ function generate_rss($posts){ |
|
|
// Turn an array of posts into a JSON
|
|
|
// Turn an array of posts into a JSON
|
|
|
function generate_json($posts){ |
|
|
function generate_json($posts){ |
|
|
return json_encode($posts); |
|
|
return json_encode($posts); |
|
|
} |
|
|
|
|
|
|
|
|
} |