|
19 | 19 |
|
20 | 20 | if ($siteId) {
|
21 | 21 |
|
22 |
| - /*path for noscript should take unadultered path*/ |
23 |
| - $bugPath = $installPath; |
24 |
| - |
25 |
| - if (strpos($installPath, "https://") !== false) { |
26 |
| - $secureinstallPath = $installPath; |
27 |
| - $installPath = str_replace("https://", "http://", $installPath); |
28 |
| - } |
29 |
| - if (strpos($installPath, "http://") === false) |
30 |
| - $installPath = "http://" . $installPath; |
31 |
| - |
32 |
| - $secureinstallPath = str_replace("http://", "https://", $installPath); |
33 |
| - |
34 |
| - $last = $installPath[strlen($installPath)-1]; |
35 |
| - |
36 |
| - if ($last != "/") { |
37 |
| - $installPath .= "/"; |
38 |
| - $secureinstallPath .= "/"; |
39 |
| - } |
| 22 | + /*remove https or https*/ |
| 23 | + $installPath = preg_replace('#^https?:#', '', $installPath); |
| 24 | + |
40 | 25 |
|
41 | 26 | // 0 Search Results
|
42 | 27 | if($this->getRequest()->getControllerName()=='result') {
|
43 |
| - $nores = Mage::helper('catalogsearch')->getEngine() |
| 28 | + $noRes = Mage::helper('catalogsearch')->getEngine() |
44 | 29 | ->getResultCollection()
|
45 | 30 | ->addSearchFilter(Mage::helper('catalogsearch')
|
46 | 31 | ->getQuery()
|
|
53 | 38 | <script type="text/javascript">
|
54 | 39 | //<![CDATA[
|
55 | 40 | var _paq = _paq || [];
|
56 |
| - (function(){ var u=(("https:" == document.location.protocol) ? "<?php echo $secureinstallPath ?>" : "<?php echo $installPath ?>"); |
57 |
| - _paq.push(['setSiteId', <?php echo $siteId ?>]); |
| 41 | + (function(){ |
| 42 | + var u="<?php echo $installPath ?>"; |
| 43 | + _paq.push(['setSiteId', <?php echo $siteId ?>]); |
58 | 44 | _paq.push(['setTrackerUrl', u+'piwik.php']);
|
59 | 45 | <?php echo $this->_getEcommerceCartUpdate()?>
|
60 | 46 | <?php echo $this->_getOrdersTrackingCode()?>
|
61 | 47 | <?php echo $this->_getProductPageview()?>
|
62 | 48 | <?php echo $this->_getCategoryPageview()?>
|
63 | 49 |
|
64 |
| - <?php if (isset($nores)): ?> |
65 |
| - _paq.push(['setCustomUrl', '' + document.URL + '&search_count=<?php echo $nores ?>']); |
| 50 | + <?php if (isset($noRes)): ?> |
| 51 | + _paq.push(['setCustomUrl', '' + document.URL + '&search_count=<?php echo $noRes ?>']); |
66 | 52 | <?php endif ?>
|
67 | 53 |
|
68 | 54 | <?php
|
|
77 | 63 | 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';
|
78 | 64 | s.parentNode.insertBefore(g,s); })();
|
79 | 65 | </script>
|
80 |
| - <noscript><p><img src="<?php echo $bugPath ?>piwik.php?idsite=<?php echo $siteId ?>" style="border:0" alt="" /></p></noscript> |
| 66 | + <noscript><p><img src="<?php echo $installPath ?>piwik.php?idsite=<?php echo $siteId ?>" style="border:0" alt="" /></p></noscript> |
81 | 67 | <!-- END PIWIK TRACKING CODE -->
|
82 | 68 |
|
83 | 69 | <?php } ?>
|
|
0 commit comments