From a4b47fd4bc8a039786f951603c661b50076b4555 Mon Sep 17 00:00:00 2001 From: Eugene Kopylov Date: Thu, 4 Apr 2019 13:40:23 +0300 Subject: [PATCH] fix metrika --- helpers/myjbzoostat.php | 28 +++++++++++++++++++++++++--- myjbzoostat.xml | 2 +- updatemyjbzoostat.xml | 6 +++--- views/articles/tmpl/default.php | 6 ++++++ views/auhorsprofile/tmpl/default.php | 8 ++++++-- views/autors/tmpl/default.php | 6 ++++++ views/checkoneurl/tmpl/default.php | 9 +++++++-- views/disqus/tmpl/default.php | 9 +++++++-- views/index/tmpl/default.php | 4 ++++ views/nodubles/tmpl/default.php | 10 +++++++--- views/orders/tmpl/default.php | 5 +++++ views/report/tmpl/default.php | 9 +++++++-- views/reportauthors/tmpl/default.php | 5 +++++ views/social/tmpl/default.php | 8 ++++++-- views/tags/tmpl/default.php | 5 +++++ 15 files changed, 100 insertions(+), 20 deletions(-) diff --git a/helpers/myjbzoostat.php b/helpers/myjbzoostat.php index b90c56a..545e9bd 100644 --- a/helpers/myjbzoostat.php +++ b/helpers/myjbzoostat.php @@ -2,6 +2,7 @@ defined( '_JEXEC' ) or die; + class MyjbzoostatHelper { @@ -11,10 +12,17 @@ public static function open_http($url, $method = 'curl') { if($method == 'curl' && function_exists('curl_init')) { + + $component = JComponentHelper::getComponent('com_myjbzoostat'); + $params = json_decode($component->params); + $app_token = $params->app_token; + + $headr = array(); + $headr[] = 'Authorization: OAuth '. $app_token . ''; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, false); - curl_setopt($ch, CURLOPT_HEADER, 0); + curl_setopt($ch, CURLOPT_HTTPHEADER, $headr); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); $result = curl_exec($ch); @@ -32,10 +40,17 @@ public static function open_httppost($url, $method = 'curl') { if($method == 'curl' && function_exists('curl_init')) { + + $component = JComponentHelper::getComponent('com_myjbzoostat'); + $params = json_decode($component->params); + $app_token = $params->app_token; + + $headr = array(); + $headr[] = 'Authorization: OAuth '. $app_token . ''; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_HEADER, 0); + curl_setopt($ch, CURLOPT_HTTPHEADER, $headr); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); $result = curl_exec($ch); @@ -57,10 +72,17 @@ public static function open_http($url, $method = 'curl') { if($method == 'curl' && function_exists('curl_init')) { + + $component = JComponentHelper::getComponent('com_myjbzoostat'); + $params = json_decode($component->params); + $app_token = $params->app_token; + + $headr = array(); + $headr[] = 'Authorization: OAuth '. $app_token . ''; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, false); - curl_setopt($ch, CURLOPT_HEADER, 0); + curl_setopt($ch, CURLOPT_HTTPHEADER, $headr); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); $result = curl_exec($ch); diff --git a/myjbzoostat.xml b/myjbzoostat.xml index 189861c..bf43aff 100644 --- a/myjbzoostat.xml +++ b/myjbzoostat.xml @@ -6,7 +6,7 @@ http://cb9t.ru - 2.7.1 + 2.8.0
]]>
28 June 2016 diff --git a/updatemyjbzoostat.xml b/updatemyjbzoostat.xml index a867890..945f822 100644 --- a/updatemyjbzoostat.xml +++ b/updatemyjbzoostat.xml @@ -5,15 +5,15 @@ MyJBZooStat com_myjbzoostat component - 2.7.1 + 2.8.0 https://github.com/CB9TOIIIA/MyJBZooStat/ - + - + \ No newline at end of file diff --git a/views/articles/tmpl/default.php b/views/articles/tmpl/default.php index fbf6aed..09f9713 100644 --- a/views/articles/tmpl/default.php +++ b/views/articles/tmpl/default.php @@ -1,6 +1,12 @@ getGroup('config.sef'); $JBZooSEFenabled = $checkJBZooSEF->get('enabled'); $JBZooSEFfix_item = $checkJBZooSEF->get('fix_item'); diff --git a/views/autors/tmpl/default.php b/views/autors/tmpl/default.php index ed3b14b..eaed4c4 100644 --- a/views/autors/tmpl/default.php +++ b/views/autors/tmpl/default.php @@ -1,6 +1,12 @@ getGroup('config.sef'); $JBZooSEFenabled = $checkJBZooSEF->get('enabled'); $JBZooSEFfix_item = $checkJBZooSEF->get('fix_item'); diff --git a/views/disqus/tmpl/default.php b/views/disqus/tmpl/default.php index 55804fa..a21aff8 100644 --- a/views/disqus/tmpl/default.php +++ b/views/disqus/tmpl/default.php @@ -3,8 +3,13 @@ // error_reporting(E_ALL); /** @var $this MyjbzoostatViewAutors */ defined( '_JEXEC' ) or die; // No direct access - -if (JFolder::exists(JPATH_ROOT . '/components/com_zoo')) { + + /* add Class 'JFolder */ + JLoader::register('JFile', JPATH_LIBRARIES . '/joomla/filesystem/file.php'); + JLoader::register('JFolder', JPATH_LIBRARIES . '/joomla/filesystem/folder.php'); + + + if (JFolder::exists(JPATH_ROOT . '/components/com_zoo')) { $checkJBZooSEF = JBModelConfig::model()->getGroup('config.sef'); $JBZooSEFenabled = $checkJBZooSEF->get('enabled'); $JBZooSEFfix_item = $checkJBZooSEF->get('fix_item'); diff --git a/views/index/tmpl/default.php b/views/index/tmpl/default.php index ad7431b..ccca872 100644 --- a/views/index/tmpl/default.php +++ b/views/index/tmpl/default.php @@ -1,6 +1,10 @@ getGroup('config.sef'); $JBZooSEFenabled = $checkJBZooSEF->get('enabled'); diff --git a/views/nodubles/tmpl/default.php b/views/nodubles/tmpl/default.php index 2aa71e3..20b1972 100644 --- a/views/nodubles/tmpl/default.php +++ b/views/nodubles/tmpl/default.php @@ -1,8 +1,12 @@ getGroup('config.sef'); $JBZooSEFenabled = $checkJBZooSEF->get('enabled'); $JBZooSEFfix_item = $checkJBZooSEF->get('fix_item'); diff --git a/views/reportauthors/tmpl/default.php b/views/reportauthors/tmpl/default.php index 2ae3ae4..a97cdc6 100644 --- a/views/reportauthors/tmpl/default.php +++ b/views/reportauthors/tmpl/default.php @@ -1,6 +1,11 @@