function BanMemberForComment($pfx, $message_id, $member_id, $user_id, $mod, $om, $level, $is_last) { $objResponse = new xajaxResponse(); if (get_uid(false) != $user_id) { return $objResponse; } if (get_uid(false)) { $comm = commune::getCommuneIDByMessageID($message_id); $status = commune::GetUserCommuneRel($comm, get_uid(false)); } if ($status['is_moderator'] == 1 || $status['is_admin'] == 1 || $status['is_author'] == 1 || hasPermissions('communes')) { if ($r = commune::BanMemberForComment($member_id)) { $top = commune::GetTopMessageByAnyOther($message_id, NULL, $mod, FALSE); $top['is_viewed'] = 1; $comment = commune::GetAsThread(NULL, $message_id); $objResponse->assign($pfx . $message_id, 'innerHTML', __commPrntComment($top, $comment, $user_id, $mod, $om, NULL, $level, $is_last)); $sm = new smail(); if ($r == 't') { $comm = commune::GetCommuneByMember($member_id); $sm->CommuneMemberAction($comm['member_user_id'], 'BanMember', $comm); } // else if($r=='f') // $sm->CommuneTopicAction($comment, 'WarnMemberForComment'); } } return $objResponse; }
<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/xajax/commune.common.php"; $xajax->printJavascript('/xajax/'); global $id, $uid, $om, $comm, $top, $page, $session, $message_id, $comment_id, $request, $alert, $action, $user_mod; // Топ-тема должна быть получена заранее. $favs = commune::GetFavorites($uid, $top['id']); $top['last_viewed_time'] = !$uid ? 0 : commune::GetMessageLVT($top['id'], $uid); //print($top['member_is_banned']); //print($user_mod & (commune::MOD_ADMIN | commune::MOD_COMM_AUTHOR | commune::MOD_COMM_MANAGER)); // Дерево сообщений. if (!($thread = commune::GetAsThread($top['theme_id']))) { $thread = array(); } $tree = transformArray2Tree($thread, 'id', 'parent_id', $top['id'], 'SIMPLE'); $is_site_admin = hasPermissions('communes'); if (true) { ?> <?php $aGroup = commune::getGroupById($comm['group_id']); $sGroup = $aGroup['name']; $crumbs = array(); $crumbs[] = array("title" => "Сообщества", "url" => "/commune/"); if ($comm['id'] != commune::COMMUNE_BLOGS_ID) { $crumbs[] = array("title" => $sGroup, "url" => "/commune/?gr={$comm['group_id']}"); } $crumbs[] = array("title" => $comm['name'], "url" => getFriendlyURL('commune_commune', $comm['id'])); $crumbs[] = array("title" => $top['category_name'], "url" => getFriendlyURL('commune_commune', $comm['id']) . "?om=" . (__paramInit("int", "om") ? __paramInit("int", "om") : '0') . '&cat=' . $top['category_id']); ?>