<?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();
<?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();
<?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);
<?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();
<?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();
<?php $id = intval($_FANWE['request']['id']); $module = strtolower(trim($_FANWE['request']['module'])); if ($id == 0 || empty($module)) { exit; } if (!getIsManage($module)) { exit; } $lock = getManageLock($module, $id); if ($lock !== false) { if ($lock['uid'] == $_FANWE['uid']) { deleteManageLock($module, $id); } } echo 1;
} $share_id = $old['share_id']; $update = array('title' => htmlspecialchars(trim($_FANWE['request']['title'])), 'content' => htmlspecialchars(trim($_FANWE['request']['content'])), 'cid' => (int) $_FANWE['request']['cid'], 'show_type' => (int) $_FANWE['request']['show_type'], 'is_flash' => $is_flash, 'is_best' => $is_best); if ($is_flash == 1) { $img = FS("Image")->save('flash_img', 'album'); if ($img) { $update['flash_img'] = $img['url']; } } if ($is_best == 1) { $img = FS("Image")->save('best_img', 'album'); if ($img) { $update['best_img'] = $img['url']; } } $tags = str_replace('***', '', $_FANWE['request']['tags']); $tags = str_replace(' ', ' ', $tags); $tags = explode(' ', $tags); $tags = array_unique($tags); $update['tags'] = implode(' ', $tags); FDB::update('album', $update, 'id = ' . $id); FS('Share')->updateShare($share_id, $update['title'], $update['content']); FS("Album")->saveTags($id, $tags); if ($update['cid'] != $old['cid']) { FDB::query('UPDATE ' . FDB::table("album_share") . ' SET cid = ' . $update['cid'] . ' WHERE album_id = ' . $id); } createManageLog('album', 'edit', $id, lang('manage', 'manage_edit_success')); deleteManageLock('album', $id); $msg = lang('manage', 'manage_edit_success'); include template('manage/tooltip'); display();
<?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();
<?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);