Exemplo n.º 1
0
     S::gp(array('operater', 'kid'), 'gp', 2);
     S::gp(array('kids'));
     $kid > 0 && ($kids = array($kid));
     if (!S::isArray($kids)) {
         adminmsg('operate_error');
     }
     foreach ($kids as $kid) {
         if ($operater == 1) {
             //撤销孔明灯
             $kmdInfo = $kmdService->getKmdInfoByKid($kid);
             if (!$kmdInfo || !$kmdInfo['uid']) {
                 continue;
             }
             $kmdService->initKmdInfoByKid($kid);
             //send message
             sendKmdMessages($kmdInfo['uid'], 'kmd_admin_kmd_canceled_title', 'kmd_admin_kmd_canceled_content');
         }
     }
     require_once R_P . 'require/updateforum.php';
     updatetop();
     adminmsg('operate_success');
 } elseif ($step == 3) {
     //ajax 添加孔明灯 TODO
     S::gp(array('action'));
     if ($action == 'save') {
     } else {
         define('AJAX', 1);
         require_once PrintApp('set_ajax');
         ajax_footer();
     }
 } else {
Exemplo n.º 2
0
        if ($originalaction == 'changethread') {
            (!$originaltid || $originaltid != $kmdInfo['tid']) && kmdAjaxMessage('错误操作');
            $db_kmd_deducttime && $timestamp + $db_kmd_deducttime * 3600 >= $kmdInfo['endtime'] && kmdAjaxMessage('推广时间不足,无法更换!');
        }
        $kmdUpdateInfo = array('tid' => $threadid, 'status' => KMD_THREAD_STATUS_CHECK);
        $originalaction == 'changethread' && ($kmdUpdateInfo['endtime'] = $kmdInfo['endtime'] - $db_kmd_deducttime * 3600);
        $kmdService->updateKmdInfo($kmdUpdateInfo, $kid);
        $originaltid && $kmdService->updateKmdThreadByTid($originaltid, 0);
        $tmpMessageContent = array('username' => $windid, 'tid' => $threadid, 'threadtitle' => $threadInfo['subject']);
        if ($db_kmd_reviewperson) {
            $kmdReviewPerson = explode(',', $db_kmd_reviewperson);
            $kmdReviewPerson = array_unique(array_merge($kmdReviewPerson, $manager));
            $messageTitle = $originalaction == 'changethread' ? 'kmd_review_thread_change_title' : 'kmd_review_thread_add_title';
            sendKmdMessages($kmdReviewPerson, array($messageTitle, array('username' => $windid)), array('kmd_review_thread_content', $tmpMessageContent));
        }
        sendKmdMessages(array($windid), array('kmd_review_user_thread_title'), array('kmd_review_user_thread_content', $tmpMessageContent));
        require_once R_P . 'require/updateforum.php';
        updatetop();
        kmdAjaxMessage('操作成功!', 'success');
    }
} elseif ($a == 'getthread') {
    S::gp(array('tpcurl'));
    $tpcurl = html_entity_decode(urldecode($tpcurl));
    !$tpcurl && kmdAjaxMessage('请输入帖子链接');
    $urlInfo = parse_url($tpcurl);
    $urlInfo['host'] != $pwServer['HTTP_HOST'] && kmdAjaxMessage('链接不正确');
    preg_match("/tid=(\\d+)/i", $tpcurl, $data) || preg_match("/tid-(\\d+)/i", $tpcurl, $data) || preg_match("/\\/(\\d+)\\.(htm|html)/i", $tpcurl, $data);
    (!$data || $data[1] < 1) && kmdAjaxMessage('该帖子不存在,请确认URL是否正确');
    $threadInfo = checkKmdThread($data[1]);
    $threadInfo['topped'] && kmdAjaxMessage('该帖子已经是置顶帖,不能添加为孔明灯');
    $content = substrs(stripWindCode($threadInfo['content']), 100);