Esempio n. 1
0
     $n = $colarr[$i];
     $valarr[$n] = be("all", $n);
 }
 if (strlen($valarr['d_addtime']) != 10) {
     $valarr['d_addtime'] = time();
 }
 if ($valarr['d_time'] != '') {
     $valarr['d_time'] = strtotime($valarr['d_time']);
 } else {
     $valarr['d_time'] = $valarr['d_addtime'];
 }
 if ($uptime == '1') {
     $valarr['d_time'] = time();
 }
 if (isN($valarr['d_enname'])) {
     $valarr['d_enname'] = Hanzi2Pinyin($valarr['d_name']);
 }
 if (isN($valarr['d_letter'])) {
     $valarr['d_letter'] = strtoupper(substring($valarr['d_enname'], 1));
 }
 unset($pinyins);
 if ($uptag == '1' && $valarr['d_tag'] == '') {
     $valarr['d_tag'] = getTag($valarr['d_name'], $valarr['d_content']);
 }
 $playurl = be('arr', 'playurl', ',,,');
 $playfrom = be('arr', 'playfrom');
 $playserver = be('arr', 'playserver');
 $playnote = be('arr', 'playnote');
 $playurlarr = explode(',,,', $playurl);
 $playfromarr = explode(',', $playfrom);
 $playserverarr = explode(',', $playserver);
Esempio n. 2
0
function save()
{
    global $db;
    $a_id = be("post", "a_id");
    $a_title = be("post", "a_title");
    $a_subtitle = be("post", "a_subtitle");
    $a_entitle = be("post", "a_entitle");
    $a_type = be("post", "a_type");
    $a_content = be("post", "a_content");
    $a_author = be("post", "a_author");
    $a_color = be("post", "a_color");
    $a_hits = be("post", "a_hits");
    $a_dayhits = be("post", "a_dayhits");
    $a_weekhits = be("post", "a_weekhits");
    $a_monthhits = be("post", "a_monthhits");
    $a_hide = be("post", "a_hide");
    $a_addtime = be("post", "a_addtime");
    $a_time = be("post", "a_time");
    $a_hitstime = be("post", "a_hitstime");
    $a_pic = be("post", "pic");
    $a_from = be("post", "a_from");
    $backurl = be("post", "backurl");
    $a_letter = be("post", "a_letter");
    $flag = be("post", "flag");
    $a_topic = be("post", "a_topic");
    $a_addtime = date('Y-m-d H:i:s', time());
    $a_time = date('Y-m-d H:i:s', time());
    if (isN($a_title)) {
        echo "标题不能为空";
        exit;
    }
    if (!isNum($a_type)) {
        echo "分类不能为空";
        exit;
    }
    if (!isNum($a_hits)) {
        $a_hits = 0;
    }
    if (!isNum($a_hide)) {
        $a_hide = 0;
    }
    if (!isNum($a_topic)) {
        $a_topic = 0;
    }
    if (!isNum($a_dayhits)) {
        $a_dayhits = 0;
    }
    if (!isNum($a_weekhits)) {
        $a_weekhits = 0;
    }
    if (!isNum($a_monthhits)) {
        $a_monthhits = 0;
    }
    if (isN($a_entitle)) {
        $a_entitle = Hanzi2Pinyin($a_title);
    }
    if (isN($a_letter)) {
        $a_letter = strtoupper(substring($a_entitle, 1));
    }
    if (strpos($a_entitle, "*") > 0 || strpos($a_entitle, ":") > 0 || strpos($a_entitle, "?") > 0 || strpos($a_entitle, "\"") > 0 || strpos($a_entitle, "<") > 0 || strpos($a_entitle, ">") > 0 || strpos($a_entitle, "|") > 0 || strpos($a_entitle, "\\") > 0) {
        echo "名称和拼音名称中: 不能出现英文输入状态下的 * : ? \" < > | \\ 等特殊符号";
        exit;
    }
    if ($flag == "edit") {
        $db->Update("{pre}art", array("a_title", "a_subtitle", "a_entitle", "a_letter", "a_from", "a_type", "a_content", "a_author", "a_color", "a_hits", "a_dayhits", "a_weekhits", "a_monthhits", "a_hide", "a_time", "a_pic", "a_topic"), array($a_title, $a_subtitle, $a_entitle, $a_letter, $a_from, $a_type, $a_content, $a_author, $a_color, $a_hits, $a_dayhits, $a_weekhits, $a_monthhits, $a_hide, $a_time, $a_pic, $a_topic), "a_id=" . $a_id);
    } else {
        $backurl = "admin_art.php?action=add";
        $db->Add("{pre}art", array("a_title", "a_subtitle", "a_entitle", "a_letter", "a_from", "a_type", "a_content", "a_author", "a_color", "a_hits", "a_dayhits", "a_weekhits", "a_monthhits", "a_addtime", "a_time", "a_pic", "a_topic"), array($a_title, $a_subtitle, $a_entitle, $a_letter, $a_from, $a_type, $a_content, $a_author, $a_color, $a_hits, $a_dayhits, $a_weekhits, $a_monthhits, $a_addtime, $a_time, $a_pic, $a_topic));
    }
    echo "保存完毕";
}