Skip to content

Commit

Permalink
fix JBZoo SEF options
Browse files Browse the repository at this point in the history
  • Loading branch information
CB9TOIIIA committed Dec 9, 2016
1 parent c5e717d commit bca07ff
Show file tree
Hide file tree
Showing 22 changed files with 272 additions and 107 deletions.
4 changes: 2 additions & 2 deletions 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.5.6</version>
<version>2.5.10</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 All @@ -31,5 +31,5 @@
<language tag="ru-RU">language/ru-RU/ru-RU.com_myjbzoostat.sys.ini</language>
</languages>
</administration>
<updateservers><server type="extension" priority="1" name="MyJBZooStat">https://raw.githubusercontent.com/CB9TOIIIA/MyJBZooStat/master/updatemyjbzoostat.xml?12345</server></updateservers>
<updateservers><server type="extension" priority="1" name="MyJBZooStat">https://raw.githubusercontent.com/CB9TOIIIA/MyJBZooStat/master/updatemyjbzoostat.xml</server></updateservers>
</extension>
27 changes: 0 additions & 27 deletions updatemyjbzoostat.xml

This file was deleted.

14 changes: 14 additions & 0 deletions views/articles/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@
?>
<?php

$checkJBZooSEF = JBModelConfig::model()->getGroup('config.sef');
$JBZooSEFenabled = $checkJBZooSEF->get('enabled');
$JBZooSEFfix_item = $checkJBZooSEF->get('fix_item');
$JBZooSEFitem_alias_id = $checkJBZooSEF->get('item_alias_id');
$JBZooSEFfix_category_id = $checkJBZooSEF->get('fix_category_id');
$JBZooSEFfix_category = $checkJBZooSEF->get('fix_category');
$JBZooSEFcategory_alias_id = $checkJBZooSEF->get('category_alias_id');
$JBZooSEFfix_feed = $checkJBZooSEF->get('fix_feed');
$JBZooSEFredirect = $checkJBZooSEF->get('redirect');
$JBZooSEFfix_canonical = $checkJBZooSEF->get('fix_canonical');
$JBZooSEFparse_priority = $checkJBZooSEF->get('parse_priority');
$JBZooSEFcanonical_redirect = $checkJBZooSEF->get('canonical_redirect');
$JBZooSEFzoo_route_caching = $checkJBZooSEF->get('zoo_route_caching');

