%PDF- %PDF-
Server IP : 37.220.80.31 / Your IP : 18.222.41.52 Web Server : Apache/2.4.52 (Ubuntu) System : Linux 3051455-guretool.twc1.net 5.15.0-107-generic #117-Ubuntu SMP Fri Apr 26 12:26:49 UTC 2024 x86_64 User : www-root ( 1010) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/www-root/data/www/dev.artlot24.ru/bitrix/components/bitrix/forum.comments/ |
Upload File : |
<?php if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die(); include_once __DIR__."/base.php"; class CCommentRatings extends CCommentBase { var $arRatings = array(); var $display = array("BEFORE_HEADER" => true, "AFTER_ACTIONS" => false); function OnCommentsDisplayTemplate($output, $arParams, $arResult) { if (empty($arResult["MESSAGES"])) { $GLOBALS["APPLICATION"]->SetAdditionalCSS("/bitrix/components/bitrix/rating.vote/templates/like/popup.css"); $GLOBALS["APPLICATION"]->SetAdditionalCSS("/bitrix/components/bitrix/rating.vote/templates/".$arParams["RATING_TYPE"]."/style.css"); } } function OnPrepareComments($component) { if ($component !== $this->component) { return; } $arResult =& $this->component->arResult; $arMessages =& $arResult['MESSAGES']; $arMessageIDs = array_keys($arMessages); $arRatings = CRatings::GetRatingVoteResult('FORUM_POST', $arMessageIDs); if ($arRatings) { foreach($arRatings as $postID => $arRating) { $this->arRatings[$postID] = $arRating; if (array_key_exists($postID, $arMessages)) $arMessages[$postID]["RATING"] = $arRating; } } } function RatingDisplay($top = true, $commentID, $authorID) { $arParams = &$this->component->arParams; static $arEmptyRating = array( "USER_VOTE" => 0, "USER_HAS_VOTED" => 'N', "TOTAL_VOTES" => 0, "TOTAL_POSITIVE_VOTES" => 0, "TOTAL_NEGATIVE_VOTES" => 0, "TOTAL_VALUE" => 0 ); ob_start(); if ($top) { ?> <div class="review-rating rating_vote_graphic"> <? } else { ?> <span class="rating_vote_text"> <span class="separator"></span> <? } $arRatingParams = Array( "ENTITY_TYPE_ID" => "FORUM_POST", "ENTITY_ID" => $commentID, "OWNER_ID" => $authorID, "PATH_TO_USER_PROFILE" => $arParams["~URL_TEMPLATES_PROFILE_VIEW"], "AJAX_MODE" => "N" ); if (isset($this->arRatings[$commentID])) $arRating = $this->arRatings[$commentID]; else $arRating = $arEmptyRating; $arRatingParams = array_merge($arRatingParams, $arRating); $GLOBALS["APPLICATION"]->IncludeComponent("bitrix:rating.vote", $arParams["RATING_TYPE"], $arRatingParams, $this->component, array("HIDE_ICONS" => "Y")); if ($top) { ?> </div> <? } else { ?> </span> <? } return ob_get_clean(); } function OnCommentDisplay($arComment) { $arReturn = array(); foreach ($this->display as $display => $graphic) { $arReturn[] = array('DISPLAY' => $display, 'SORT' => '50', 'TEXT' => $this->RatingDisplay($graphic, $arComment['ID'], $arComment['AUTHOR_ID'])); } return $arReturn; } } ?>