403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /home/bitrix/ext_www/cvetdv.ru/bitrix/modules/blog/lib/integration/socialnetwork/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/cvetdv.ru/bitrix/modules/blog/lib/integration/socialnetwork/logcomment.php
<?php
/**
 * Bitrix Framework
 * @package bitrix
 * @subpackage blog
 * @copyright 2001-2012 Bitrix
 */
namespace Bitrix\Blog\Integration\Socialnetwork;

use Bitrix\Main\Event;
use Bitrix\Main\EventResult;
use Bitrix\Blog\Item\Comment;
use Bitrix\Main\Loader;
use Bitrix\Socialnetwork\CommentAux;
use Bitrix\Socialnetwork\Item\LogIndex;

class LogComment
{
	const EVENT_ID_COMMENT = 'blog_comment';

	public static function getEventIdList()
	{
		return array(
			self::EVENT_ID_COMMENT
		);
	}

	/**
	 * Return content for LogIndex.
	 *
	 * @param Event $event Event from LogIndex::setIndex().
	 * @return EventResult
	 */
	public static function onIndexGetContent(Event $event)
	{
		$result = new EventResult(
			EventResult::UNDEFINED,
			array(),
			'blog'
		);

		$eventId = $event->getParameter('eventId');
		$sourceId = $event->getParameter('sourceId');

		if (!in_array($eventId, self::getEventIdList()))
		{
			return $result;
		}

		$content = "";
		$comment = false;

		if (intval($sourceId) > 0)
		{
			$comment = Comment::getById($sourceId);
		}

		if ($comment)
		{
			$commentFieldList = $comment->getFields();

			if (!($commentAuxProvider = CommentAux\Base::findProvider($commentFieldList)))
			{
				$content .= LogIndex::getUserName($commentFieldList["AUTHOR_ID"])." ";
				$content .= \blogTextParser::killAllTags($commentFieldList["POST_TEXT"]);
			}

			if (!empty($commentFieldList['UF_BLOG_COMMENT_FILE']))
			{
				$fileNameList = LogIndex::getDiskUFFileNameList($commentFieldList['UF_BLOG_COMMENT_FILE']);
				if (!empty($fileNameList))
				{
					$content .= ' '.join(' ', $fileNameList);
				}
			}

			if (!empty($commentFieldList['UF_BLOG_COMM_URL_PRV']))
			{
				$metadata = \Bitrix\Main\UrlPreview\UrlMetadataTable::getRowById($commentFieldList['UF_BLOG_COMM_URL_PRV']);
				if (
					$metadata
					&& isset($metadata['TITLE'])
					&& $metadata['TITLE'] <> ''
				)
				{
					$content .= ' '.$metadata['TITLE'];
				}
			}
		}

		$result = new EventResult(
			EventResult::SUCCESS,
			array(
				'content' => $content,
			),
			'blog'
		);

		return $result;
	}
}


Youez - 2016 - github.com/yon3zu
LinuXploit