Emlog非插件实现投稿功能

emlog教程 2020-08-25

????getSorts();?>

????

???????

????

????

  • ???±??? *

  • ????

  • ???????

  • ????

  • ?????

  • ????

  • ??????????????????????300???????????????б????html?????????е????????????

  • ????

    ????

  • ????

  • ?? ? ??

    SheLi

  • ????

  • ????

    ????

    ????

    ???????

      ????1???????д????д????????飬?????漰??????????html????

      ????2????????????????棬????????μ??????????????????????Щ??????????????????????

      ????3??????????????????????????????????????????????д???????????????

      ????4???????????????????????????????????????????????????10?????????????30???????

      ????5????????????? “????”??”????”??????????????????????????????(????????????????????????)??

      ????

    ????

    Copyright ? ???????

    ????

    ????

    ????$Log_Model = new Log_Model();

    ????$Tag_Model = new Tag_Model();

    ????$title = isset($_POST[‘title’]) ? addslashes(trim($_POST[‘title’])) : ”;

    ????$content = isset($_POST[‘text’]) ? addslashes(trim($_POST[‘text’])) : ”;

    ????$excerpt = isset($_POST[‘excerpt’]) ? addslashes(trim($_POST[‘excerpt’])) : ”;

    ????$tags = isset($_POST[‘tags’]) ? addslashes(trim($_POST[‘tags’])) : ”;

    ????$imgcode = isset($_POST[‘imgcode’]) ? addslashes(trim(strtoupper($_POST[‘imgcode’]))) : ”;

    ????$slCode = ‘SHELI’;

    ????$author = ”;

    ????$sortid = isset($_POST[‘sortid’]) ? intval($_POST[‘sortid’]) : $config[‘sort’];

    ????$date = time() + Option::get(‘timezone’) * 3600;

    ????$sb_title = mysql_query(“select title from emlog_blog where title=’$title’ limit 1″);

    ????$sb_excerpt = mysql_query(“select title from emlog_blog where excerpt=’$excerpt’ limit 1″);

    ????if(empty($title) || strlen($title) 90 || mysql_fetch_array($sb_title)){emMsg(‘????????????????????????????
    1??????10????????30????
    2?????????’,’javascript:history.back(-1);’);

    ????}elseif(strlen($tags) > 30){emMsg(‘?????????????????????10????’,’javascript:history.back(-1);’);

    ????}elseif(!empty($excerpt) && preg_match(“/^[A-Za-z0-9]+\.[A-Za-z0-9]+[/=\?%\-&_~`@[\]\??:+!]*([^\”])*$/”,$excerpt) == false){emMsg(‘??????????????????????????????
    1????????http://
    2??????????????
    3?????????’,’javascript:history.back(-1);’);

    ????//}elseif(mysql_fetch_array($sb_excerpt)){emMsg(‘?????????????????????????????????’,’javascript:history.back(-1);’);

    ????}elseif(empty($content) || strlen($content)

    ????}elseif(preg_match(“/^[0-9]*[1-9][0-9]*$/”,$sortid)==false &&$config[“sort”] ==’0′){emMsg(‘??????????????’,’javascript:history.back(-1);’);

    ????}elseif($imgcode != $slCode){emMsg(‘??????????????’,’javascript:history.back(-1);’);

    ????}

    ????$logData = array(

    ????’title’ => $title,

    ????’alias’ => ”,

    ????’content’ => $content,

    ????’excerpt’ => $excerpt,

    ????’author’ => ‘2’,//???????ID

    ????’date’ => $date,

    ????’top’=> ‘n’,

    ????’sortop’=> ‘n’,

    ????’sortid’=> $sortid,

    ????’allow_remark’ => ‘y’,

    ????’hide’ => ‘y’, //n?????????y???????

    ????’checked’ => ‘n’,//n?????????y???????

    ????’password’ => ”

    ????);

    ????$blogid = $Log_Model->addlog($logData);

    ????$Tag_Model->addTag($tags, $blogid);

    ????header(‘Location:’.BLOG_URL.’tougao/?sl=2′);die;}

    ????elseif($sl==2){emMsg(‘??????????????????????
    ???????????????л????????’,”.BLOG_URL.’tougao’);}?>

    ????

    评论 (0)
      Top