Example #1
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();
Example #2
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;
}
Example #3
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;
}
Example #4
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();
Example #5
0
<?php

$id = (int) $_FANWE['request']['id'];
$module = strtolower(trim($_FANWE['request']['module']));
if ($id == 0 || empty($module)) {
    exit;
}
$old_module = $module;
if ($module == 'dapei') {
    $module = 'share';
}
if (!getIsManage($module)) {
    exit;
}
$tpl = 'manage/menu/common';
$manage_lock = checkIsManageLock($module, $id);
switch ($module) {
    case 'share':
        $manage_object = FDB::fetchFirst('SELECT * FROM ' . FDB::table('share') . ' WHERE share_id = ' . $id);
        break;
    case 'club':
        $manage_object = FDB::fetchFirst('SELECT * FROM ' . FDB::table('forum_thread') . ' WHERE tid = ' . $id);
        break;
    case 'ask':
        $manage_object = FDB::fetchFirst('SELECT * FROM ' . FDB::table('ask_thread') . ' WHERE tid = ' . $id);
        break;
    case 'shop':
        $manage_object = FDB::fetchFirst('SELECT * FROM ' . FDB::table('shop') . ' WHERE shop_id = ' . $id);
        break;
    case 'event':
        $manage_object = FDB::fetchFirst('SELECT * FROM ' . FDB::table('event') . ' WHERE id = ' . $id);
Example #6
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;
}
Example #7
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;
}
Example #8
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();
Example #9
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();