コード例 #1
0
ファイル: admin_interface.php プロジェクト: klarclm/sgv
 if (!isNum($a_up)) {
     $a_up = 0;
 }
 if (!isNum($a_down)) {
     $a_down = 0;
 }
 if (isN($a_enname)) {
     $a_enname = Hanzi2PinYin($a_name);
 }
 if (strpos($a_enname, "*") > 0 || strpos($a_enname, ":") > 0 || strpos($a_enname, "?") > 0 || strpos($a_enname, "\"") > 0 || strpos($a_enname, "<") > 0 || strpos($a_enname, ">") > 0 || strpos($a_enname, "|") > 0 || strpos($a_enname, "\\") > 0) {
     echo "名称和拼音名称中: 不能出现英文输入状态下的 * : ? \" < > | \\ 等特殊符号err";
     exit;
 }
 $a_letter = strtoupper(substring($a_enname, 1));
 if (!isNum($a_type)) {
     $a_type = gettypere("art", $a_type);
 }
 if ($a_type == 0) {
     echo "没有找到转换的分类err";
     exit;
 }
 if ($MAC['collect']['art']['psernd'] == 1) {
     $a_content = repPseRnd('art', $a_content, 0);
 }
 if ($MAC['collect']['art']['psesyn'] == 1) {
     $a_content = repPseSyn('art', $a_content);
 }
 $inrule = $MAC['collect']['art']['inrule'];
 $uprule = $MAC['collect']['art']['uprule'];
 $filter = $MAC['collect']['art']['filter'];
 if (strpos(',' . $filter, $d_name)) {
コード例 #2
0
function art()
{
    global $db, $safepass, $pass;
    if ($safepass != $pass) {
        echo "非法使用";
        exit;
    }
    $a_id = be("all", "a_id");
    $a_title = be("all", "a_title");
    $a_subtitle = be("all", "a_subtitle");
    $a_entitle = be("all", "a_entitle");
    $a_type = be("all", "a_type");
    $a_content = be("all", "a_content");
    $a_author = be("all", "a_author");
    $a_color = be("all", "a_color");
    $a_hits = be("all", "a_hits");
    $a_dayhits = be("all", "a_dayhits");
    $a_weekhits = be("all", "a_weekhits");
    $a_monthhits = be("all", "a_monthhits");
    $a_from = be("all", "a_from");
    $a_hide = be("all", "a_hide");
    $a_addtime = be("all", "a_addtime");
    $a_time = be("all", "a_time");
    $a_hitstime = be("all", "a_hitstime");
    $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 "文章标题不能为空err";
        exit;
    }
    if (isN($a_type)) {
        echo "文章分类不能为空err";
        exit;
    }
    if (!isNum($a_hits)) {
        $a_hits = 0;
    }
    if (isN($a_hide)) {
        $a_hide = 0;
    } else {
        $a_hide = 1;
    }
    if (isN($a_entitle)) {
        $a_entitle = Hanzi2PinYin($a_title);
    }
    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 "名称和拼音名称中: 不能出现英文输入状态下的 * : ? \" < > | \\ 等特殊符号err";
        exit;
    }
    $a_letter = strtoupper(substring($a_entitle, 1));
    if (!isNum($a_type)) {
        $a_type = gettypere("art", $a_type);
    }
    if ($a_type == 0) {
        echo "没有找到转换的分类err";
        exit;
    }
    $sql = "SELECT * FROM {pre}art WHERE a_title ='" . $a_title . "' ";
    $row = $db->getRow($sql);
    if (!$row) {
        $db->Add("{pre}art", array("a_title", "a_subtitle", "a_entitle", "a_type", "a_letter", "a_content", "a_author", "a_color", "a_from", "a_hits", "a_addtime", "a_time"), array($a_title, $a_subtitle, $a_entitle, $a_type, $a_letter, $a_content, $a_author, $a_color, $a_from, $a_hits, $a_addtime, $a_time));
    } else {
        $db->Update("{pre}art", array("a_content"), array($a_content), "a_id=" . $row["a_id"]);
    }
    unset($row);
    echo "ok";
}