public function listData($notice = false)
    {
        $conditionStr = '';
        if ($notice == true) {
            $conditionStr = 'WHERE `notice` = "1"';
        }
        if (($sqlArticle = @mysql_query('SELECT `aid`, `title`, `content`, `visibility`, `notice`
			FROM `article` ' . $conditionStr . ' ORDER BY `aid` DESC;')) === false) {
            return false;
        }
        $response = [];
        while (($item = @mysql_fetch_assoc($sqlArticle)) !== false) {
            $item['aid'] = (int) $item['aid'];
            $item['title'] = urldecode($item['title']);
            $item['content'] = urldecode($item['content']);
            $item['visibility'] = (bool) $item['visibility'];
            $item['notice'] = (bool) $item['notice'];
            if (!checkAuthority(9) && !$item['visibility']) {
                continue;
            }
            array_push($response, $item);
        }
        return json_encode($response);
    }
예제 #2
0
<?php

$result = array('status' => 1, 'msg' => '');
$id = intval($_FANWE['request']['id']);
if ($id == 0) {
    $result['status'] = 0;
    outputJson($result);
}
if (!checkAuthority('second', 'delete')) {
    $result['status'] = 0;
    outputJson($result);
}
$manage_lock = checkIsManageLock('second', $id);
if ($manage_lock !== false) {
    $result['status'] = 1;
    $result['msg'] = $manage_lock['user_name'] . ',' . sprintf(lang('manage', 'manage_lock'), fToDate($manage_lock['time']));
    outputJson($result);
}
$sql = "select * from " . FDB::table("second_goods") . " where gid = " . $id;
$goods = FDB::fetchFirst($sql);
if (empty($goods)) {
    $result['status'] = 0;
    outputJson($result);
}
$result['status'] = 1;
$result['msg'] = lang('manage', 'manage_delete_success');
createManageLog('second', 'delete', $id, $result['msg']);
FS('Second')->deleteGoods($id);
deleteManageLock('second', $id);
outputJson($result);
예제 #3
0
<?php

$share_id = intval($_FANWE['request']['id']);
if ($share_id == 0) {
    exit;
}
if (!checkAuthority('share', 'edit')) {
    exit;
}
$share = FS("Share")->getShareById($share_id);
if (empty($share)) {
    deleteManageLock('share', $share_id);
    exit;
}
$manage_lock = checkIsManageLock('share', $share_id);
if ($manage_lock === false) {
    createManageLock('share', $share_id);
} else {
    exit;
}
$share['share_tags'] = FDB::resultFirst("select group_concat(tag_name SEPARATOR ' ') from " . FDB::table("share_tags") . " where share_id = " . $share['share_id']);
$share_category = FDB::fetchAll("select c.cate_id,c.cate_name from " . FDB::table("share_category") . " as sc left join " . FDB::table("goods_category") . " as c on sc.cate_id = c.cate_id where sc.share_id = " . $share['share_id']);
$fanwe->cache->loadCache("goods_category");
include template('manage/share/edit');
display();
예제 #4
0
<?php

$result = array('status' => 1, 'msg' => '');
$id = intval($_FANWE['request']['id']);
if ($id == 0) {
    $result['status'] = 0;
    outputJson($result);
}
if (!checkAuthority('share', 'index')) {
    $result['status'] = 0;
    outputJson($result);
}
$manage_lock = checkIsManageLock('share', $id);
if ($manage_lock !== false) {
    $result['status'] = 1;
    $result['msg'] = $manage_lock['user_name'] . ',' . sprintf(lang('manage', 'manage_lock'), fToDate($manage_lock['time']));
    outputJson($result);
}
$share = FS("Share")->getShareById($id);
if (empty($share)) {
    $result['status'] = 0;
    outputJson($result);
}
$result['status'] = 1;
$update = array();
if ($share['is_index'] == 0) {
    $result['msg'] = lang('manage', 'manage_index_success');
    $update['is_index'] = 1;
} else {
    $result['msg'] = lang('manage', 'manage_unindex_success');
    $update['is_index'] = 0;
예제 #5
0
<?php

$id = intval($_FANWE['request']['id']);
if ($id == 0) {
    exit;
}
if (!checkAuthority('share', 'edit') && FDB::resultFirst("select uid from " . FDB::table("share") . " where share_id = " . $id) != $_FANWE['uid']) {
    exit;
}
$manage_lock = checkIsManageLock('share', $id);
if ($manage_lock === false) {
    createManageLock('share', $id);
}
$share = FDB::fetchFirst("select share_id,title,content from " . FDB::table("share") . " where share_id =" . $id);
if (empty($share)) {
    deleteManageLock('share', $id);
    exit;
}
include template('manage/share/edit');
display();
    public function listData($uid = "")
    {
        if (($sqlPlugin = @mysql_query('SELECT `pid`, `uid`, `folder`, `cover`, `name`, `author`, `git`, `gitStatus`, `available`
			FROM `plugin`
			WHERE `uid` LIKE "%' . $uid . '%";')) === false) {
            return false;
        }
        $response = [];
        while (($item = @mysql_fetch_assoc($sqlPlugin)) !== false) {
            $item['pid'] = (int) $item['pid'];
            $item['uid'] = (int) $item['uid'];
            $item['folder'] = urldecode($item['folder']);
            $item['cover'] = urldecode($item['cover']);
            $item['name'] = urldecode($item['name']);
            $item['author'] = urldecode($item['author']);
            $item['git'] = urldecode($item['git']);
            $item['gitStatus'] = (int) $item['gitStatus'];
            $item['available'] = (bool) $item['available'];
            if (!$item['available'] && !checkAuthority(9)) {
                continue;
            }
            array_push($response, $item);
        }
        return json_encode($response);
    }
예제 #7
0
<?php

$result = array('status' => 1, 'msg' => '');
$id = intval($_FANWE['request']['id']);
if ($id == 0) {
    $result['status'] = 0;
    outputJson($result);
}
if (!checkAuthority('ask', 'delete')) {
    $result['status'] = 0;
    outputJson($result);
}
$manage_lock = checkIsManageLock('ask', $id);
if ($manage_lock !== false) {
    $result['status'] = 1;
    $result['msg'] = $manage_lock['user_name'] . ',' . sprintf(lang('manage', 'manage_lock'), fToDate($manage_lock['time']));
    outputJson($result);
}
$topic = FS('Ask')->getTopicById($id);
if (empty($topic)) {
    $result['status'] = 0;
    outputJson($result);
}
$result['status'] = 1;
$result['msg'] = lang('manage', 'manage_delete_success');
createManageLog('ask', 'delete', $id, $result['msg']);
FS('Ask')->deleteTopic($id);
deleteManageLock('ask', $id);
outputJson($result);
예제 #8
0
<?php

$result = array('status' => 1, 'msg' => '');
$id = intval($_FANWE['request']['id']);
if ($id == 0) {
    $result['status'] = 0;
    outputJson($result);
}
if (!checkAuthority('event', 'hot')) {
    $result['status'] = 0;
    outputJson($result);
}
$manage_lock = checkIsManageLock('event', $id);
if ($manage_lock !== false) {
    $result['status'] = 1;
    $result['msg'] = $manage_lock['user_name'] . ',' . sprintf(lang('manage', 'manage_lock'), fToDate($manage_lock['time']));
    outputJson($result);
}
$event = FDB::fetchFirst("select * from " . FDB::table("event") . " where id =" . $id);
if (empty($event)) {
    $result['status'] = 0;
    outputJson($result);
}
$result['status'] = 1;
if ($event['is_hot'] == 0) {
    $result['msg'] = lang('manage', 'manage_top_success');
    $event['is_hot'] = 1;
} else {
    $result['msg'] = lang('manage', 'manage_untop_success');
    $event['is_top'] = 0;
}
예제 #9
0
<?php

$result = array('status' => 1, 'msg' => '');
$id = intval($_FANWE['request']['id']);
if ($id == 0) {
    $result['status'] = 0;
    outputJson($result);
}
if (!checkAuthority('club', 'top')) {
    $result['status'] = 0;
    outputJson($result);
}
$manage_lock = checkIsManageLock('club', $id);
if ($manage_lock !== false) {
    $result['status'] = 1;
    $result['msg'] = $manage_lock['user_name'] . ',' . sprintf(lang('manage', 'manage_lock'), fToDate($manage_lock['time']));
    outputJson($result);
}
$topic = FS('Topic')->getTopicById($id);
if (empty($topic)) {
    $result['status'] = 0;
    outputJson($result);
}
$result['status'] = 1;
if ($topic['is_top'] == 0) {
    $result['msg'] = lang('manage', 'manage_top_success');
    $topic['is_top'] = 1;
} else {
    $result['msg'] = lang('manage', 'manage_untop_success');
    $topic['is_top'] = 0;
}
예제 #10
0
<?php

$result = array('status' => 1, 'msg' => '');
$id = intval($_FANWE['request']['id']);
if ($id == 0) {
    $result['status'] = 0;
    outputJson($result);
}
if (!checkAuthority('share', 'share_best')) {
    $result['status'] = 0;
    outputJson($result);
}
$manage_lock = checkIsManageLock('share', $id);
if ($manage_lock !== false) {
    $result['status'] = 1;
    $result['msg'] = $manage_lock['user_name'] . ',' . sprintf(lang('manage', 'manage_lock'), fToDate($manage_lock['time']));
    outputJson($result);
}
$share = FS("Share")->getShareById($id);
if (empty($share)) {
    $result['status'] = 0;
    outputJson($result);
}
$result['status'] = 1;
if ($share['is_best'] == 0) {
    $result['msg'] = lang('manage', 'manage_share_best_success');
    $share['is_best'] = 1;
} else {
    $result['msg'] = lang('manage', 'manage_unshare_best_success');
    $share['is_best'] = 0;
}
예제 #11
0
<?php

$id = intval($_FANWE['request']['id']);
if ($id == 0) {
    exit;
}
if (!checkAuthority('album', 'edit')) {
    exit;
}
$manage_lock = checkIsManageLock('album', $id);
if ($manage_lock !== false) {
    exit;
}
$old = FS('Album')->getAlbumById($id);
if (empty($old)) {
    deleteManageLock('album', $id);
    exit;
}
$is_flash = (int) $_FANWE['request']['is_flash'];
$is_best = (int) $_FANWE['request']['is_best'];
if ($is_flash == 0) {
    if (!empty($old['flash_img'])) {
        @unlink(FANWE_ROOT . $old['flash_img']);
    }
}
if ($is_best == 0) {
    if (!empty($old['best_img'])) {
        @unlink(FANWE_ROOT . $old['best_img']);
    }
}
$share_id = $old['share_id'];
예제 #12
0
<?php

$result = array('status' => 1, 'msg' => '');
$id = intval($_FANWE['request']['id']);
if ($id == 0) {
    $result['status'] = 0;
    outputJson($result);
}
if (!checkAuthority('album', 'delete')) {
    $result['status'] = 0;
    outputJson($result);
}
$manage_lock = checkIsManageLock('album', $id);
if ($manage_lock !== false) {
    $result['status'] = 1;
    $result['msg'] = $manage_lock['user_name'] . ',' . sprintf(lang('manage', 'manage_lock'), fToDate($manage_lock['time']));
    outputJson($result);
}
$album = FS('Album')->getAlbumById($id, false);
if (empty($album)) {
    $result['status'] = 0;
    outputJson($result);
}
$result['status'] = 1;
$result['msg'] = lang('manage', 'manage_delete_success');
createManageLog('album', 'delete', $id, $result['msg']);
@set_time_limit(3600);
if (function_exists('ini_set')) {
    ini_set('max_execution_time', 3600);
    ini_set("memory_limit", "256M");
}
예제 #13
0
<?php

require fimport('service/share');
$result = array();
$id = intval($_FANWE['request']['id']);
if ($id == 0) {
    exit;
}
$share = FS('Share')->getShareById($id);
if (empty($share)) {
    $result['status'] = 1;
    outputJson($result);
}
if (checkAuthority('share', 'delete')) {
    $authoritys = 3;
} else {
    $authoritys = FS('Share')->getIsEditShare($share);
}
if ($authoritys == 0) {
    $result['status'] = 0;
    outputJson($result);
}
$type = intval($_FANWE['request']['type']);
if ($type == 0) {
    if ($share['type'] == 'bar_post') {
        FS('Topic')->deletePost($id);
    } elseif ($share['type'] == 'ask_post') {
        FS('Ask')->deletePost($id);
    } elseif ($share['type'] == 'album') {
        FS('Album')->deleteAlbum($share['rec_id']);
    } elseif ($share['type'] == 'album_item') {
예제 #14
0
<?php

$id = intval($_FANWE['request']['id']);
if ($id == 0) {
    exit;
}
if (!checkAuthority('second', 'edit')) {
    exit;
}
$manage_lock = checkIsManageLock('second', $id);
if ($manage_lock !== false) {
    exit;
}
$sql = "select * from " . FDB::table("second_goods") . " where gid = " . $id;
$old = FDB::fetchFirst($sql);
if (empty($old)) {
    deleteManageLock('second', $id);
    exit;
}
$share_id = $old['share_id'];
$update = array('name' => htmlspecialchars(trim($_FANWE['request']['name'])), 'content' => htmlspecialchars(trim($_FANWE['request']['content'])), 'sid' => (int) $_FANWE['request']['cid'], 'city_id' => (int) $_FANWE['request']['city_id'], 'num' => (int) $_FANWE['request']['num'], 'price' => (double) $_FANWE['request']['price'], 'transport_fee' => (double) $_FANWE['request']['transport_fee'], 'valid_time' => str2Time($_FANWE['request']['valid_time']));
FDB::update('second_goods', $update, 'gid = ' . $id);
FS('Share')->updateShare($share_id, $update['title'], $update['content']);
createManageLog('second', 'edit', $id, lang('manage', 'manage_edit_success'));
deleteManageLock('second', $id);
$msg = lang('manage', 'manage_edit_success');
include template('manage/tooltip');
display();
예제 #15
0
<?php

$result = array('status' => 1, 'msg' => '');
$id = intval($_FANWE['request']['id']);
if ($id == 0) {
    $result['status'] = 0;
    outputJson($result);
}
if (!checkAuthority('ask', 'best')) {
    $result['status'] = 0;
    outputJson($result);
}
$manage_lock = checkIsManageLock('ask', $id);
if ($manage_lock !== false) {
    $result['status'] = 1;
    $result['msg'] = $manage_lock['user_name'] . ',' . sprintf(lang('manage', 'manage_lock'), fToDate($manage_lock['time']));
    outputJson($result);
}
$topic = FS('Ask')->getTopicById($id);
if (empty($topic)) {
    $result['status'] = 0;
    outputJson($result);
}
$result['status'] = 1;
if ($topic['is_best'] == 0) {
    $result['msg'] = lang('manage', 'manage_best_success');
    $topic['is_best'] = 1;
} else {
    $result['msg'] = lang('manage', 'manage_unbest_success');
    $topic['is_best'] = 0;
}
예제 #16
0
<?php

$result = array('status' => 1, 'msg' => '');
$id = intval($_FANWE['request']['id']);
if ($id == 0) {
    $result['status'] = 0;
    outputJson($result);
}
if (!checkAuthority('share', 'status')) {
    $result['status'] = 0;
    outputJson($result);
}
$manage_lock = checkIsManageLock('share', $id);
if ($manage_lock !== false) {
    $result['status'] = 1;
    $result['msg'] = $manage_lock['user_name'] . ',' . sprintf(lang('manage', 'manage_lock'), fToDate($manage_lock['time']));
    outputJson($result);
}
$share = FS("Share")->getShareById($id);
if (empty($share)) {
    $result['status'] = 0;
    outputJson($result);
}
$result['status'] = 1;
if ($share['status'] == 0) {
    $result['msg'] = lang('manage', 'manage_status_success');
    $share['status'] = 1;
} else {
    $result['msg'] = lang('manage', 'manage_unstatus_success');
    $share['status'] = 0;
}
        break;
    case 'changeLevel':
        if (!checkAuthority(9)) {
            handle(ERROR_PERMISSION . '01');
        }
        $uid = getRequest('uid');
        $level = max(0, min(9, (int) getRequest('level')));
        if (($sqlUser = @mysql_query('UPDATE `user`
			SET `level` = "' . $level . '"
			WHERE `uid` = "' . $uid . '";')) === false) {
            handle(ERROR_SYSTEM . '01');
        }
        handle('0000');
        break;
    case 'resetPassword':
        if (!checkAuthority(9)) {
            handle(ERROR_PERMISSION . '01');
        }
        $_p = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
        $currentUser = new User();
        $currentUser->uid = $uid = getRequest('uid');
        $username = json_decode($currentUser->getData(), true)['username'];
        $pwd = '';
        for ($_i = 0; $_i < 10; $_i++) {
            $pwd .= $_p[mt_rand(0, strlen($_p) - 1)];
        }
        $password = password_hash(md5($username . md5($pwd) . '.cc'), PASSWORD_BCRYPT);
        if (($sqlUser = @mysql_query('UPDATE `user`
			SET `password` = "' . $password . '"
			WHERE `uid` = "' . $uid . '";')) === false) {
            handle(ERROR_SYSTEM . '01');
예제 #18
0
<?php

$result = array('status' => 1, 'msg' => '');
$id = intval($_FANWE['request']['id']);
if ($id == 0) {
    $result['status'] = 0;
    outputJson($result);
}
if (!checkAuthority('daren', 'is_daren')) {
    $result['status'] = 0;
    outputJson($result);
}
$manage_lock = checkIsManageLock('daren', $id);
if ($manage_lock !== false) {
    $result['status'] = 1;
    $result['msg'] = $manage_lock['user_name'] . ',' . sprintf(lang('manage', 'manage_lock'), fToDate($manage_lock['time']));
    outputJson($result);
}
$daren = FDB::fetchFirst("select * from " . FDB::table("user") . " where is_daren = 1 and uid =" . $id);
if (empty($daren)) {
    $result['status'] = 0;
    outputJson($result);
}
if (FS("Daren")->removeDaren($id)) {
    $result['status'] = 1;
} else {
    $result['status'] = 0;
    outputJson($result);
}
$result['msg'] = lang('manage', 'manage_is_daren_success');
createManageLog('daren', 'is_daren', $id, $result['msg']);
예제 #19
0
<?php

$result = array('status' => 1, 'msg' => '');
$id = intval($_FANWE['request']['id']);
if ($id == 0) {
    $result['status'] = 0;
    outputJson($result);
}
if (!checkAuthority('club', 'delete')) {
    $result['status'] = 0;
    outputJson($result);
}
$manage_lock = checkIsManageLock('club', $id);
if ($manage_lock !== false) {
    $result['status'] = 1;
    $result['msg'] = $manage_lock['user_name'] . ',' . sprintf(lang('manage', 'manage_lock'), fToDate($manage_lock['time']));
    outputJson($result);
}
$topic = FS('Topic')->getTopicById($id);
if (empty($topic)) {
    $result['status'] = 0;
    outputJson($result);
}
$result['status'] = 1;
$result['msg'] = lang('manage', 'manage_delete_success');
createManageLog('club', 'delete', $id, $result['msg']);
FS('Topic')->deleteTopic($topic['share_id']);
deleteManageLock('club', $id);
outputJson($result);
예제 #20
0
<?php

$result = array('status' => 1, 'msg' => '');
$id = intval($_FANWE['request']['id']);
if ($id == 0) {
    $result['status'] = 0;
    outputJson($result);
}
if (!checkAuthority('daren', 'best')) {
    $result['status'] = 0;
    outputJson($result);
}
$manage_lock = checkIsManageLock('daren', $id);
if ($manage_lock !== false) {
    $result['status'] = 1;
    $result['msg'] = $manage_lock['user_name'] . ',' . sprintf(lang('manage', 'manage_lock'), fToDate($manage_lock['time']));
    outputJson($result);
}
$daren = FDB::fetchFirst("select * from " . FDB::table("user_daren") . " where id =" . $id);
if (empty($daren)) {
    $result['status'] = 0;
    outputJson($result);
}
$result['status'] = 1;
if ($daren['is_best'] == 0) {
    $result['msg'] = lang('manage', 'manage_best_success');
    $daren['is_best'] = 1;
} else {
    $result['msg'] = lang('manage', 'manage_unbest_success');
    $daren['is_best'] = 0;
}
예제 #21
0
<?php

$result = array('status' => 1, 'msg' => '');
$id = intval($_FANWE['request']['id']);
if ($id == 0) {
    $result['status'] = 0;
    outputJson($result);
}
if (!checkAuthority('daren', 'index')) {
    $result['status'] = 0;
    outputJson($result);
}
$manage_lock = checkIsManageLock('daren', $id);
if ($manage_lock !== false) {
    $result['status'] = 1;
    $result['msg'] = $manage_lock['user_name'] . ',' . sprintf(lang('manage', 'manage_lock'), fToDate($manage_lock['time']));
    outputJson($result);
}
$daren = FDB::fetchFirst("select * from " . FDB::table("user_daren") . " where id =" . $id);
if (empty($daren)) {
    $result['status'] = 0;
    outputJson($result);
}
$result['status'] = 1;
if ($daren['is_index'] == 0) {
    $result['msg'] = lang('manage', 'manage_index_success');
    $daren['is_index'] = 1;
} else {
    $result['msg'] = lang('manage', 'manage_unindex_success');
    $daren['is_index'] = 0;
}
     handle('0000{"cid":' . $response . '}');
     break;
 case 'renew':
     $currentCalculation = new Calculation();
     $currentCalculation->cid = getRequest('cid');
     $response = json_decode($currentCalculation->getData(), true);
     require_once 'site.class.php';
     $uid = Site::getSessionUid();
     if ($uid == 0) {
         handle(ERROR_PERMISSION . '00' . '请先登陆!');
     }
     if ($response['uid'] !== $uid && !checkAuthority(9)) {
         handle(ERROR_PERMISSION . '00');
     }
     $priority = $response['priority'];
     if (checkAuthority(9) && getRequest('priority') !== '') {
         $priority = getRequest('priority');
     }
     $currentCalculation->init($response['pid'], $response['uid'], $priority, (int) getRequest('public'), getRequest('password'), $response['status'], $response['input']);
     if (!$currentCalculation->checkVariables()) {
         handle(ERROR_INPUT . '01');
     }
     $response = $currentCalculation->modify();
     if ($response === false) {
         handle(ERROR_SYSTEM . '00');
     } else {
         handle('0000');
     }
     break;
 default:
     ERROR(ERROR_INPUT . '02', 'Request Error.');
예제 #23
0
<?php

$result = array('status' => 1, 'msg' => '');
$id = intval($_FANWE['request']['id']);
if ($id == 0) {
    $result['status'] = 0;
    outputJson($result);
}
if (!checkAuthority('club', 'best')) {
    $result['status'] = 0;
    outputJson($result);
}
$manage_lock = checkIsManageLock('club', $id);
if ($manage_lock !== false) {
    $result['status'] = 1;
    $result['msg'] = $manage_lock['user_name'] . ',' . sprintf(lang('manage', 'manage_lock'), fToDate($manage_lock['time']));
    outputJson($result);
}
$topic = FS('Topic')->getTopicById($id);
if (empty($topic)) {
    $result['status'] = 0;
    outputJson($result);
}
$result['status'] = 1;
if ($topic['is_best'] == 0) {
    $result['msg'] = lang('manage', 'manage_best_success');
    $topic['is_best'] = 1;
} else {
    $result['msg'] = lang('manage', 'manage_unbest_success');
    $topic['is_best'] = 0;
}
예제 #24
0
<?php

$id = intval($_FANWE['request']['id']);
if ($id == 0) {
    exit;
}
if (!checkAuthority('shop', 'edit')) {
    exit;
}
$manage_lock = checkIsManageLock('shop', $id);
if ($manage_lock === false) {
    createManageLock('shop', $id);
} else {
    exit;
}
$sql = "select * from " . FDB::table("shop") . " where shop_id = " . $id;
$shop = FDB::fetchFirst($sql);
if (empty($shop)) {
    deleteManageLock('shop', $id);
    exit;
}
$fanwe->cache->loadCache("shops");
include template('manage/shop/edit');
display();
예제 #25
0
<?php

$id = intval($_FANWE['request']['tid']);
if ($id == 0) {
    exit;
}
if (!checkAuthority('ask', 'edit')) {
    exit;
}
$manage_lock = checkIsManageLock('ask', $id);
if ($manage_lock !== false) {
    exit;
}
$old = FS('Ask')->getTopicById($id);
if (empty($old)) {
    deleteManageLock('ask', $id);
    exit;
}
$share_id = $old['share_id'];
$topic = array('title' => htmlspecialchars(trim($_FANWE['request']['title'])), 'content' => htmlspecialchars(trim($_FANWE['request']['content'])), 'aid' => $_FANWE['request']['aid'], 'is_best' => isset($_FANWE['request']['is_best']) ? intval($_FANWE['request']['is_best']) : 0, 'is_top' => isset($_FANWE['request']['is_top']) ? intval($_FANWE['request']['is_top']) : 0);
FDB::update('ask_thread', $topic, 'tid = ' . $id);
FS('Share')->updateShare($share_id, $topic['title'], $topic['content']);
createManageLog('ask', 'edit', $id, lang('manage', 'manage_edit_success'));
deleteManageLock('ask', $id);
$msg = lang('manage', 'manage_edit_success');
include template('manage/tooltip');
display();
예제 #26
0
<?php

$result = array('status' => 1, 'msg' => '');
$id = intval($_FANWE['request']['id']);
if ($id == 0) {
    $result['status'] = 0;
    outputJson($result);
}
if (!checkAuthority('ask', 'top')) {
    $result['status'] = 0;
    outputJson($result);
}
$manage_lock = checkIsManageLock('ask', $id);
if ($manage_lock !== false) {
    $result['status'] = 1;
    $result['msg'] = $manage_lock['user_name'] . ',' . sprintf(lang('manage', 'manage_lock'), fToDate($manage_lock['time']));
    outputJson($result);
}
$topic = FS('Ask')->getTopicById($id);
if (empty($topic)) {
    $result['status'] = 0;
    outputJson($result);
}
$result['status'] = 1;
if ($topic['is_top'] == 0) {
    $result['msg'] = lang('manage', 'manage_top_success');
    $topic['is_top'] = 1;
} else {
    $result['msg'] = lang('manage', 'manage_untop_success');
    $topic['is_top'] = 0;
}
예제 #27
0
<?php

$result = array('status' => 1, 'msg' => '');
$id = intval($_FANWE['request']['id']);
if ($id == 0) {
    $result['status'] = 0;
    outputJson($result);
}
if (!checkAuthority('album', 'flash')) {
    $result['status'] = 0;
    outputJson($result);
}
$manage_lock = checkIsManageLock('album', $id);
if ($manage_lock !== false) {
    $result['status'] = 1;
    $result['msg'] = $manage_lock['user_name'] . ',' . sprintf(lang('manage', 'manage_lock'), fToDate($manage_lock['time']));
    outputJson($result);
}
$album = FS('Album')->getAlbumById($id, false);
if (empty($album)) {
    $result['status'] = 0;
    outputJson($result);
}
$result['status'] = 1;
if ($album['is_flash'] == 0) {
    $result['msg'] = lang('manage', 'manage_flash_success');
    $album['is_flash'] = 1;
} else {
    $result['msg'] = lang('manage', 'manage_unflash_success');
    $album['is_flash'] = 0;
}
예제 #28
0
<?php

$id = intval($_FANWE['request']['id']);
if ($id == 0) {
    exit;
}
if (!checkAuthority('club', 'edit')) {
    exit;
}
$manage_lock = checkIsManageLock('club', $id);
if ($manage_lock === false) {
    createManageLock('club', $id);
} else {
    exit;
}
$topic = FS('Topic')->getTopicById($id);
if (empty($topic)) {
    deleteManageLock('club', $id);
    exit;
}
$fanwe->cache->loadCache("forums");
include template('manage/club/edit');
display();
예제 #29
0
<?php

$result = array('status' => 1, 'msg' => '');
$id = intval($_FANWE['request']['id']);
if ($id == 0) {
    $result['status'] = 0;
    outputJson($result);
}
if (!checkAuthority('album', 'best')) {
    $result['status'] = 0;
    outputJson($result);
}
$manage_lock = checkIsManageLock('album', $id);
if ($manage_lock !== false) {
    $result['status'] = 1;
    $result['msg'] = $manage_lock['user_name'] . ',' . sprintf(lang('manage', 'manage_lock'), fToDate($manage_lock['time']));
    outputJson($result);
}
$album = FS('Album')->getAlbumById($id, false);
if (empty($album)) {
    $result['status'] = 0;
    outputJson($result);
}
$result['status'] = 1;
if ($album['is_best'] == 0) {
    $result['msg'] = lang('manage', 'manage_best_success');
    $album['is_best'] = 1;
} else {
    $result['msg'] = lang('manage', 'manage_unbest_success');
    $album['is_best'] = 0;
}
예제 #30
0
<?php

$result = array('status' => 1, 'msg' => '');
$id = intval($_FANWE['request']['id']);
if ($id == 0) {
    $result['status'] = 0;
    outputJson($result);
}
if (!checkAuthority('event', 'delete')) {
    $result['status'] = 0;
    outputJson($result);
}
$manage_lock = checkIsManageLock('event', $id);
if ($manage_lock !== false) {
    $result['status'] = 1;
    $result['msg'] = $manage_lock['user_name'] . ',' . sprintf(lang('manage', 'manage_lock'), fToDate($manage_lock['time']));
    outputJson($result);
}
FS('Event')->removeEvent($id);
$result['status'] = 1;
$result['msg'] = lang('manage', 'manage_delete_success');
createManageLog('event', 'delete', $id, $result['msg']);
deleteManageLock('event', $id);
outputJson($result);