示例#1
0
<?

global $APPLICATION;
global $DB;

require_once($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_before.php");
require_once($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/prmedia.treelikecomments/include.php");

require($_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/include/prolog_admin_after.php");

global $CACHE_MANAGER;
global $USER;

$obComment = new CTreelikeComments;

if ($obComment->IsModerator())
{
	$action = trim($_GET['action']);
	$id_element = intval($_GET['id']);

	if (!isset($action) || !isset($id_element))
	{
		LocalRedirect('/bitrix/admin/tc_comment_list.php?result=error');
	}

	if ($action == 'activate' && isset($id_element))
	{
		$DB->query("UPDATE prmedia_treelike_comments SET ACTIVATED = 1 WHERE ID = $id_element");

		$objectId = $obComment->GetObjectData($id_element);
		@$CACHE_MANAGER->ClearByTag("prmedia_treelike_comments_" . $objectId);
示例#2
0

$lAdmin->AddGroupActionTable(Array(
  "delete"=>GetMessage("MAIN_ADMIN_LIST_DELETE"), // удалить выбранные элементы
  ));


$lAdmin->AddAdminContextMenu($aContext);
$lAdmin->CheckListMode();

$APPLICATION->SetTitle(GetMessage("TC_TITLE"));
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_admin_after.php");

$get_right_groups = new CTreelikeComments;

if(!$get_right_groups->IsModerator())
{
    echo CAdminMessage::ShowMessage(GetMessage("TC_ERROR_ACCESS"));
}
else
{
    ?>

    <form name="form2" method="GET" action="<?echo $APPLICATION->GetCurPage()?>?">
    <?$filter->Begin();?>
    <tr>
    	<td nowrap><?php 
echo GetMessage("TC_ID");
?>
:</td>
    	<td nowrap><input type="text" name="find_id" value="<?echo htmlspecialchars($find_id)?>" size="10"></td>
示例#3
0
文件: component.php 项目: ASDAFF/mp
		"CODE" => $restrictedProperty
	);
	$rsProperty = CIBlockElement::GetProperty($iblockId, $arParams['OBJECT_ID'], array(), $arFilter);
	if ($arProperty = $rsProperty->Fetch())
	{
		if ($arProperty["VALUE"])
		{
			$arResult['COMMENT_NOT_ALLOWED'] = true;
			$arResult['CAN_COMMENT'] = "N";
		}
	}
}

if($arParams['CACHE_TYPE'] == "A" || $arParams['CACHE_TYPE'] == "Y")
{
	$cache_id = serialize(array($arParams['OBJECT_ID'], ($comment->IsModerator()?true:false), ($GLOBALS['USER']->IsAuthorized()?true:false)));
	$cache_path = "/".SITE_ID.'/'.str_replace(':', '/', $this->GetName())."/".$arParams["OBJECT_ID"];
}

if(!$USER->IsAuthorized())
{
	$arResult['CURRENT_USER'] = 0;
	if($arResult['NON_AUTHORIZED_USER_CAN_COMMENT'] == 'Y')
	{
		$arResult['CAN_COMMENT'] = 'Y';
		if ($arResult["CAPTCHA_TYPE"] == "CAPTCHA_BITRIX")
		{
			$arResult["CAPTCHA_CODE"] = htmlspecialchars($APPLICATION->CaptchaGetCode(), ENT_COMPAT | ENT_HTML401, SITE_CHARSET);
		}
		else if($arResult["CAPTCHA_TYPE"] == "ROBOT")
		{
示例#4
0
文件: component.php 项目: ASDAFF/mp
CJSCore::Init("jquery");

// caching params
$arParams['IS_ANONYM'] = intval(CUser::GetID()) ? true : false;
$cache_id = md5(serialize($arParams));
$cache_dir = "/".SITE_ID.'/'.str_replace(':', '/', $this->GetName())."/".$arParams["OBJECT_ID"];

// caching
if($this->StartResultCache(false, $cache_id, $cache_dir))
{
	$CACHE_MANAGER->RegisterTag("bestcomments_".$arParams["OBJECT_ID"]);

	$arResult['ALLOW_RATING'] = $arParams['ALLOW_RATING'];
	$arResult['SHOW_USERPIC'] = $arParams['SHOW_USERPIC'];
	$arResult['SHOW_DATE'] = $arParams['SHOW_DATE'];
	$arResult['GROUPS'] = CTreelikeComments::IsModerator();
	$arResult['CURRENT_USER'] = $USER->IsAuthorized() ? $USER->GetID() : 0;

	$arItems = array();
	$arIDs = array();

	// Getting comments List
	$arFilter = array(
		"OBJECT_ID_NUMBER" => $arParams["OBJECT_ID"],
		"SITE_ID" => SITE_ID,
	);

	$resComm = CTreelikeComments::GetList(array(), $arFilter);
	while($arComm = $resComm->GetNext()):
		$arIDs[] = $arComm["ID"];
		$arItems[$arComm["ID"]] = $arComm;