Skip to content

Commit

Permalink
fix metrika
Browse files Browse the repository at this point in the history
  • Loading branch information
CB9TOIIIA committed Apr 4, 2019
1 parent 114eb57 commit a4b47fd
Show file tree
Hide file tree
Showing 15 changed files with 100 additions and 20 deletions.
28 changes: 25 additions & 3 deletions helpers/myjbzoostat.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

defined( '_JEXEC' ) or die;


class MyjbzoostatHelper
{

Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion myjbzoostat.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<authorUrl>http://cb9t.ru</authorUrl>
<copyright></copyright>
<license></license>
<version>2.7.1</version>
<version>2.8.0</version>
<description><![CDATA[MyJBZooStat - это компонент статистики и менеджер системы комментирования Disqus.<br><br><iframe frameborder='0' allowtransparency='true' scrolling='no' src='https://tpv.sr/1QoBNn1/' width='510' height='300'></iframe>]]> </description>
<creationDate>28 June 2016</creationDate>
<administration>
Expand Down
6 changes: 3 additions & 3 deletions updatemyjbzoostat.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
<description>MyJBZooStat</description>
<element>com_myjbzoostat</element>
<type>component</type>
<version>2.7.1</version>
<version>2.8.0</version>
<infourl title="MyJBZooStat">
https://github.com/CB9TOIIIA/MyJBZooStat/
</infourl>
<downloads>
<downloadurl type="full" format="zip"><![CDATA[https://github.com/CB9TOIIIA/MyJBZooStat/releases/download/2.7.1/com_myjbzoostat_stable_2.7.1.zip]]></downloadurl>
<downloadurl type="full" format="zip"><![CDATA[https://github.com/CB9TOIIIA/MyJBZooStat/releases/download/2.8.0/com_myjbzoostat_stable_2.8.0.zip]]></downloadurl>
</downloads>
<maintainer/>
<maintainerurl/>
<targetplatform name="joomla" version="3.[0123456789]"/>
</update>
</updates>
</updates>
6 changes: 6 additions & 0 deletions views/articles/tmpl/default.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
<?php
/** @var $this MyjbzoostatViewAutors */
defined( '_JEXEC' ) or die; // No direct access

/* add Class 'JFolder */
JLoader::register('JFile', JPATH_LIBRARIES . '/joomla/filesystem/file.php');
JLoader::register('JFolder', JPATH_LIBRARIES . '/joomla/filesystem/folder.php');


?>
<?php

Expand Down
8 changes: 6 additions & 2 deletions views/auhorsprofile/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
/** @var $this MyjbzoostatViewAutors */
defined( '_JEXEC' ) or die; // No direct access
// dump($_POST,0,'post');

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');
Expand Down
6 changes: 6 additions & 0 deletions views/autors/tmpl/default.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
<?php
/** @var $this MyjbzoostatViewAutors */
defined( '_JEXEC' ) or die; // No direct access

/* add Class 'JFolder */
JLoader::register('JFile', JPATH_LIBRARIES . '/joomla/filesystem/file.php');
JLoader::register('JFolder', JPATH_LIBRARIES . '/joomla/filesystem/folder.php');


?>
<?php

Expand Down
9 changes: 7 additions & 2 deletions views/checkoneurl/tmpl/default.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
<?php
defined( '_JEXEC' ) or die;

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');
Expand Down
9 changes: 7 additions & 2 deletions views/disqus/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
4 changes: 4 additions & 0 deletions views/index/tmpl/default.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<?php
defined( '_JEXEC' ) or die;

/* 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');
Expand Down
10 changes: 7 additions & 3 deletions views/nodubles/tmpl/default.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<?php
defined( '_JEXEC' ) or die;


ini_set( 'display_errors', 1 );

/* add Class 'JFolder */
JLoader::register('JFile', JPATH_LIBRARIES . '/joomla/filesystem/file.php');
JLoader::register('JFolder', JPATH_LIBRARIES . '/joomla/filesystem/folder.php');


ini_set( 'display_errors', 1 );
error_reporting( E_ALL );

jimport('joomla.html.html.bootstrap');
Expand Down
5 changes: 5 additions & 0 deletions views/orders/tmpl/default.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<?php
/** @var $this MyjbzoostatViewAutors */
defined( '_JEXEC' ) or die; // No direct access

/* add Class 'JFolder */
JLoader::register('JFile', JPATH_LIBRARIES . '/joomla/filesystem/file.php');
JLoader::register('JFolder', JPATH_LIBRARIES . '/joomla/filesystem/folder.php');

?>
<?php
require_once JPATH_ADMINISTRATOR . '/components/com_myjbzoostat/elements/paramsetc.php';
Expand Down
9 changes: 7 additions & 2 deletions views/report/tmpl/default.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
<?php
defined( '_JEXEC' ) or die;

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');
Expand Down
5 changes: 5 additions & 0 deletions views/reportauthors/tmpl/default.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<?php
/** @var $this MyjbzoostatViewAutors */
defined( '_JEXEC' ) or die; // No direct access

/* add Class 'JFolder */
JLoader::register('JFile', JPATH_LIBRARIES . '/joomla/filesystem/file.php');
JLoader::register('JFolder', JPATH_LIBRARIES . '/joomla/filesystem/folder.php');

?>
<?php

Expand Down
8 changes: 6 additions & 2 deletions views/social/tmpl/default.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<?php
/** @var $this MyjbzoostatViewAutors */
defined( '_JEXEC' ) or die; // No direct access

// ini_set( 'display_errors', 1 );

/* add Class 'JFolder */
JLoader::register('JFile', JPATH_LIBRARIES . '/joomla/filesystem/file.php');
JLoader::register('JFolder', JPATH_LIBRARIES . '/joomla/filesystem/folder.php');

// ini_set( 'display_errors', 1 );
// error_reporting( E_ALL );

if (JFolder::exists(JPATH_ROOT . '/components/com_zoo')) {
Expand Down
5 changes: 5 additions & 0 deletions views/tags/tmpl/default.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<?php
/** @var $this MyjbzoostatViewAutors */
defined( '_JEXEC' ) or die; // No direct access

/* add Class 'JFolder */
JLoader::register('JFile', JPATH_LIBRARIES . '/joomla/filesystem/file.php');
JLoader::register('JFolder', JPATH_LIBRARIES . '/joomla/filesystem/folder.php');

?>
<?php

Expand Down

0 comments on commit a4b47fd

Please sign in to comment.