Новости Joomla

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

cher68

  • Осваиваюсь на форуме
  • 15
  • 0 / 0
Сайт на Joomla 3.10. Перешел с PHP 7.4 на PHP 8.1 и получаю на сайте, на некоторых! страницах, сообщение:
Warning: Undefined property: stdClass::$contactid in /home/f/funnystudy/public_html/templates/behealthy7/library/Artx/Content/SingleArticle.php on line 42

Код SingleArticle.php:

Код
<?php
defined('_JEXEC') or die;

Artx::load("Artx_Content_Item");

class ArtxContentSingleArticle extends ArtxContentItem
{
    public $print;

    public $toc;

    public $intro;

    public $text;

    public function __construct($component, $componentParams, $article, $articleParams, $properties)
    {
        parent::__construct($component, $componentParams, $article, $articleParams);
        $this->print = isset($properties['print'])? $properties['print'] : '';
        $this->pageHeading = $this->_componentParams->get('show_page_heading', 1)
                               ? $this->_componentParams->get('page_heading') : '';
        $this->titleLink = $this->_articleParams->get('link_titles') && !empty($this->_article->readmore_link)
                             ? $this->_article->readmore_link : '';
        $this->emailIconVisible = $this->emailIconVisible && !$this->print;
        $this->editIconVisible = $this->editIconVisible && !$this->print;
        $this->categoryLink = $this->_articleParams->get('link_category') && $this->_article->catslug
                                ? JRoute::_(ContentHelperRoute::getCategoryRoute($this->_article->catslug))
                                : '';
        $this->category = $this->_articleParams->get('show_category')? $this->_article->category_title : '';
        $this->categoryLink = $this->_articleParams->get('link_category') && $this->_article->catslug
                                ? JRoute::_(ContentHelperRoute::getCategoryRoute($this->_article->catslug))
                                : '';
        $this->parentCategory = $this->_articleParams->get('show_parent_category') && $this->_article->parent_slug != '1:root'
                                  ? $this->_article->parent_title : '';
        $this->parentCategoryLink = $this->_articleParams->get('link_parent_category') && $this->_article->parent_slug
                                      ? JRoute::_(ContentHelperRoute::getCategoryRoute($this->_article->parent_slug))
                                      : '';
        $this->author = $this->_articleParams->get('show_author') && !empty($this->_article->author)
                          ? ($this->_article->created_by_alias ? $this->_article->created_by_alias : $this->_article->author)
                          : '';
        if (strlen($this->author) && $this->_articleParams->get('link_author')) {
            $needle = 'index.php?option=com_contact&view=contact&id=' . $this->_article->contactid;
            $menu = JFactory::getApplication()->getMenu();
            $item = $menu->getItems('link', $needle, true);
            $this->authorLink = !empty($item)? $needle . '&Itemid=' . $item->id : $needle;
        } else
            $this->authorLink = '';
        $this->toc = isset($this->_article->toc)? $this->_article->toc : '';
        $this->text = $this->_articleParams->get('access-view')? $this->_article->text : '';
        $user = JFactory::getUser();
        $this->introVisible = !$this->_articleParams->get('access-view') && $this->_articleParams->get('show_noauth') && $user->get('guest');
        $this->intro = $this->_article->introtext;
        if (!$this->_articleParams->get('access-view') && $this->_articleParams->get('show_noauth') && $user->get('guest')
            && $this->_articleParams->get('show_readmore') && $this->_article->fulltext != null)
        {
            $attribs = json_decode($this->_article->attribs);
            if ($attribs->alternative_readmore == null)
                $this->readmore = JText::_('COM_CONTENT_REGISTER_TO_READ_MORE');
            elseif ($this->readmore = $this->_article->alternative_readmore) {
                if ($this->_articleParams->get('show_readmore_title', 0)!= 0)
                    $this->readmore .= JHtml::_('string.truncate', ($this->_article->title), $this->_articleParams->get('readmore_limit'));
            } elseif ($this->_articleParams->get('show_readmore_title', 0) == 0)
                $this->readmore = JText::sprintf('COM_CONTENT_READ_MORE_TITLE');
            else
                $this->readmore = JText::_('COM_CONTENT_READ_MORE')
                                    . JHtml::_('string.truncate', $this->_article->title,
                                               $this->_articleParams->get('readmore_limit'));
            $link = new JURI(JRoute::_('index.php?option=com_users&view=login'));
            $this->readmoreLink = $link->__toString();
        } else {
            $this->readmore = '';
            $this->readmoreLink = '';
        }
        $this->paginationPosition = (isset($this->_article->pagination) && $this->_article->pagination && isset($this->_article->paginationposition))
            ? (($this->_article->paginationposition ? 'below' : 'above'). ' ' . ($this->_article->paginationrelative ? 'full article' : 'text'))
            : '';
        $this->showLinks = isset($this->_article->urls) && is_string($this->_article->urls) && !empty($this->_article->urls);
    }

