function editall()
{
    global $db;
    $t_id = be("arr", "ids");
    $ids = explode(",", $t_id);
    foreach ($ids as $id) {
        $t_flag = be("post", "t_flag" . $id);
        $t_sort = be("post", "disp_order" . $id);
        if (isN($t_sort)) {
            $t_sort = $db->getOne("SELECT MAX(disp_order) FROM {pre}vod_topic_items") + 1;
        }
        if (!isNum($t_sort)) {
            echo "信息填写不完整!";
            exit;
        }
        $db->Update("{pre}vod_topic_items", array("flag", "disp_order"), array($t_flag, $t_sort), "id=" . $id);
    }
    updateCacheFile();
    $topic_id = getBody(getReferer(), 'topic_id=', '&');
    if (isN($topic_id)) {
        $topic_id = getBodys(getReferer(), 'topic_id=');
    }
    if (!isN($topic_id)) {
        replaceTopRecommend($topic_id);
    }
    echo "修改完毕";
}
示例#2
0
function bdtopic()
{
    global $db, $action, $flag, $show, $id, $name, $ajaxcontent, $tid, $ttype, $thit, $ttopic, $dbtype;
    $bd = " ";
    $name = '';
    $keyword = be("all", "keyword");
    if ($dbtype == 1) {
        $bd = " and t_bdtype=1 ";
        $name = '悦单';
    }
    if ($dbtype == 2) {
        $bd = " and t_bdtype=2 ";
        $name = '悦榜';
    }
    if (!isN($keyword)) {
        $bd = $bd . " and t_name like '%" . $keyword . "%' ";
    }
    if ($show == 1) {
        $str = "<input type='text' name='bd_keyword' id='bd_keyword' value='" . $keyword . "' size='30' ><input type='button' value='查询' onclick=\"setdayBDkewyowrd('bd','" . $id . "','vod','" . $dbtype . "',document.getElementById('bd_keyword').value);\"></br><select style='width:155px' id=\"ajaxcontent\" name=\"ajaxcontent\"><option value=\"0\">请选择" . $name . "</option>" . makeSelectWhere("{pre}" . $flag . "_topic", "t_id", "t_name", "t_name,t_sort", "", "&nbsp;|&nbsp;&nbsp;", "", " where t_id > 4 " . $bd . "  ") . "</select><input type=\"button\" value=\"确定\" onclick=\"ajaxsubmit('" . $id . "','" . $action . "','" . $flag . "');\" > <input type=\"button\" value=\"取消\" onclick=\"closew();\" >";
        echo $str;
    } else {
        if ($show == 2) {
            //		$db->query ("{pre}".$flag ,array($ttopic),array($ajaxcontent),$tid."=".$id);
            $tab = "{pre}vod_topic_items";
            $colarr = array("topic_id", "vod_id");
            if (isNum($id) && isNum($ajaxcontent)) {
                $valarr = array($ajaxcontent, $id);
                $db->Add($tab, $colarr, $valarr);
            }
            replaceTopRecommend($ajaxcontent);
            echo "bd" . $id . "\$<script language=\"javascript\">alert('添加成功');</script>";
        }
    }
}