本文整理汇总了PHP中deleteCache函数的典型用法代码示例。如果您正苦于以下问题:PHP deleteCache函数的具体用法?PHP deleteCache怎么用?PHP deleteCache使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了deleteCache函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: uninstall
public static function uninstall()
{
global $db, $setting, $admin_cat, $mystep;
$info = self::info();
$db->delete($setting['db']['pre'] . "admin_cat", array("file", "=", "xcode.php"));
$db->delete($setting['db']['pre'] . "plugin", array("idx", "=", $info['idx']));
deleteCache("admin_cat");
deleteCache("plugin");
$err = array();
if ($db->GetError($err)) {
showInfo($setting['language']['plugin_err_uninstall'] . "\r\n\t\t\t<br />\r\n\t\t\t<pre>\r\n\t\t\t" . join("\n------------------------\n", $err) . "\r\n\t\t\t</pre>\r\n\t\t\t");
} else {
$mydb = $mystep->getInstance("MyDB", "code", dirname(__FILE__));
$record = $mydb->queryAll();
for ($i = 0; $i < count($record); $i++) {
unlink(dirname(__FILE__) . "/code/" . $record[$i]['idx'] . ".php");
}
$mydb->emptyTBL();
unset($mydb);
includeCache("admin_cat");
$admin_cat = toJson($admin_cat, $setting['gen']['charset']);
echo <<<mystep
<script language="javascript">
parent.admin_cat = {$admin_cat};
parent.setNav();
</script>
mystep;
buildParaList("plugin");
echo showInfo($setting['language']['plugin_uninstall_done'], false);
}
}
示例2: ModulePage
function ModulePage()
{
global $PIO;
if (!isset($_GET['res'])) {
if (!file_exists('./.userrepair') || isset($_GET['force'])) {
touch('./.userrepair');
$PIO->dbMaintanence('repair', $PIO->dbMaintanence('repair'));
updatelog();
// 重導向到靜態快取
unlink('./.userrepair');
header('HTTP/1.1 302 Moved Temporarily');
header('Location: ' . fullURL() . PHP_SELF2 . '?' . time());
} else {
error('已經有其他人在修復中。<p>[<a href="' . $this->SELF . '&force=1">強制執行</a>]</p>');
}
} else {
if (!file_exists('./.userrepair') || isset($_GET['force'])) {
touch('./.userrepair');
$no = intval($_GET['res']);
deleteCache(array($no));
unlink('./.userrepair');
header('HTTP/1.1 302 Moved Temporarily');
header('Location: ' . fullURL() . PHP_SELF . '?res=' . $no);
} else {
error('已經有其他人在修復中。<p>[<a href="' . $this->SELF . '&res=' . $_GET['res'] . '&force=1">強制執行</a>]</p>');
}
}
}
示例3: snatchGetInfo
function snatchGetInfo($url, $para = array())
{
global $db, $setting;
$date = isset($para['date']) ? $para['date'] : date("Ymd");
$url = "http://news.sohu.com/_scroll_newslist/" . $date . "/news.inc";
$info = array();
$info['page_count'] = 1;
$header = array();
if (isset($para['header'])) {
$header = $para['header'];
}
$info['header'] = $header;
if ($content = GetRemoteContent($url, $header)) {
$content = preg_replace("/^.+?(\\{.+\\}).*\$/", '\\1', $content);
$content = json_decode_js($content, true);
$info['catList'] = $content['category'];
$info['newList'] = $content['item'];
unset($content);
$info['cat_main'] = $db->result($setting['db']['pre'] . "news_cat", "cat_id", array("cat_name", "=", "新闻资讯"));
if (empty($info['cat_main'])) {
$db->insert($setting['db']['pre'] . "news_cat", array(0, $para['web_id'], 0, '新闻资讯', '国内,国际,社会,财经,军事,体育,娱乐,文化,汽车', '国内资讯,国际资讯,社会资讯,财经资讯,军事资讯,体育资讯,娱乐资讯,文化资讯,汽车资讯', 'news', '', '', 1, 0, '', 1, 255, 0, ''));
$info['cat_main'] = $db->GetInsertId();
}
for ($i = 0, $m = count($info['catList']); $i < $m; $i++) {
$info['catList'][$i][0] = chg_charset($info['catList'][$i][0], "utf-8", $setting['gen']['charset']);
$cat_id = $db->result($setting['db']['pre'] . "news_cat", "cat_id", array("cat_name", "=", $info['catList'][$i][0]));
if (empty($cat_id)) {
$keyword = "";
$descripiton = "";
if ($content = GetRemoteContent($info['catList'][$i][1], $header)) {
if (preg_match("/<meta name=\"keywords\" content=\"(.+?)\">/i", $content, $matches)) {
$keyword = str_replace(" ", ",", $matches[1]);
unset($matches);
}
if (preg_match("/<meta name=\"description\" content=\"(.+?)\">/i", $content, $matches)) {
$descripiton = str_replace(" ", ",", $matches[1]);
unset($matches);
}
}
$db->insert($setting['db']['pre'] . "news_cat", array(0, $para['web_id'], $info['cat_main'], $info['catList'][$i][0], $keyword, $descripiton, $info['catList'][$i][0], '', '', 1, 0, '', 2, 255, 0, ''));
$cat_id = $db->GetInsertId();
}
$info['catList'][$i][] = $cat_id;
}
deleteCache("news_cat");
for ($i = 0, $m = count($info['newList']); $i < $m; $i++) {
$info['newList'][$i][1] = chg_charset($info['newList'][$i][1], "utf-8", $setting['gen']['charset']);
$info['newList'][$i][] = $info['catList'][$info['newList'][$i][0]][2];
}
} else {
return false;
}
return $info;
}
示例4: update
public function update()
{
$name = $this->getActionName();
$model = D($name);
if (false === ($data = $model->create())) {
$this->error($model->getError());
}
// 更新数据
$list = $model->save();
$id = $data[$model->getPk()];
if (false !== $list) {
vendor("common");
$share_id = $model->where("goods_id = '{$id}'")->getField('share_id');
deleteCache('share/' . getDirsById($share_id) . '/imgs');
deleteCache('share/' . getDirsById($share_id) . '/detail');
$this->saveLog(1, $id);
//$this->assign ( 'jumpUrl', Cookie::get ( '_currentUrl_' ) );
$this->success(L('EDIT_SUCCESS'));
} else {
//错误提示
$this->saveLog(0, $id);
$this->error(L('EDIT_ERROR'));
}
}
示例5: unset
$format_org = $_POST['format_org'];
unset($_POST['idx_org'], $_POST['format_org']);
$log_info = $method == "add_ok" ? $setting['language']['admin_user_power_add'] : $setting['language']['admin_user_power_edit'];
$db->replace($setting['db']['pre'] . "user_power", $_POST);
if ($method == "add_ok") {
$db->exec("alter", "table", $setting['db']['pre'] . "user_type", "add", "`" . $_POST['idx'] . "` " . $theFormat);
$db->update($setting['db']['pre'] . "user_type", array($_POST['idx'] => $_POST['value']));
} else {
if ($idx_org != $_POST['idx']) {
$db->Query("alter", "table", $setting['db']['pre'] . "user_type", "change", "`" . $idx_org . "` `" . $_POST['idx'] . "` " . $theFormat);
} elseif ($format_org != $_POST['format']) {
$db->Query("alter", "table", $setting['db']['pre'] . "user_type", "modify", "`" . $_POST['idx'] . "` " . $theFormat);
}
}
deleteCache("user_type");
deleteCache("user_power");
}
break;
default:
build_page("list");
}
if (!empty($log_info)) {
write_log($log_info, "power_id=" . $power_id);
$goto_url = $setting['info']['self'];
}
$mystep->pageEnd(false);
function build_page($method)
{
global $mystep, $req, $db, $tpl, $power_id, $tpl_info, $setting;
$tpl_info['idx'] = "user_power_" . ($method == "list" ? "list" : "input");
$tpl_tmp = $mystep->getInstance("MyTpl", $tpl_info);
示例6: admindel
function admindel()
{
$PIO = PMCLibrary::getPIOInstance();
$FileIO = PMCLibrary::getFileIOInstance();
$PMS = PMCLibrary::getPMSInstance();
$pass = isset($_POST['pass']) ? $_POST['pass'] : '';
// 管理者密碼
$page = isset($_REQUEST['page']) ? $_REQUEST['page'] : 0;
// 切換頁數
$onlyimgdel = isset($_POST['onlyimgdel']) ? $_POST['onlyimgdel'] : '';
// 只刪圖
$modFunc = '';
$delno = $thsno = array();
$delflag = isset($_POST['func']) && $_POST['func'] == 'delete' && isset($_POST['clist']);
// 是否有「刪除」勾選
$thsflag = isset($_POST['stop']);
// 是否有「停止」勾選
$is_modified = false;
// 是否改寫檔案
$message = '';
// 操作後顯示訊息
if (isset($_POST['func']) && isset($_POST['clist'])) {
$PMS->useModuleMethods('AdminFunction', array('run', &$_POST['clist'], $_POST['func'], &$message));
}
// "AdminFunction" Hook Point
// 刪除文章區塊
if ($delflag) {
$delno = array_merge($delno, $_POST['clist']);
if ($onlyimgdel != 'on') {
$PMS->useModuleMethods('PostOnDeletion', array($delno, 'backend'));
}
// "PostOnDeletion" Hook Point
$files = $onlyimgdel != 'on' ? $PIO->removePosts($delno) : $PIO->removeAttachments($delno);
$FileIO->updateStorageSize(-$FileIO->deleteImage($files));
deleteCache($delno);
$is_modified = true;
}
// 討論串停止區塊
if ($thsflag) {
$thsno = array_merge($thsno, $_POST['stop']);
$threads = $PIO->fetchPosts($thsno);
// 取得文章
foreach ($threads as $th) {
$flgh = $PIO->getPostStatus($th['status']);
$flgh->toggle('TS');
$PIO->setPostStatus($th['no'], $flgh->toString());
}
$is_modified = true;
}
if (($delflag || $thsflag) && $is_modified) {
$PIO->dbCommit();
}
// 無論如何都有檔案操作,回寫檔案
$line = $PIO->fetchPostList(0, $page * ADMIN_PAGE_DEF, ADMIN_PAGE_DEF);
// 分頁過的文章列表
$posts_count = count($line);
// 迴圈次數
$posts = $PIO->fetchPosts($line);
// 文章內容陣列
echo '<input type="hidden" name="mode" value="admin" />
<input type="hidden" name="admin" value="del" />
<div style="text-align: left;">' . _T('admin_notices') . '</div>
<div>' . $message . '</div>
<style type="text/css" scoped="scoped">
.html5Table {border-collapse:collapse; border-spacing: 1; margin: 0px auto;}
.html5Table TD {border:2px solid gray }
</style>
<table class="html5Table" >
<tr style="background-color: #6080f6;">' . _T('admin_list_header') . '</tr>
';
for ($j = 0; $j < $posts_count; $j++) {
$bg = $j % 2 ? 'ListRow1_bg' : 'ListRow2_bg';
// 背景顏色
extract($posts[$j]);
// 修改欄位樣式
$now = preg_replace('/.{2}\\/(.{5})\\(.+?\\)(.{5}).*/', '$1 $2', $now);
$name = htmlspecialchars(str_cut(html_entity_decode(strip_tags($name)), 8));
$sub = htmlspecialchars(str_cut(html_entity_decode($sub), 8));
if ($email) {
$name = "<a href=\"mailto:{$email}\">{$name}</a>";
}
$com = str_replace('<br />', ' ', $com);
$com = htmlspecialchars(str_cut(html_entity_decode($com), 20));
// 討論串首篇停止勾選框 及 模組功能
$modFunc = $THstop = ' ';
$PMS->useModuleMethods('AdminList', array(&$modFunc, $posts[$j], $resto));
// "AdminList" Hook Point
if ($resto == 0) {
// $resto = 0 (即討論串首篇)
$flgh = $PIO->getPostStatus($status);
$THstop = '<input type="checkbox" name="stop[]" value="' . $no . '" />' . ($flgh->exists('TS') ? _T('admin_stop_btn') : '');
}
// 從記錄抽出附加圖檔使用量並生成連結
if ($ext && $FileIO->imageExists($tim . $ext)) {
$clip = '<a href="' . $FileIO->getImageURL($tim . $ext) . '" target="_blank">' . $tim . $ext . '</a>';
$size = $FileIO->getImageFilesize($tim . $ext);
$thumbName = $FileIO->resolveThumbName($tim);
if ($thumbName != false) {
$size += $FileIO->getImageFilesize($thumbName);
}
//.........这里部分代码省略.........
示例7: updateTopicCache
public function updateTopicCache($tid)
{
$key = 'topic/thread/' . getDirsById($tid) . '/detail';
deleteCache($key);
}
示例8: deleteShareIds
public function deleteShareIds($uid)
{
deleteCache('user/' . getDirsById($uid) . '/shares');
}
示例9: ModulePage
//.........这里部分代码省略.........
die('[Error] unknown action.');
}
}
} else {
die('[Error] unauthenticated action.');
}
}
// 非 AJAX 推文,產出表單供填寫
if (!isset($_POST['comm'])) {
echo $this->printStaticForm(intval($_GET['no']));
} else {
// 處理推文
// 傳送方法不正確
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
die(_T('regist_notpost'));
}
// 查IP
$baninfo = '';
$ip = getREMOTE_ADDR();
$host = gethostbyaddr($ip);
if (BanIPHostDNSBLCheck($ip, $host, $baninfo)) {
die(_T('regist_ipfiltered', $baninfo));
}
$name = CleanStr($_POST['name']);
$comm = CleanStr($_POST['comm']);
if (strlen($name) > 30) {
die($this->_T('maxlength'));
}
// 名稱太長
if (strlen($comm) > 160) {
die($this->_T('maxlength'));
}
// 太多字
if (strlen($comm) == 0) {
die($this->_T('nocomment'));
}
// 沒打字
$name = str_replace(array(_T('trip_pre'), _T('admin'), _T('deletor')), array(_T('trip_pre_fake'), '"' . _T('admin') . '"', '"' . _T('deletor') . '"'), $name);
// 生成ID, Trip 等識別資訊
$pushID = $this->getID();
$pushtime = gmdate('y/m/d H:i', time() + intval(TIME_ZONE) * 3600);
if (preg_match('/(.*?)[##](.*)/u', $name, $regs)) {
$cap = strtr($regs[2], array('&' => '&'));
$salt = strtr(preg_replace('/[^\\.-z]/', '.', substr($cap . 'H.', 1, 2)), ':;<=>?@[\\]^_`', 'ABCDEFGabcdef');
$name = $regs[1] . _T('trip_pre') . substr(crypt($cap, $salt), -10);
}
if (!$name || preg_match("/^[ | |]*\$/", $name)) {
if (ALLOW_NONAME) {
$name = DEFAULT_NONAME;
} else {
die(_T('regist_withoutname'));
}
// 不接受匿名
}
if (ALLOW_NONAME == 2) {
// 強制砍名
$name = preg_match('/(\\' . _T('trip_pre') . '.{10})/', $name, $matches) ? $matches[1] . ':' : DEFAULT_NONAME . ':';
} else {
$name .= ':';
}
$pushpost = "{$name} {$comm} ({$pushID} {$pushtime})";
// 推文主體
$post = $PIO->fetchPosts($_GET['no']);
if (!count($post)) {
die('[Error] Post does not exist.');
}
// 被推之文章不存在
$parentNo = $post[0]['resto'] ? $post[0]['resto'] : $post[0]['no'];
$threads = array_flip($PIO->fetchThreadList());
$threadPage = floor($threads[$parentNo] / PAGE_DEF);
$p = $parentNo == $post[0]['no'] ? $post : $PIO->fetchPosts($parentNo);
// 取出首篇
$flgh = $PIO->getPostStatus($p[0]['status']);
if ($flgh->exists('TS')) {
die('[Error] ' . _T('regist_threadlocked'));
}
// 首篇禁止回應/同時表示禁止推文
$post[0]['com'] .= (strpos($post[0]['com'], $this->PUSHPOST_SEPARATOR . '<br />') === false ? '<br />' . $this->PUSHPOST_SEPARATOR : '') . '<br /> ' . $pushpost;
$flgh2 = $PIO->getPostStatus($post[0]['status']);
$flgh2->plus('mppCnt');
// 推文次數+1
$PIO->updatePost($_GET['no'], array('com' => $post[0]['com'], 'status' => $flgh2->toString()));
// 更新推文
$PIO->dbCommit();
// mod_audit logcat
$this->callCHP('mod_audit_logcat', array(sprintf('[%s] No.%d %s (%s)', __CLASS__, $_GET['no'], $comm, $pushID)));
if (STATIC_HTML_UNTIL == -1 || $threadPage <= STATIC_HTML_UNTIL) {
// 僅更新討論串出現那頁
updatelog(0, $threadPage, true);
}
deleteCache(array($parentNo));
// 刪除討論串舊快取
if (isset($_POST['ajaxmode'])) {
echo '+OK ', $pushpost;
} else {
header('HTTP/1.1 302 Moved Temporarily');
header('Location: ' . fullURL() . PHP_SELF2 . '?' . time());
}
}
}
示例10: deleteCache
}
deleteCache("admin_cat");
break;
case "add_ok":
case "edit_ok":
if (count($_POST) == 0) {
$goto_url = $setting['info']['self'];
} else {
if ($method == "add_ok") {
$log_info = $setting['language']['plugin_admin_cat_add'];
$db->insert($setting['db']['pre'] . "admin_cat", $_POST, true);
} else {
$log_info = $setting['language']['plugin_admin_cat_edit'];
$db->update($setting['db']['pre'] . "admin_cat", $_POST, array("id", "n=", $id));
}
deleteCache("admin_cat");
}
break;
default:
$goto_url = $setting['info']['self'];
}
if (!empty($log_info)) {
write_log($log_info, "id=" . $id);
includeCache("admin_cat");
$admin_cat = json_encode(chg_charset($admin_cat, $setting['gen']['charset'], "utf-8"));
echo <<<mystep
<script language="javascript">
try{
\tparent.admin_cat = {$admin_cat};
\tparent.setNav();
} catch(e){}
示例11: db_delete_post
function db_delete_post($mod_delete_post_xid, $db_query)
{
$mod_delete_post_xid_quoted = "'" . mysql_real_escape_string($mod_delete_post_xid, $db_query) . "'";
$db = databaseConnect('fotos_root_usr', 'fotos_root_pass', 'fotos');
// averiguamos el true id
$delete_post_stmt = "SELECT id FROM posts WHERE xid={$mod_delete_post_xid_quoted} AND is_deleted='0'";
// print $delete_post_stmt . "<br>\n";
$delete_rs = executeQuery(Bnumber(), $db, $delete_post_stmt, "canBeZero");
if ($delete_rs === FALSE) {
gotoHomeIf(NULL, NULL, 'redirect');
}
$delete_row = mysql_fetch_row($delete_rs);
$mod_delete_post_id = $delete_row[0];
// seleccionamos las fotos, y las borramos una a una
$delete_pic_stmt = "SELECT pic_id FROM posts_pics pp WHERE pp.post_id = '{$mod_delete_post_id}' AND pp.is_deleted='0'";
//print $delete_pic_stmt . "<br>\n";
$pics_rs = executeQuery(Bnumber(), $db, $delete_pic_stmt, "canBeZero");
if ($pics_rs) {
while ($pic_row = mysql_fetch_row($pics_rs)) {
//print $pic_row[0] . "<br>\n";
db_delete_pic($mod_delete_post_xid, "000000000", $db, $mod_delete_post_id, $pic_row[0]);
}
mysql_free_result($pics_rs);
}
// quitamos las asociaciones a tags
$delete_tags_stmt = "SELECT tp.tag_id FROM tags_posts tp WHERE tp.post_id = '{$mod_delete_post_id}' AND tp.is_deleted='0'";
//print $delete_tags_stmt . "<br>\n";
$tags_rs = executeQuery(Bnumber(), $db, $delete_tags_stmt, "canBeZero");
if ($tags_rs) {
while ($tag_row = mysql_fetch_row($tags_rs)) {
//print "tag: " . $tag_row[0] . "<br>\n";
db_delete_tag($tag_row[0], $mod_delete_post_id, $db);
}
}
// marcamos los tags como borrados si no apuntan a nadie mas
// lo ultimo es marcar el post como borrado, para poder repetir en caso de error
$delete_post_stmt = "UPDATE posts SET is_deleted='1',delete_date=now() WHERE id='{$mod_delete_post_id}' AND is_deleted='0'";
//print $delete_post_stmt . "<br>\n";
executeNonQuery(Bnumber(), $db, $delete_post_stmt);
//$link = substr($_SERVER['HTTP_REFERER'], strlen("http://" . $_SERVER['HTTP_HOST']), strlen($_SERVER['HTTP_REFERER']) - strlen("http://" . $_SERVER['HTTP_HOST']));
deleteCache(DIR_HOME . "/cache/{$mod_delete_post_xid}");
// header("Refresh: 0; URL=" URL_HOME . "/a/display/$mod_delete_post_xid");
gotoHomeIf(NULL, NULL, 'redirect');
// exit;
}
示例12: array
if ($id_list[$i]['new'] == 0) {
break;
}
$db->select($pre_org . "news_detail", "*", array("news_id", "n=", $id_list[$i]['old']), array("order" => "news_id asc, page asc"));
while ($record = $db->GetRS()) {
$record['id'] = 0;
$record['news_id'] = $id_list[$i]['new'];
$db2->insert($pre_dst . "news_detail", $record, true);
}
$db->delete($pre_org . "news_show", array("news_id", "n=", $id_list[$i]['old']));
$db->delete($pre_org . "news_detail", array("news_id", "n=", $id_list[$i]['old']));
}
}
}
}
deleteCache("news_cat");
break;
default:
build_page();
}
if (!empty($log_info)) {
write_log($log_info, "cat_id={$cat_id}");
$goto_url = $req->getServer("PHP_SELF");
}
$mystep->pageEnd(false);
function build_page()
{
global $mystep, $req, $db, $setting;
$tpl_info = array("idx" => "trans", "style" => "../plugin/" . basename(realpath(dirname(__FILE__))) . "/tpl/", "path" => ROOT_PATH . "/" . $setting['path']['template']);
$tpl = $mystep->getInstance("MyTpl", $tpl_info);
$max_count = count($GLOBALS['website']);
示例13: join
if (count($_POST) == 0) {
$goto_url = $setting['info']['self'];
} else {
$log_info = $setting['language']['admin_web_plugin_setup'];
if (isset($_POST['subweb'])) {
if ($_POST['subweb'][0] == "all") {
$subweb = "";
} else {
$subweb = "," . join($_POST['subweb'], ",") . ",";
}
} else {
$subweb = ",";
}
$db->update($setting['db']['pre'] . "plugin", array("subweb" => $subweb), array("idx", "=", $idx));
MultiDel(ROOT_PATH . "/" . $setting['path']['cache'] . "/plugin/");
deleteCache("plugin");
MultiDel(ROOT_PATH . "/" . $setting['path']['cache'] . "/plugin/");
if (isset($_POST['plugin_setting'])) {
include $plugin_path . $idx . "/config.php";
foreach ($_POST['plugin_setting'][$idx] as $key => $value) {
if (is_array($value)) {
$_POST['plugin_setting'][$idx][$key] = implode(",", $value);
}
if (isset($_POST['plugin_setting'][$idx][$key . "_r"])) {
if (empty($_POST['plugin_setting'][$idx][$key])) {
$_POST['plugin_setting'][$idx][$key] = $plugin_setting[$idx][$key];
}
unset($_POST['plugin_setting'][$idx][$key . "_r"]);
}
}
$result = <<<mystep
示例14: array
$db->delete($setting['db']['pre'] . "links", array("id", "n=", $id));
deleteCache("link");
break;
case "add_ok":
case "edit_ok":
if (count($_POST) == 0) {
$goto_url = $setting['info']['self'];
} else {
if ($method == "add_ok") {
$log_info = $setting['language']['admin_func_link_add'];
$db->insert($setting['db']['pre'] . "links", $_POST, true);
} else {
$log_info = $setting['language']['admin_func_link_edit'];
$db->update($setting['db']['pre'] . "links", $_POST, array("id", "n=", $id));
}
deleteCache("link");
}
break;
default:
break;
}
if (!empty($log_info)) {
write_log($log_info, "id={$id}");
$goto_url = basename($req->getServer($method == "delete" ? "HTTP_REFERER" : "PHP_SELF"));
}
$mystep->pageEnd(false);
function build_page($method)
{
global $mystep, $req, $db, $tpl, $tpl_info, $setting, $id, $idx, $web_id;
$tpl_info['idx'] = "func_link_" . ($method == "list" ? "list" : "input");
$tpl_tmp = $mystep->getInstance("MyTpl", $tpl_info);
示例15: removeGoods
public function removeGoods()
{
$goods_id = intval($_REQUEST['goods_id']);
$goods_data = D("ShareGoods")->where("goods_id=" . $goods_id)->find();
D("ShareGoods")->where("goods_id=" . $goods_id)->delete();
//开始同步data
$this->init_share_data($goods_data['share_id']);
$err = D()->getDbError();
if ($err) {
$result['isErr'] = 1;
$result['content'] = $err;
} else {
Vendor('common');
if ($goods_data['base_id'] == 0) {
$count = D("ShareGoods")->where("base_id=" . $goods_id)->count();
if ($count == 0) {
deleteShareImg(FANWE_ROOT . $goods_data['img']);
}
}
$share_id = $goods_data['share_id'];
deleteCache('share/' . getDirsById($share_id) . '/imgs');
deleteCache('share/' . getDirsById($share_id) . '/detail');
FS('Share')->updateShareCache($share_id, 'imgs');
$result['isErr'] = 0;
}
die(json_encode($result));
}