    public function printIcon()
    {
        $text =  JHTML::_($this->print ? 'icon.print_screen' : 'icon.print_popup', $this->_article, $this->_articleParams);
        if ($this->showIcons) {
            $text = str_replace('&#160;' . JText::_('JGLOBAL_PRINT'). '&#160;', '', $text);
            $text = str_replace('icon-print', 'fs-postprinticon', $text);
        }
        return $text;
    }

    public function toc($toc)
    {
        return '<div class="fs-article">' . $toc . '</div>';
    }

    public function intro($intro)
    {
        return '<div class="fs-article">' . $intro . '</div>';
    }

    public function text($text)
    {
        return '<div class="fs-article">' . $text . '</div>';
    }

    public function pagination() {
        $count = preg_match_all('/<a[^>]*>.*?<\/a>/', $this->_article->pagination, $matches);
        $content = '';
        if (false !== $count  && $count > 0){
            $content = '<div class="fs-pager">';
            foreach($matches[0] as $value){
                $content .= $value;
            }
            $content .= '</div>';
        }
        return $content ? $content : $this->_article->pagination;
    }
}
Строка 42: $needle = 'index.php?option=com_contact&view=contact&id=' . $this->_article->contactid;
Я в PHP мало, что понимаю. Может быть кто-нибудь подскажет в чем дело?
*

marksetter

  • Завсегдатай
  • 1045
  • 40 / 0
ну так это простотпредупреждение
отключите их и все
если все остальное работает
индивидуальная помощь: @SetAlexx
*

cher68

  • Осваиваюсь на форуме
  • 15
  • 0 / 0
ну так это простотпредупреждение
отключите их и все
если все остальное работает

Не хотелось бы отключать предупреждения, мало ли.
*

beliyadm

  • Легенда
  • 9758
  • 1664 / 66
  • Севастополь, Россия
Не хотелось бы отключать предупреждения, мало ли.
Ничего страшного не будет от слова совсем. Тем более что этот кусок кода отвечает за вывод ссылки на автора статьи, что крайне маловероятно вам вообще требуется
Все истины, которые я хочу вам изложить, — бесстыдная ложь. Сделать всё хорошо
TLG: @Beliyadm
Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться
 

Как сделать кликабельный телефон на сайте

Автор kit_andrei

Ответов: 6
Просмотров: 4501
Последний ответ 02.07.2022, 10:13:46
от marksetter
Выключить уведомления о новых пользователях на сайте

Автор romagromov

Ответов: 0
Просмотров: 468
Последний ответ 18.06.2022, 22:01:32
от romagromov
Как исправить ошибку shell_exec() has been disabled for security reasons in?

Автор sergspb

Ответов: 4
Просмотров: 1198
Последний ответ 15.02.2022, 22:12:55
от Avalon
Не подгружаются картинки на сайте - хостер развел руки

Автор Zegeberg

Ответов: 5
Просмотров: 736
Последний ответ 14.11.2021, 10:47:59
от ProtectYourSite
Как решить эту ошибку в Joomla?

Автор Dikey

Ответов: 2
Просмотров: 626
Последний ответ 20.08.2021, 08:39:39
от sivers