<?php/** * @package Helix Framework * @author JoomShaper http://www.joomshaper.com * @copyright Copyright (c) 2010 - 2013 JoomShaper * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or Later*///no direct acceesdefined ('_JEXEC') or die('resticted aceess');class HelixFeatureAnalytics{ private $helix; public function __construct($helix){ $this->helix = $helix; } public function onHeader() { } public function onFooter() { ob_start(); ?> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', '<?php echo $this->helix->Param('ga_code') ?>']); _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> <?php $data = ob_get_contents(); ob_end_clean(); $code = $this->helix->Param('ga_code'); if( $this->helix->Param('enable_ga') and !empty($code) ) return $data; } public function Position() { } public function onPosition() { } } Web không chạy được báo lỗi cái code này,nhưng tìm hoài không biết lỗi chỗ nào, các pro vui lòng hướng dẫn giúp. ( Parse error: syntax error, unexpected '}' in /home/tinthoi4nv/public_html/plugins/system/helix/features/analytics.php on line 1 ) Thanks các bạn
lỗi này của bác là thừa 1 dấu } trong cái file ở đường link báo lỗi ấy. nếu bác muốn tìm lỗi thì format đoạn js này thành dạng bình thường chứ ko phải là min như hiện tại thì sẽ tìm đc lỗi
Cảm ơn bác đã post bài nhé, bài viết rất hay ^^. Tks chủ thớt nhiều nhé. Hy vọng chủ thớt post càng nhìu bài càng tốt nhé, mang lại kiến thức hay thêm cho mọi người. tks chủ thớt nhiều ^^