require_once JPATH_ADMINISTRATOR . '/components/com_myjbzoostat/elements/paramsetc.php';
if (empty($threshold)) {
$threshold = '2';
Expand Down
16 changes: 9 additions & 7 deletions views/articles/view.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,22 +95,24 @@ protected function _setToolBar()
if (JComponentHelper::isEnabled('com_zoo') == '1') { $bar->appendButton('Custom', $dhtml, 'list'); }



JToolBarHelper::divider();

$bar = JToolBar::getInstance('toolbar');
$title = JText::_('Disqus');
$dhtml = "<a href=\"/administrator/index.php?option=com_myjbzoostat&view=disqus\" class=\"btn btn-small\"><i class=\"icon-comments-2\" title=\"$title\"></i>$title</a>";
$bar->appendButton('Custom', $dhtml, 'list');
if (version_compare(PHP_VERSION, '5.5.30') >= 0)
{
$bar = JToolBar::getInstance('toolbar');
$title = JText::_('Disqus');
$dhtml = "<a href=\"/administrator/index.php?option=com_myjbzoostat&view=disqus\" class=\"btn btn-small\"><i class=\"icon-comments-2\" title=\"$title\"></i>$title</a>";
$bar->appendButton('Custom', $dhtml, 'list');

JToolBarHelper::divider();
JToolBarHelper::divider();
}

$bar = JToolBar::getInstance('toolbar');
$title = JText::_('Социальные сети');
$dhtml = "<a href=\"/administrator/index.php?option=com_myjbzoostat&view=social\" class=\"btn btn-small\"><i class=\"icon-tree\" title=\"$title\"></i>$title</a>";
$bar->appendButton('Custom', $dhtml, 'list');

JToolBarHelper::divider();
JToolBarHelper::preferences('com_myjbzoostat');

$bar = JToolBar::getInstance('toolbar');
$title = JText::_('Отчет');
Expand Down
25 changes: 24 additions & 1 deletion views/auhorsprofile/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@
defined( '_JEXEC' ) or die; // No direct access
// dump($_POST,0,'post');

$checkJBZooSEF = JBModelConfig::model()->getGroup('config.sef');
$JBZooSEFenabled = $checkJBZooSEF->get('enabled');
$JBZooSEFfix_item = $checkJBZooSEF->get('fix_item');
$JBZooSEFitem_alias_id = $checkJBZooSEF->get('item_alias_id');
$JBZooSEFfix_category_id = $checkJBZooSEF->get('fix_category_id');
$JBZooSEFfix_category = $checkJBZooSEF->get('fix_category');
$JBZooSEFcategory_alias_id = $checkJBZooSEF->get('category_alias_id');
$JBZooSEFfix_feed = $checkJBZooSEF->get('fix_feed');
$JBZooSEFredirect = $checkJBZooSEF->get('redirect');
$JBZooSEFfix_canonical = $checkJBZooSEF->get('fix_canonical');
$JBZooSEFparse_priority = $checkJBZooSEF->get('parse_priority');
$JBZooSEFcanonical_redirect = $checkJBZooSEF->get('canonical_redirect');
$JBZooSEFzoo_route_caching = $checkJBZooSEF->get('zoo_route_caching');


?>

<script type="text/javascript">
Expand Down Expand Up @@ -473,7 +488,15 @@ function rdate($param, $time=0) {

$monthitem = $app->table->item->get($monthiteid);
// jbdump($monthitem,0,'Месяцы');
$myurltosite = JRoute::_($app->jbrouter->externalItem($monthitem, false), false, 2);

if ($JBZooSEFenabled == 1 && $JBZooSEFfix_item == 1) {
$myurltosite = JRoute::_($app->jbrouter->externalItem($monthitem, false), false, 2);
$myurltosite = str_replace('/item/','/',$myurltosite);
}
else {
$myurltosite = JRoute::_($app->jbrouter->externalItem($monthitem, false), false, 2);
}

// dump($myurltosite,0,'$myurltosite');
$aliasart = $monthitem->alias;
$aliasartitem = 'item/'.$aliasart;
Expand Down
19 changes: 10 additions & 9 deletions views/auhorsprofile/view.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ protected function _setToolBar()
if (JComponentHelper::isEnabled('com_zoo') == '1') { $bar->appendButton('Custom', $dhtml, 'list'); }



JToolBarHelper::divider();

$bar = JToolBar::getInstance('toolbar');
Expand All @@ -96,24 +97,24 @@ protected function _setToolBar()
if (JComponentHelper::isEnabled('com_zoo') == '1') { $bar->appendButton('Custom', $dhtml, 'list'); }




JToolBarHelper::divider();

$bar = JToolBar::getInstance('toolbar');
$title = JText::_('Disqus');
$dhtml = "<a href=\"/administrator/index.php?option=com_myjbzoostat&view=disqus\" class=\"btn btn-small\"><i class=\"icon-comments-2\" title=\"$title\"></i>$title</a>";
$bar->appendButton('Custom', $dhtml, 'list');
if (version_compare(PHP_VERSION, '5.5.30') >= 0)
{
$bar = JToolBar::getInstance('toolbar');
$title = JText::_('Disqus');
$dhtml = "<a href=\"/administrator/index.php?option=com_myjbzoostat&view=disqus\" class=\"btn btn-small\"><i class=\"icon-comments-2\" title=\"$title\"></i>$title</a>";
$bar->appendButton('Custom', $dhtml, 'list');

JToolBarHelper::divider();
JToolBarHelper::divider();
}

$bar = JToolBar::getInstance('toolbar');
$title = JText::_('Социальные сети');
$dhtml = "<a href=\"/administrator/index.php?option=com_myjbzoostat&view=social\" class=\"btn btn-small\"><i class=\"icon-tree\" title=\"$title\"></i>$title</a>";
$bar->appendButton('Custom', $dhtml, 'list');


JToolBarHelper::divider();
JToolBarHelper::preferences('com_myjbzoostat');

$bar = JToolBar::getInstance('toolbar');
$title = JText::_('Отчет');
Expand Down
17 changes: 17 additions & 0 deletions views/autors/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,23 @@
defined( '_JEXEC' ) or die; // No direct access
?>
<?php

$checkJBZooSEF = JBModelConfig::model()->getGroup('config.sef');
$JBZooSEFenabled = $checkJBZooSEF->get('enabled');
$JBZooSEFfix_item = $checkJBZooSEF->get('fix_item');
$JBZooSEFitem_alias_id = $checkJBZooSEF->get('item_alias_id');
$JBZooSEFfix_category_id = $checkJBZooSEF->get('fix_category_id');
$JBZooSEFfix_category = $checkJBZooSEF->get('fix_category');
$JBZooSEFcategory_alias_id = $checkJBZooSEF->get('category_alias_id');
$JBZooSEFfix_feed = $checkJBZooSEF->get('fix_feed');
$JBZooSEFredirect = $checkJBZooSEF->get('redirect');
$JBZooSEFfix_canonical = $checkJBZooSEF->get('fix_canonical');
$JBZooSEFparse_priority = $checkJBZooSEF->get('parse_priority');
$JBZooSEFcanonical_redirect = $checkJBZooSEF->get('canonical_redirect');
$JBZooSEFzoo_route_caching = $checkJBZooSEF->get('zoo_route_caching');



require_once JPATH_ADMINISTRATOR . '/components/com_myjbzoostat/elements/paramsetc.php';
$document->addStyleSheet(JUri::root().'administrator/components/com_myjbzoostat/assets/css/autors.css');

Expand Down
17 changes: 10 additions & 7 deletions views/autors/view.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ protected function _setToolBar()
if (JComponentHelper::isEnabled('com_zoo') == '1') { $bar->appendButton('Custom', $dhtml, 'list'); }



JToolBarHelper::divider();

$bar = JToolBar::getInstance('toolbar');
Expand All @@ -93,22 +94,24 @@ protected function _setToolBar()
if (JComponentHelper::isEnabled('com_zoo') == '1') { $bar->appendButton('Custom', $dhtml, 'list'); }



JToolBarHelper::divider();

$bar = JToolBar::getInstance('toolbar');
$title = JText::_('Disqus');
$dhtml = "<a href=\"/administrator/index.php?option=com_myjbzoostat&view=disqus\" class=\"btn btn-small\"><i class=\"icon-comments-2\" title=\"$title\"></i>$title</a>";
$bar->appendButton('Custom', $dhtml, 'list');
if (version_compare(PHP_VERSION, '5.5.30') >= 0)
{
$bar = JToolBar::getInstance('toolbar');
$title = JText::_('Disqus');
$dhtml = "<a href=\"/administrator/index.php?option=com_myjbzoostat&view=disqus\" class=\"btn btn-small\"><i class=\"icon-comments-2\" title=\"$title\"></i>$title</a>";
$bar->appendButton('Custom', $dhtml, 'list');

JToolBarHelper::divider();
JToolBarHelper::divider();
}

$bar = JToolBar::getInstance('toolbar');
$title = JText::_('Социальные сети');
$dhtml = "<a href=\"/administrator/index.php?option=com_myjbzoostat&view=social\" class=\"btn btn-small\"><i class=\"icon-tree\" title=\"$title\"></i>$title</a>";
$bar->appendButton('Custom', $dhtml, 'list');

JToolBarHelper::divider();
JToolBarHelper::preferences('com_myjbzoostat');

$bar = JToolBar::getInstance('toolbar');
$title = JText::_('Отчет');
Expand Down
30 changes: 29 additions & 1 deletion views/disqus/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,27 @@
// error_reporting(E_ALL);
/** @var $this MyjbzoostatViewAutors */
defined( '_JEXEC' ) or die; // No direct access

$checkJBZooSEF = JBModelConfig::model()->getGroup('config.sef');
$JBZooSEFenabled = $checkJBZooSEF->get('enabled');
$JBZooSEFfix_item = $checkJBZooSEF->get('fix_item');
$JBZooSEFitem_alias_id = $checkJBZooSEF->get('item_alias_id');
$JBZooSEFfix_category_id = $checkJBZooSEF->get('fix_category_id');
$JBZooSEFfix_category = $checkJBZooSEF->get('fix_category');
$JBZooSEFcategory_alias_id = $checkJBZooSEF->get('category_alias_id');
$JBZooSEFfix_feed = $checkJBZooSEF->get('fix_feed');
$JBZooSEFredirect = $checkJBZooSEF->get('redirect');
$JBZooSEFfix_canonical = $checkJBZooSEF->get('fix_canonical');
$JBZooSEFparse_priority = $checkJBZooSEF->get('parse_priority');
$JBZooSEFcanonical_redirect = $checkJBZooSEF->get('canonical_redirect');
$JBZooSEFzoo_route_caching = $checkJBZooSEF->get('zoo_route_caching');


if (version_compare(PHP_VERSION, '5.5.30') >= 0)
{
die('Вам нужно обновить PHP до ' . '5.5.30' . ' или выше, чтобы использовать Disqus!');
}

require_once JPATH_ADMINISTRATOR . '/components/com_myjbzoostat/elements/paramsetc.php';
require_once JPATH_ADMINISTRATOR . '/components/com_myjbzoostat/vendor/autoload.php'; // composer autoload.php
// require_once '/../../../vendor/autoload.php'; // composer autoload.php
Expand Down Expand Up @@ -875,7 +896,14 @@ function (isConfirm) {
$Discreated_by = $Disitem->created_by;
$userauthor = JFactory::getUser($Discreated_by);
$userauthor = $userauthor->name;
$myurltosite = JRoute::_($app->jbrouter->externalItem($Disitem, false), false, 2);

if ($JBZooSEFenabled == 1 && $JBZooSEFfix_item == 1) {
$myurltosite = JRoute::_($app->jbrouter->externalItem($Disitem, false), false, 2);
$myurltosite = str_replace('/item/','/',$myurltosite);
}
else {
$myurltosite = JRoute::_($app->jbrouter->externalItem($Disitem, false), false, 2);
}

echo "</tr>";

Expand Down
17 changes: 9 additions & 8 deletions views/disqus/view.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,23 +92,24 @@ protected function _setToolBar()
if (JComponentHelper::isEnabled('com_zoo') == '1') { $bar->appendButton('Custom', $dhtml, 'list'); }



JToolBarHelper::divider();

$bar = JToolBar::getInstance('toolbar');
$title = JText::_('Disqus');
$dhtml = "<a href=\"/administrator/index.php?option=com_myjbzoostat&view=disqus\" class=\"btn btn-small\"><i class=\"icon-comments-2\" title=\"$title\"></i>$title</a>";
$bar->appendButton('Custom', $dhtml, 'list');
if (version_compare(PHP_VERSION, '5.5.30') >= 0)
{
$bar = JToolBar::getInstance('toolbar');
$title = JText::_('Disqus');
$dhtml = "<a href=\"/administrator/index.php?option=com_myjbzoostat&view=disqus\" class=\"btn btn-small\"><i class=\"icon-comments-2\" title=\"$title\"></i>$title</a>";
$bar->appendButton('Custom', $dhtml, 'list');

JToolBarHelper::divider();
JToolBarHelper::divider();
}

$bar = JToolBar::getInstance('toolbar');
$title = JText::_('Социальные сети');
$dhtml = "<a href=\"/administrator/index.php?option=com_myjbzoostat&view=social\" class=\"btn btn-small\"><i class=\"icon-tree\" title=\"$title\"></i>$title</a>";
$bar->appendButton('Custom', $dhtml, 'list');


JToolBarHelper::divider();
JToolBarHelper::preferences('com_myjbzoostat');

$bar = JToolBar::getInstance('toolbar');
$title = JText::_('Отчет');
Expand Down
15 changes: 15 additions & 0 deletions views/index/tmpl/default.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
<?php
defined( '_JEXEC' ) or die;

$checkJBZooSEF = JBModelConfig::model()->getGroup('config.sef');
$JBZooSEFenabled = $checkJBZooSEF->get('enabled');
$JBZooSEFfix_item = $checkJBZooSEF->get('fix_item');
$JBZooSEFitem_alias_id = $checkJBZooSEF->get('item_alias_id');
$JBZooSEFfix_category_id = $checkJBZooSEF->get('fix_category_id');
$JBZooSEFfix_category = $checkJBZooSEF->get('fix_category');
$JBZooSEFcategory_alias_id = $checkJBZooSEF->get('category_alias_id');
$JBZooSEFfix_feed = $checkJBZooSEF->get('fix_feed');
$JBZooSEFredirect = $checkJBZooSEF->get('redirect');
$JBZooSEFfix_canonical = $checkJBZooSEF->get('fix_canonical');
$JBZooSEFparse_priority = $checkJBZooSEF->get('parse_priority');
$JBZooSEFcanonical_redirect = $checkJBZooSEF->get('canonical_redirect');
$JBZooSEFzoo_route_caching = $checkJBZooSEF->get('zoo_route_caching');


jimport('joomla.html.html.bootstrap');
require_once JPATH_ADMINISTRATOR . '/components/com_myjbzoostat/elements/paramsetc.php';

Expand Down
17 changes: 9 additions & 8 deletions views/index/view.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ protected function _setToolBar()
$dhtml = "<a href=\"/administrator/index.php?option=com_myjbzoostat&view=reportauthors\" class=\"btn btn-small\"><i class=\"icon-users\" title=\"$title\"></i>$title</a>";
if (JComponentHelper::isEnabled('com_zoo') == '1') { $bar->appendButton('Custom', $dhtml, 'list'); }


JToolBarHelper::divider();

$bar = JToolBar::getInstance('toolbar');
Expand All @@ -96,20 +95,22 @@ protected function _setToolBar()

JToolBarHelper::divider();

$bar = JToolBar::getInstance('toolbar');
$title = JText::_('Disqus');
$dhtml = "<a href=\"/administrator/index.php?option=com_myjbzoostat&view=disqus\" class=\"btn btn-small\"><i class=\"icon-comments-2\" title=\"$title\"></i>$title</a>";
$bar->appendButton('Custom', $dhtml, 'list');
if (version_compare(PHP_VERSION, '5.5.30') >= 0)
{
$bar = JToolBar::getInstance('toolbar');
$title = JText::_('Disqus');
$dhtml = "<a href=\"/administrator/index.php?option=com_myjbzoostat&view=disqus\" class=\"btn btn-small\"><i class=\"icon-comments-2\" title=\"$title\"></i>$title</a>";
$bar->appendButton('Custom', $dhtml, 'list');

JToolBarHelper::divider();
JToolBarHelper::divider();
}

$bar = JToolBar::getInstance('toolbar');
$title = JText::_('Социальные сети');
$dhtml = "<a href=\"/administrator/index.php?option=com_myjbzoostat&view=social\" class=\"btn btn-small\"><i class=\"icon-tree\" title=\"$title\"></i>$title</a>";
$bar->appendButton('Custom', $dhtml, 'list');


JToolBarHelper::divider();
JToolBarHelper::preferences('com_myjbzoostat');

$bar = JToolBar::getInstance('toolbar');
$title = JText::_('Отчет');
Expand Down
Loading

0 comments on commit bca07ff

Please sign in to comment.