public function deallink()
 {
     $channelid = intval(I('post.id'));
     $channel['link'] = I('post.link');
     $channel['isoutside'] = intval(I('post.isoutside'));
     $Channels = D('channels');
     $res = $Channels->where("id={$channelid}")->save($channel);
     writeChannelsCache();
     if ($res === false) {
         $this->error('更新失败');
     } else {
         $this->success('更新成功', 'set');
     }
 }
示例#2
0
        $channel['ishidden'] = $hide;
        $db->row_update("channels", $channel, "id={$channelid}");
        writeChannelsCache();
        //_header_("location:admin.php?inc=channel&action=set");
        printRes($_AL['channel.ajax.set.succeed'] . "<script>setTimeout(function(){reloadTop('admin.php?inc=channel&action=set');},1000);</script>");
        //succeedFlag();
        break;
    case "savepage":
        $channelid = intval($_POST['channelid']);
        $content = strFilter($_POST['content']);
        $channel['content'] = $content;
        $db->row_update("channels", $channel, "id={$channelid}");
        writeChannelsCache();
        printRes($_AL['channel.ajax.edit.succeed'] . "<script>setTimeout(function(){reloadSelf('admin.php?inc=channel&action=set');},2000);</script>");
        //succeedFlag();
        break;
    case "savelink":
        $channelid = intval($_POST['channelid']);
        $link = strFilter($_POST['link']);
        $target = intval($_POST['target']);
        $channel['link'] = $link;
        $channel['target'] = $target;
        $db->row_update("channels", $channel, "id={$channelid}");
        writeChannelsCache();
        printRes($_AL['channel.ajax.edit.succeed'] . "<script>setTimeout(function(){reloadSelf('admin.php?inc=channel&action=set');},2000);</script>");
        //succeedFlag();
        break;
    default:
        echo $_AL['all.noaction'];
        break;
}
示例#3
0
function reBuildLang()
{
    global $db, $_SYS;
    $rows = $db->row_select("langs", "ishidden=0", 0, "*", "isdefault desc,ordernum");
    $langs = array();
    foreach ($rows as $row) {
        $_SYS['alangid'] = $row['id'];
        writeSettingsCache();
        writeLinksCache();
        writeChannelsCache();
        writeProductsCateCache();
        writeContactCache();
        writeVotesCache();
        writeTemplatevarsCache();
    }
}