本文整理汇总了PHP中projects::DeleteComplains方法的典型用法代码示例。如果您正苦于以下问题:PHP projects::DeleteComplains方法的具体用法?PHP projects::DeleteComplains怎么用?PHP projects::DeleteComplains使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类projects
的用法示例。
在下文中一共展示了projects::DeleteComplains方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: resolveProjects
/**
* Проекты. Утверждение/удаление записи
*
* @param string $stream_id идентификатор потока
* @param int $user_id идентификатор модератора
* @param int $from_id идентификатор пользователя
* @param int $rec_id идентификатор записи
* @param int $rec_type тип записи
* @param int $action действие: 1 - утверждено, 2 - удалено
* @param string $is_sent было ли отправлено уведомление
* @param string $reason причина удаления
*/
function resolveProjects($stream_id = '', $user_id = 0, $from_id = 0, $rec_id = 0, $rec_type = 0, $action = 1, $is_sent = '', $reason = '')
{
$bRet = false;
$sQuery = 'UPDATE moderation SET moder_num = ?i, status = ?i WHERE rec_id = ?i AND rec_type = ?i AND stream_id = ? RETURNING rec_id';
$sRecId = $GLOBALS['DB']->val($sQuery, $this->nResolveCnt, $action, $rec_id, self::MODER_PROJECTS, $stream_id);
if ($sRecId) {
$bRet = true;
$GLOBALS['DB']->update('projects', array('moderator_status' => $user_id), 'id = ?i', $rec_id);
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/projects.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/admin_log.php';
$projects = new projects();
$project = $projects->GetPrjCust($rec_id);
$sObjLink = getFriendlyURL('project', $rec_id);
// лог админских действий
if ($action == 1 && $project['blocked_time']) {
// разблокируем
$projects->UnBlocked($rec_id);
admin_log::addLog(admin_log::OBJ_CODE_PROJ, 10, $from_id, $rec_id, $project['name'], $sObjLink, 0, '', 0, '');
} elseif ($action == 2 && !$project['blocked_time']) {
// блокируем
$sBlockId = $projects->Blocked($rec_id, $reason, 0, $user_id, true);
// Удаляем черновики жалобы
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/drafts.php';
drafts::DeleteDraftByPrjID($rec_id);
$projects->DeleteComplains($rec_id);
// пишем лог админских действий
admin_log::addLog(admin_log::OBJ_CODE_PROJ, 9, $from_id, $rec_id, $project['name'], $sObjLink, 0, '', 0, $reason, $sBlockId);
}
}
return $bRet;
}
示例2: header
<?php
if (!defined('IS_SITE_ADMIN')) {
header('Location: /404.php');
exit;
}
$menu_item = 12;
$prj_obj = new projects();
$projects = $prj_obj->GetComplainPrjs($num_threads, $error, $page, $sort, $search, $admin, $log_pp, $group);
if ($action && $_SESSION['rand'] != $_POST['u_token_key']) {
header('Location: /403.php');
exit;
}
switch ($action) {
case 'delcomplain':
$prj_obj->DeleteComplains(intval($_GET['pid']));
header("Location: /siteadmin/ban-razban/?mode={$mode}" . ($page ? "&p={$page}" : '') . ($search ? "&search={$search}" : '') . ($admin ? "&admin={$admin}" : '') . ($sort ? "&sort={$sort}" : '') . '#p' . $_GET['pid']);
exit;
break;
case 'satisfycomplain':
$prj_obj->SatisfyComplains(intval($_GET['pid']));
header("Location: /siteadmin/ban-razban/?mode={$mode}" . ($page ? "&p={$page}" : '') . ($search ? "&search={$search}" : '') . ($admin ? "&admin={$admin}" : '') . ($sort ? "&sort={$sort}" : '') . '#p' . $_GET['pid']);
exit;
break;
case 'not_satisfycomplain':
$prj_obj->NotSatisfyComplains(intval($_GET['pid']));
header("Location: /siteadmin/ban-razban/?mode={$mode}" . ($page ? "&p={$page}" : '') . ($search ? "&search={$search}" : '') . ($admin ? "&admin={$admin}" : '') . ($sort ? "&sort={$sort}" : '') . '#p' . $_GET['pid']);
exit;
break;
}
$css_file = array('moderation.css', 'nav.css');
示例3: BlockedProject
/**
* Блокирование/разблокирование проекта
*
* @param integer $project_id id проекта
* @param string $reason причина
* @param int $reason_id ID причины, если она выбрана из списка (таблица admin_reasons, где act_id = 9)
* @param string $reason_name Краткое описание причины действия (из селекта) для лога админских действий
*/
function BlockedProject($project_id, $reason, $reason_id = null, $reason_name = '')
{
global $DB;
$objResponse = new xajaxResponse();
$project_id = intval($project_id);
session_start();
if (hasPermissions('projects')) {
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/projects.php';
if (is_string($reason) && $reason != '') {
if (hasPermissions('projects')) {
$count = $DB->val("SELECT COUNT(*) FROM projects WHERE id = ?", $project_id);
if ($count) {
$projects = new projects();
$project = $projects->GetPrjCust($project_id);
$sObjLink = getFriendlyURL('project', $project_id);
// лог админских действий
$reason_id = $reason_id ? $reason_id : null;
$reason = str_replace('%USERNAME%', $project['uname'] . ' ' . $project['usurname'], $reason);
$reason = change_q($reason, FALSE, 0, TRUE);
$mem = new memBuff();
$mem->delete("prjMsgsCnt{$project['user_id']}");
if ($project['blocked_time']) {
$projects->UnBlocked($project_id);
// пишем лог админских действий
admin_log::addLog(admin_log::OBJ_CODE_PROJ, 10, $project['user_id'], $project_id, $project['name'], $sObjLink, 0, '', $reason_id, $reason);
$objResponse->assign("project-reason-{$project_id}", 'innerHTML', ' ');
$objResponse->assign("project-reason-{$project_id}", 'style.display', 'none');
$objResponse->assign("project-button-{$project_id}", 'innerHTML', "<a class='b-post__link b-post__link_dot_c10601' href='javascript: void(0);' onclick='banned.blockedProject({$project_id}); return false;'>Заблокировать</a>");
} else {
$projects->DeleteComplains($project_id);
$sBlockId = $projects->Blocked($project_id, $reason, $reason_id, $_SESSION['uid']);
$project = $projects->GetPrjCust($project_id);
// Удаляем черновик
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/drafts.php';
drafts::DeleteDraftByPrjID($project_id);
// пишем лог админских действий
admin_log::addLog(admin_log::OBJ_CODE_PROJ, 9, $project['user_id'], $project_id, $project['name'], $sObjLink, 0, '', $reason_id, $reason, $sBlockId);
$reason = reformat($project['blocked_reason'], 24, 0, 0, 1, 24);
$html = BlockedProjectHTML($reason, $project['blocked_time'], $_SESSION['login'], "{$_SESSION['name']} {$_SESSION['surname']}");
$objResponse->assign("project-reason-{$project_id}", 'innerHTML', $html);
$objResponse->assign("project-reason-{$project_id}", 'style.display', 'block');
$objResponse->assign("project-button-{$project_id}", 'innerHTML', "<a style='color: Red;' href='javascript: void(0);' onclick='banned.unblockedProject({$project_id}); return false;'>Разблокировать</a>");
}
} else {
$objResponse->alert('Несуществующий проект');
}
}
}
}
return $objResponse;
}