当前位置: 首页>>代码示例>>PHP>>正文


PHP projects::DeleteComplains方法代码示例

本文整理汇总了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;
 }
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:43,代码来源:user_content.php

示例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');
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:31,代码来源:index.php

示例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', '&nbsp;');
                        $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;
}
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:59,代码来源:banned.server.php


注:本文中的projects::DeleteComplains方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。