Новости Joomla

0 Пользователей и 1 Гость просматривают эту тему.
  • 2 Ответов
  • 1193 Просмотров
*

Afman

  • Осваиваюсь на форуме
  • 38
  • 1 / 0
Не работает меню off canvas
« : 19.09.2018, 12:49:20 »
Здравствуйте, форумчане!
Обнаружил, что при установке и включении плагина Content - ContentAds,  для размещения рекламы в теле статей, перестает открываться меню off canvas с главной сайта (шаблон helix, Joomla 3.8.10). При клике на иконку меню в строке браузера к url добавляется #. При установке других аналогичных плагинов, таких как: DC Google Ads, AdSense Elite, возникает такая же ситуация. При этом, из других категорий и материалов меню мобильной навигации работает исправно. Подскажите пожалуйста, где "собака зарыта", как исправить?

PS. В данный момент вышеуказанный плагин отключен, поэтому off canvas работает.
*

draff

  • Гуру
  • 5803
  • 434 / 7
  • ищу работу
Re: Не работает меню off canvas
« Ответ #1 : 19.09.2018, 13:21:27 »
В консоли есть ошибки ? Вероятнее всего конфликт яваскриптов.
*

Afman

  • Осваиваюсь на форуме
  • 38
  • 1 / 0
Re: Не работает меню off canvas
« Ответ #2 : 19.09.2018, 14:33:15 »
Цитировать
В консоли есть ошибки ? Вероятнее всего конфликт яваскриптов.

Notice: Only variables should be assigned by reference in /var/www/u0042298/data/www/astrofactor.ru/plugins/content/contentads/contentads.php on line 16 Notice: Only variables should be assigned by reference in /var/www/u0042298/data/www/astrofactor.ru/plugins/content/contentads/contentads.php on line 123 Notice: Only variables should be assigned by reference in /var/www/u0042298/data/www/astrofactor.ru/plugins/content/contentads/contentads.php on line 57 Notice: Only variables should be assigned by reference in /var/www/u0042298/data/www/astrofactor.ru/plugins/content/contentads/contentads.php on line 123 Notice: Only variables should be assigned by reference in /var/www/u0042298/data/www/astrofactor.ru/plugins/content/contentads/contentads.php on line 16 Notice: Only variables should be assigned by reference in /var/www/u0042298/data/www/astrofactor.ru/plugins/content/contentads/contentads.php on line 123 Notice: Only variables should be assigned by reference in /var/www/u0042298/data/www/astrofactor.ru/plugins/content/contentads/contentads.php on line 57 Notice: Only variables should be assigned by reference in /var/www/u0042298/data/www/astrofactor.ru/plugins/content/contentads/contentads.php on line 123 Notice: Only variables should be assigned by reference in /var/www/u0042298/data/www/astrofactor.ru/plugins/content/contentads/contentads.php on line 16 Notice: Only variables should be assigned by reference in /var/www/u0042298/data/www/astrofactor.ru/plugins/content/contentads/contentads.php on line 123 Notice: Only variables should be assigned by reference in /var/www/u0042298/data/www/astrofactor.ru/plugins/content/contentads/contentads.php on line 57 Notice: Only variables should be assigned by reference in /var/www/u0042298/data/www/astrofactor.ru/plugins/content/contentads/contentads.php on line 123 Notice: Only variables should be assigned by reference in /var/www/u0042298/data/www/astrofactor.ru/plugins/content/contentads/contentads.php on line 16 Notice: Only variables should be assigned by reference in /var/www/u0042298/data/www/astrofactor.ru/plugins/content/contentads/contentads.php on line 123 Notice: Only variables should be assigned by reference in /var/www/u0042298/data/www/astrofactor.ru/plugins/content/contentads/contentads.php on line 57 Notice: Only variables should be assigned by reference in /var/www/u0042298/data/www/astrofactor.ru/plugins/content/contentads/contentads.php on line 123

Вот код плагина

Код
<?php
/**
 * @version $Id: plg_content_contentads.php 1.0.4 for joomla 2.5+
 * [member=126442]copyright[/member] Juan Padial
 * @license GNU/GPLv3,
 * @author Juan - http://www.shikle.com
 */
defined('_JEXEC') or die('Restricted access');
jimport('joomla.utilities.arrayhelper');
class plgContentContentads extends JPlugin {
function plgContentScontent(&$subject,$config)
{
parent::__construct($subject,$config);
}
    function onContentBeforeDisplay($context,&$row,&$params,$page=0) {
       $app = &JFactory::getApplication();
        if (!$app->isSite() || $this->noads($row)) {
            return;
        } else {
           $ads = $this->showContent('before_content_ads', true);
           $css = $this->params->def('cssb','');
           if($ads) return $this->theAd($ads,$css); else return '';
        }
    }
    function onContentPrepare($context, $row, &$params, $page = 0) {
        if ((JRequest :: getVar('view')) != 'article' || $context!='com_content.article' || $this->noads($row)) {
            return;
        }
        $topAds = $this->params->def('content_top_ads','');
        if ($topAds) {
              $css = $this->params->def('csst','');
              $row->text = $this->theAd($topAds,$css).$row->text;
        }
        $insideAds = $this->params->def('content_inside_ads','');
        if ($insideAds) {
            $css = $this->params->def('cssin','');
            (int) $position = $this->params->def('in_position',3);
            $arraytext = explode('</p>',$row->text);
            count($arraytext)<$position?$position=count($arraytext):'';
            if(!empty($arraytext)){
               array_splice($arraytext,$position,0,$this->theAd($insideAds,$css));
               $output = '';
               foreach($arraytext as $key=>$value){
                 $output .= $value;
               }
               $row->text = $output;
            }
        }
        $bottomAds = $this->params->def('content_bottom_ads');
        if ($bottomAds) {
            $css = $this->params->def('cssbo','');
            $row->text .= $this->theAd($bottomAds,$css);
        }
    }

