예제 #1
0
파일: ads.php 프로젝트: Ryan007/mybb
        $smarty->assign('src', $src);
    }
    if ($ads_arr['media_type'] == 0) {
        $smarty->assign('media_type', $_LANG['ad_img']);
    } elseif ($ads_arr['media_type'] == 1) {
        $smarty->assign('media_type', $_LANG['ad_flash']);
    } elseif ($ads_arr['media_type'] == 2) {
        $smarty->assign('media_type', $_LANG['ad_html']);
    } elseif ($ads_arr['media_type'] == 3) {
        $smarty->assign('media_type', $_LANG['ad_text']);
    }
    $smarty->assign('ur_here', $_LANG['ads_edit']);
    $smarty->assign('action_link', array('href' => 'ads.php?act=list', 'text' => $_LANG['ad_list']));
    $smarty->assign('form_act', 'update');
    $smarty->assign('action', 'edit');
    $smarty->assign('position_list', get_position_list());
    $smarty->assign('ads', $ads_arr);
    assign_query_info();
    $smarty->display('ads_info.htm');
} elseif ($_REQUEST['act'] == 'update') {
    admin_priv('ad_manage');
    /* 初始化变量 */
    $id = !empty($_POST['id']) ? intval($_POST['id']) : 0;
    $type = !empty($_POST['media_type']) ? intval($_POST['media_type']) : 0;
    if ($_POST['media_type'] == '0') {
        $ad_link = !empty($_POST['ad_link']) ? trim($_POST['ad_link']) : '';
    } else {
        $ad_link = !empty($_POST['ad_link2']) ? trim($_POST['ad_link2']) : '';
    }
    /* 获得广告的开始时期与结束日期 */
    $start_time = local_strtotime($_POST['start_time']);
예제 #2
0
            }
        }
    }
    assign_query_info();
    $smarty->assign('ur_here', $_LANG['03_template_setup']);
    $smarty->assign('curr_template_file', $curr_template);
    $smarty->assign('temp_options', $temp_options);
    $smarty->assign('temp_regions', $temp_regions);
    $smarty->assign('cate_goods', $cate_goods);
    $smarty->assign('brand_goods', $brand_goods);
    $smarty->assign('cat_articles', $cat_articles);
    $smarty->assign('ad_positions', $ad_positions);
    $smarty->assign('arr_cates', cat_list(0, 0, true));
    $smarty->assign('arr_brands', get_brand_list());
    $smarty->assign('arr_article_cats', article_cat_list(0, 0, true));
    $smarty->assign('arr_ad_positions', get_position_list());
    $smarty->display('template_setup.htm');
}
/*------------------------------------------------------ */
//-- 提交模板内容设置
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'setting') {
    admin_priv('template_setup');
    $curr_template = $_CFG['template'];
    $db->query("DELETE FROM " . $ecs->table('template') . " WHERE remarks = '' AND filename = '{$_POST['template_file']}' AND theme = '{$curr_template}'");
    /* 先处理固定内容 */
    foreach ($_POST['regions'] as $key => $val) {
        $number = isset($_POST['number'][$key]) ? intval($_POST['number'][$key]) : 0;
        if (!in_array($key, $GLOBALS['dyna_libs']) and (isset($_POST['display'][$key]) and $_POST['display'][$key] == 1 or $number > 0)) {
            $sql = "INSERT INTO " . $ecs->table('template') . "(theme, filename, region, library, sort_order, number)" . " VALUES " . "('{$curr_template}', '{$_POST['template_file']}', '{$val}', '" . $_POST['map'][$key] . "', '" . @$_POST['sort_order'][$key] . "', '{$number}')";
            $db->query($sql);