Неограничен текст темы

CrazyCort

Проверенные
Сообщения
397
Реакции
201
Баллы
5,555
Как можно сделать неограничен текст темы,только для администратора?
 
Феерический даун, ну ладно
User:
Код:
protected function _verifyMessageLikeContent(&$message, $null, $fieldName)
    {
        $maxLength = $this->getOption(self::OPTION_MESSAGE_MAX_LENGTH);
        if ($maxLength && utf8_strlen($message) > $maxLength)
        {
            $this->error(new XenForo_Phrase('please_enter_message_with_no_more_than_x_characters', array('count' => $maxLength)), $fieldName);
            return false;
        }

        return true;
    }
Editor:
Код:
public function convertEditorHtmlToBbCode($messageTextHtml, XenForo_Input $input, $htmlCharacterLimit = -1)
    {
        if ($htmlCharacterLimit < 0)
        {
            $htmlCharacterLimit = 4 * XenForo_Application::get('options')->messageMaxLength;
            // quadruple the limit as HTML can be a lot more verbose
        }

        if ($htmlCharacterLimit && utf8_strlen($messageTextHtml) > $htmlCharacterLimit)
        {
            throw new XenForo_Exception(new XenForo_Phrase('submitted_message_is_too_long_to_be_processed'), true);
        }

        $options = array();
        $requestPaths = XenForo_Application::get('requestPaths');
        $options['baseUrl'] = $requestPaths['fullBasePath'];

        $relativeResolver = $input->filterSingle('_xfRelativeResolver', XenForo_Input::STRING);
        if ($relativeResolver && isset($_SERVER['HTTP_USER_AGENT']))
        {
            if (preg_match('#Firefox/([0-9]+)\.([0-9]+)\.([0-9]+)#i', $_SERVER['HTTP_USER_AGENT'], $match))
            {
                // FF versions sometime before 3.6.12 have an issue with respecting the base tag of the editor,
                // 3.6.8 is a known version that has problems
                $useResolver = ($match[1] <= 3 && $match[2] <= 6 && $match[3] <= 8);
            }
            else
            {
                $useResolver = false;
            }

            if ($useResolver)
            {
                // take off query string and then up to the last directory
                $relativeResolver = preg_replace('/\?.*$/', '', $relativeResolver);
                $relativeResolver = preg_replace('#/[^/]+$#', '', $relativeResolver);

                $options['baseUrl'] = $relativeResolver;
            }
        }

        $rendered = XenForo_Html_Renderer_BbCode::renderFromHtml($messageTextHtml, $options);
        return trim(XenForo_Input::cleanString($rendered));
    }
DiscussionMessage:
Код:
protected function _checkMessageValidity()
    {
        $message = $this->get('message');

        $maxLength = $this->getOption(self::OPTION_MAX_MESSAGE_LENGTH);
        if ($maxLength && utf8_strlen($message) > $maxLength)
        {
            $this->error(new XenForo_Phrase('please_enter_message_with_no_more_than_x_characters', array('count' => $maxLength)), 'message');
        }
        else
        {
            $maxImages = $this->getOption(self::OPTION_MAX_IMAGES);
            $maxMedia = $this->getOption(self::OPTION_MAX_MEDIA);
            if ($maxImages || $maxMedia)
            {
                $formatter = XenForo_BbCode_Formatter_Base::create('ImageCount', false);
                $parser = XenForo_BbCode_Parser::create($formatter);
                $parser->render($message);

                if ($maxImages && $formatter->getImageCount() > $maxImages)
                {
                    $this->error(new XenForo_Phrase('please_enter_message_with_no_more_than_x_images', array('count' => $maxImages)), 'message');
                }
                if ($maxMedia && $formatter->getMediaCount() > $maxMedia)
                {
                    $this->error(new XenForo_Phrase('please_enter_message_with_no_more_than_x_media', array('count' => $maxMedia)), 'message');
                }
            }
        }
    }
ConversationMessage:
Код:
protected function _checkMessageValidity()
    {
        $message = $this->get('message');

        $maxLength = $this->getOption(self::OPTION_MAX_MESSAGE_LENGTH);
        if ($maxLength && utf8_strlen($message) > $maxLength)
        {
            $this->error(new XenForo_Phrase('please_enter_message_with_no_more_than_x_characters', array('count' => $maxLength)), 'message');
        }
        else
        {
            $maxImages = $this->getOption(self::OPTION_MAX_IMAGES);
            $maxMedia = $this->getOption(self::OPTION_MAX_MEDIA);
            if ($maxImages || $maxMedia)
            {
                /** @var XenForo_BbCode_Formatter_ImageCount $formatter */
                $formatter = XenForo_BbCode_Formatter_Base::create('ImageCount', false);
                $parser = XenForo_BbCode_Parser::create($formatter);
                $parser->render($message);

                if ($maxImages && $formatter->getImageCount() > $maxImages)
                {
                    $this->error(new XenForo_Phrase('please_enter_message_with_no_more_than_x_images', array('count' => $maxImages)), 'message');
                }
                if ($maxMedia && $formatter->getMediaCount() > $maxMedia)
                {
                    $this->error(new XenForo_Phrase('please_enter_message_with_no_more_than_x_media', array('count' => $maxMedia)), 'message');
                }
            }
        }
    }
 
Современный облачный хостинг провайдер | Aéza
Назад
Сверху Снизу