    function onContentAfterDisplay($context, &$row, &$params, $page = 0) {
       $app = &JFactory::getApplication();
        if (!$app->isSite() || $this->noads($row)) {
            return;
        } else {
           $ads = $this->showContent('after_content_ads', true);
           $css = $this->params->def('cssa','');
           $css != '' ? $css = ' style="'.$css.'"':'';
           if($ads) return '<div'.$css.'>'.$ads.'</div>';
        }
        return '';
    }
    function showContent($paramName, $isCount) {
        JRequest::getVar('layout')=='blog'?$isblog=true:$isblog=false;
        if (!$isblog) {
            return $this->params->def($paramName);
        } else {
            $blogPageCount = JRequest :: getVar('blogPageAdsCount');
            if (!isset($blogPageCount)) {
                $blogPageCount = 0;
            }
            if ($isCount) {
                $blogPageCount++;
                JRequest :: setVar('blogPageAdsCount', $blogPageCount);
            }
            $adCount = (int) $this->params->def('blog_page_ads_count');

            if ($blogPageCount <= $adCount) {
                if ($isblog && $blogPageCount <= 1) {
                    return $this->params->def($paramName);
                } else {
                    return $this->params->def($paramName);
                }
            }
        }
    }

   function theAd($ads,$css){
        $css != '' ? $css = ' style="'.$css.'"':'';
        return '<div'.$css.'>'.$ads.'</div>';
   }
   function exclude($paramName,$value,$tointeger=true) {
        $excludearray = explode(',', trim($this->params->def($paramName)));
        $tointeger?JArrayHelper::toInteger($excludearray):'';
        if(isset($value) && in_array($value, $excludearray, false)) {
            return true;
        } else {
            return false;
        }
    }
    function noads(&$row) {
        if(!is_object($row)) return;
        $onlyGuest = $this->params->def('only_guest');
        if ($onlyGuest) {
            $user = & JFactory::getUser();
            if(!$user->guest) {
                return true;
            }
        }
        $createdBy = $row->created_by;
        $authors = $this->params->def('only_authors');
        if (isset($authors) && $authors!='') {
            $authorsArray = explode(',', $authors);
            if (!empty($authorsArray) && $authors!='' && !in_array($createdBy, $authorsArray, false)) {
                return true;
            }
        }
        $app = & JFactory::getApplication();
        $template = $app->getTemplate();
        $template = strtolower($template);
        $templates = $this->params->def('only_templates');
        $templatesArray = explode(',', $templates);
        if (!empty($templatesArray) && $templates!='' && !in_array($template, $templatesArray)) {
            return true;
        }
        $ip = $this->GetUserIp();
        $ignore = $this->exclude('block_ips',$ip,false);
        if ($ignore) {
            return $ignore;
        }
        $ignore = $this->exclude('exclude_article_ids', $row->id);
        if ($ignore) {
            return $ignore;
        }
        $ignore = $this->exclude('exclude_category_ids', $row->catid);
        if ($ignore) {
            return $ignore;
        }
    }
//function from CBreCaptcha
function GetUserIp() {
   $ip = "";
   if(isset($_SERVER)) {
       if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
         $ip=$_SERVER['HTTP_CLIENT_IP'];
       } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
         $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
       } else {
         $ip=$_SERVER['REMOTE_ADDR'];
       }
    } else {
       if ( getenv( 'HTTP_CLIENT_IP' ) ) {
          $ip = getenv( 'HTTP_CLIENT_IP' );
       } elseif ( getenv( 'HTTP_X_FORWARDED_FOR' ) ) {
          $ip = getenv( 'HTTP_X_FORWARDED_FOR' );
       } else {
          $ip = getenv( 'REMOTE_ADDR' );
        }
    }
    // In some weird cases the ip address returned is repeated twice separated by comma
    if(strstr($ip,',')){
      $ip = array_shift(explode(',',$ip));
    }
   return $ip;
 }
}
?>

« Последнее редактирование: 19.09.2018, 14:39:16 от Afman »
Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться
 

Не грузится страница админки, после смены хостинга. Но сам сайт работает

Автор Janitor

Ответов: 2
Просмотров: 705
Последний ответ 02.07.2023, 10:37:01
от Janitor
После обновления до Joomla 3.7 в админке в меню "Компоненты" пропали пункты

Автор lolitma3

Ответов: 39
Просмотров: 11611
Последний ответ 15.06.2023, 11:55:16
от Victor333
Вывод поля поиска первым пунктом в меню

Автор Mick_20

Ответов: 3
Просмотров: 584
Последний ответ 03.02.2023, 13:02:46
от Mick_20
Не работает после переноса на другой хостинг

Автор Ravil

Ответов: 2
Просмотров: 731
Последний ответ 05.10.2022, 07:58:32
от wishlight
Сайт работает на PHP 7.2 /Joomla 3.9 ---- Akeeba Backup 8.1.10 не запускается

Автор Validator

Ответов: 9
Просмотров: 1049
Последний ответ 21.09.2022, 19:09:17
от Validator