<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                ##發貼功能 模板所在位置: `/theme/default/addc.html` PHP頁面 `addc.php` ####操作流程 1. 用戶點擊進入發貼頁的時候,將所選版塊的ID帶上。URL示例如下:http://bbs.com/addc.php?classid=5。我們就可以知道用戶是向哪個版塊發貼。 2. 判斷用戶是否存在 3. 判斷版塊是否存在,如果不存在的話,插入的版塊即非法。我們讓用戶發貼不能成功。 4. 展示導航,版塊名等基本信息,渲染進入模板 5. 準本好要插入的基本信息,拼接SQL語句,并插入庫 6. 判斷是否寫入成功 7. 成功給用戶金幣(積分),跳轉至貼子頁 ####1. 判斷用戶是否登陸,未登陸不能發貼 ~~~ //包含公共組件 include './common/common.php'; //判斷用戶是否登錄 if(!$_COOKIE['uid']) { $notice = '抱歉,您尚未登錄,沒有權限在該版塊發帖'; include 'close.php'; exit; } ~~~ ####2.判斷ID是否存在 ~~~ if(empty($_REQUEST['classid']) || !is_numeric($_REQUEST['classid'])) { $msg = '<font color=red><b>禁止非法操作</b></font>'; $url = $_SERVER['HTTP_REFERER']; $style = 'alert_error'; $toTime = 3000; include 'notice.php'; } $classId = $_REQUEST['classid']; ~~~ ####3. 讀取版塊相關的基本信息 ~~~ $category = dbSelect('category','cid,classname,parentid','parentid<>0 and cid='.$classId.'','',1); if($category){ $smallName = $category[0]['classname']; $smallId = $category[0]['cid']; $parentCategory = dbSelect('category','cid,classname','cid='.$category[0]['parentid'].'','',1); if($parentCategory) { $bigName=$parentCategory[0]['classname']; $bigId=$parentCategory[0]['cid']; }else{ $msg = '<font color=red><b>非法操作</b></font>'; $url = $_SERVER['HTTP_REFERER']; $style = 'alert_error'; $toTime = 3000; include 'notice.php'; exit; } }else{ $msg = '<font color=red><b>非法操作</b></font>'; $url = $_SERVER['HTTP_REFERER']; $style = 'alert_error'; $toTime = 3000; include 'notice.php'; exit; } ~~~ ####4.準備發布內容 ~~~ $authorid = $_COOKIE['uid']; //發布人ID $title = strMagic($_POST['subject']); //標題 $content = strMagic($_POST['content']); //內容 $addtime = time(); //發表時間 $addip = ip2long($_SERVER['REMOTE_ADDR']);//發布人IP $classId = $_POST['classid']; //類別ID $rate = $_POST['price']; //帖子售價 $n = 'first, authorid, title, content, addtime, addip, classid, rate'; $v = '1, '.$authorid.', "'.$title.'", "'.$content.'", '.$addtime.', '.$addip.', '.$classId.', '.$rate.''; $result = dbInsert('details', $n, $v); ~~~ ##整體代碼展示 ~~~ <?php /** * 發帖子 */ include './common/common.php'; //判斷用戶是否登錄 if(!$_COOKIE['uid']) { $notice = '抱歉,您尚未登錄,沒有權限在該版塊發帖'; include 'close.php'; exit; } //判斷ID是否存在 if(empty($_REQUEST['classid']) || !is_numeric($_REQUEST['classid'])) { $msg = '<font color=red><b>禁止非法操作</b></font>'; $url = $_SERVER['HTTP_REFERER']; $style = 'alert_error'; $toTime = 3000; include 'notice.php'; } $classId = $_REQUEST['classid']; //讀取導航索引 $category = dbSelect('category','cid,classname,parentid','parentid<>0 and cid='.$classId.'','',1); if($category){ $smallName = $category[0]['classname']; $smallId = $category[0]['cid']; $parentCategory = dbSelect('category','cid,classname','cid='.$category[0]['parentid'].'','',1); if($parentCategory) { $bigName=$parentCategory[0]['classname']; $bigId=$parentCategory[0]['cid']; }else{ $msg = '<font color=red><b>非法操作</b></font>'; $url = $_SERVER['HTTP_REFERER']; $style = 'alert_error'; $toTime = 3000; include 'notice.php'; exit; } }else{ $msg = '<font color=red><b>非法操作</b></font>'; $url = $_SERVER['HTTP_REFERER']; $style = 'alert_error'; $toTime = 3000; include 'notice.php'; exit; } //發布帖子 if($_POST['topicsubmit']) { $authorid = $_COOKIE['uid']; //發布人ID $title = strMagic($_POST['subject']); //標題 $content = strMagic($_POST['content']); //內容 $addtime = time(); //發表時間 $addip = ip2long($_SERVER['REMOTE_ADDR']);//發布人IP $classId = $_POST['classid']; //類別ID $rate = $_POST['price']; //帖子售價 $n = 'first, authorid, title, content, addtime, addip, classid, rate'; $v = '1, '.$authorid.', "'.$title.'", "'.$content.'", '.$addtime.', '.$addip.', '.$classId.', '.$rate.''; $result = dbInsert('details', $n, $v); $insert_id = dbSelect('details','id','title="'.$title.'"','id desc',1); $insertId = $insert_id[0]['id']; if(!$result){ $msg = '<font color=red><b>帖子發表失敗,請聯系管理員</b></font>'; $url = $_SERVER['HTTP_REFERER']; $style = 'alert_error'; $toTime = 3000; include 'notice.php'; exit; }else{ $money = REWARD_T; //發帖贈送積分 $result = dbUpdate('user', "grade=grade+{$money}", 'uid='.$_COOKIE['uid'].''); //更新版塊表的主題數量[Motifcount](跟帖是回復數量[eplycount])和最后發表[lastpost] $last = $insertId.'+||+'.$title.'+||+'.$addtime.'+||+'.$_COOKIE['username']; $result = dbUpdate('category', 'motifcount=motifcount+1, lastpost="'.$last.'"', 'cid='.$classId.''); $msg = '<font color=red><b>帖子發表成功</b></font>'; $url = 'detail.php?id='.$insertId; $style = 'alert_right'; $toTime = 3000; include 'notice.php'; $msg = '發帖贈送'; include 'layer.php'; exit; } } $OnMenu = dbSelect('category','cid,classname','cid='.$classId.' and ispass=1','orderby desc,cid desc'); if(!$OnMenu) { $msg = '<font color=red><b>沒有找到該版塊</b></font>'; $url = $_SERVER['HTTP_REFERER']; $style = 'alert_error'; $toTime = 3000; include 'notice.php'; }else{ $OnCid = $OnMenu[0]['cid']; $OnCname = $OnMenu[0]['classname']; } $title = '發表帖子'.$OnCname.' - '.WEB_NAME; $menu = WEB_NAME; include template("addc.html"); ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看