public function renderHead() { parent::renderHead(); $conf = $this->getConf(); // Include the trackPageView code for all pages EXCEPT photo-detail // photo-detail pages are tracked via the code in renderFooter since // it can be full page loads or AJAX. $trackInHead = null; if ($this->plugin->getData('page') !== 'photo-detail') { $trackInHead = <<<MKP _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); MKP; } return <<<MKP <!-- Piwik --> <script type="text/javascript"> var _paq = _paq || []; (function(){ var u=(("https:" == document.location.protocol) ? "https://{$conf->baseUrl}/" : "http://{$conf->baseUrl}/"); _paq.push(['setSiteId', {$conf->siteId}]); _paq.push(['setTrackerUrl', u+'piwik.php']); {$trackInHead} var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.defer=true; g.async=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s); })(); </script> <!-- End Piwik Code --> MKP; }
public function renderHead() { parent::renderHead(); $conf = $this->getConf(); return <<<MKP <!-- start Mixpanel --><script type="text/javascript">var mpq=[];mpq.push(["init","{$conf->id}"]);(function(){var b,a,e,d,c;b=document.createElement("script");b.type="text/javascript";b.async=true;b.src=(document.location.protocol==="https:"?"https:":"http:")+"//api.mixpanel.com/site_media/js/api/mixpanel.js";a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(b,a);e=function(f){return function(){mpq.push([f].concat(Array.prototype.slice.call(arguments,0)))}};d=["init","track","track_links","track_forms","register","register_once","identify","name_tag","set_config"];for(c=0;c<d.length;c++){mpq[d[c]]=e(d[c])}})(); </script><!-- end Mixpanel --> MKP; }
public function renderHead() { parent::renderHead(); $conf = $this->getConf(); return <<<MKP <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', '{$conf->id}']); _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> MKP; }
public function renderHead() { parent::renderHead(); $conf = $this->getConf(); return <<<MKP <script type="text/javascript"> var _gauges = _gauges || []; (function() { var t = document.createElement('script'); t.type = 'text/javascript'; t.async = true; t.id = 'gauges-tracker'; t.setAttribute('data-site-id', '{$conf->id}'); t.src = '//secure.gaug.es/track.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(t, s); })(); </script> MKP; }
public function renderHead() { parent::renderHead(); $user = new User(); $page = $this->plugin->getData('page'); $username = $user->getNameFromEmail($this->config->user->email); switch ($page) { case 'photo-detail': $photo = $this->plugin->getData('photo'); $prefix = ''; if ($photo['title'] != '') { $prefix = sprintf('%s - ', $photo['title']); } elseif ($photo['filenameOriginal'] != '') { $prefix = sprintf('%s - ', $photo['filenameOriginal']); } return <<<MKP <title>{$prefix}{$username}'s photos - Trovebox</title> MKP; break; case 'photos': return <<<MKP <title>{$username}'s photos - Trovebox</title> MKP; break; case 'tags': return <<<MKP <title>{$username}'s tags - Trovebox</title> MKP; break; default: return <<<MKP <title>{$username}'s Photo site - Trovebox</title> MKP; break; } }
public function renderHead() { parent::renderHead(); $utility = new Utility(); $page = $this->plugin->getData('page'); $username = $utility->getEmailHandle($this->config->user->email, false); switch ($page) { case 'photo-detail': $photo = $this->plugin->getData('photo'); $prefix = ''; if ($photo['title'] != '') { $prefix = sprintf('%s - ', $photo['title']); } elseif ($photo['filenameOriginal'] != '') { $prefix = sprintf('%s - ', $photo['filenameOriginal']); } return <<<MKP <title>{$prefix}{$username}'s photos - The OpenPhoto Project</title> MKP; break; case 'photos': return <<<MKP <title>{$username}'s photos - The OpenPhoto Project</title> MKP; break; case 'tags': return <<<MKP <title>{$username}'s tags - The OpenPhoto Project</title> MKP; break; default: return <<<MKP <title>{$username}'s OpenPhoto site - The OpenPhoto Project</title> MKP; break; } }