當前位置: 首頁>>代碼示例>>PHP>>正文


PHP comments::ex_strip_tags方法代碼示例

本文整理匯總了PHP中comments::ex_strip_tags方法的典型用法代碼示例。如果您正苦於以下問題:PHP comments::ex_strip_tags方法的具體用法?PHP comments::ex_strip_tags怎麽用?PHP comments::ex_strip_tags使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在comments的用法示例。


在下文中一共展示了comments::ex_strip_tags方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: add

 public static function add($contentID, $comment = "", $replyUID = 0, $replyID = 0, $replyCommentID = 0)
 {
     if (!isset($_SESSION["user"]) || !$comment) {
         return false;
     }
     $comment = comments::ex_strip_tags($comment);
     $comment = trim(comments::bbcodes($comment));
     $insip = system::getClientIP();
     $userID = intval($_SESSION["user"]["userID"]);
     $replyUID = intval($replyUID);
     $replyCommentID = intval($replyCommentID);
     if (!$comment) {
         return false;
     }
     $replyCommentID = 0;
     $article = array();
     if ($replyCommentID && $replyUID && $_SESSION["user"]["userID"] != $replyUID) {
         $rusers_res = self::$db->query("SELECT * FROM `users` WHERE `userID`=? LIMIT 1", $replyUID);
         $article_res = self::$db->query("SELECT `title`,`type` FROM `content` WHERE `contentID`=? LIMIT 1", $contentID);
         $article = $article_res->fetch();
         $ruser = $rusers_res->fetch();
         $ruser["article_title"] = $article["title"];
         $ruser["article_returnPath"] = self::$routePath;
         $ruser["type"] = $article["type"];
         $ruser["commentID"] = $commentID;
         self::$mail->assign("data", $ruser);
         self::$mail->sendMail(TPL_PATH . "/mail/mailNotifyReply.tpl", $ruser["email"]);
     }
     self::$db->query("INSERT `comments` SET `contentID`=?, `userID`=?, `dt`=NOW(), `email`='?', `author`='?', `body`='?', `guest`='N', `ip`=INET_ATON('?'), `type`='?', `reply_to`=?", $contentID, $_SESSION["user"]["userID"], $_SESSION["user"]["email"], $_SESSION["user"]["nick"], $comment, $insip, self::$controllerCall, $replyCommentID);
     $commentID = self::$db->insert_id();
     self::$db->query("UPDATE `content` SET `comments_count`=`comments_count`+1 WHERE `contentID`=? AND `type`='?'", $contentID, self::$controllerCall);
     if (isset($_POST["quotedUID"]) && $_POST["quotedUID"]) {
         $qip = array_filter($_POST["quotedUID"], create_function("\$a", "return ( {$userID} == \$a ? false : true );"));
         $qip = array_diff($qip, array($replyUID));
         if ($qip) {
             $qip = array_map("intval", $qip);
             $qusers_res = self::$db->query("SELECT * FROM `users` WHERE `userID` IN (" . implode(",", $qip) . ")");
             if ($qusers_res->getNumRows()) {
                 if ($article) {
                     $article_res = self::$db->query("SELECT `title`,`type` FROM `content` WHERE `contentID`=? LIMIT 1", $contentID);
                     $article = $article_res->fetch();
                 }
                 $qusers = $qusers_res->fetchAll();
                 foreach ($qusers as $k => $v) {
                     $v["article_title"] = $article["title"];
                     $v["article_returnPath"] = self::$routePath;
                     $v["type"] = $article["type"];
                     $v["commentID"] = $commentID;
                     self::$mail->assign("data", $v);
                     self::$mail->sendMail(TPL_PATH . "/mail/mailNotifyQuote.tpl", $v["email"]);
                 }
             }
         }
     }
     self::$smarty->clearCurrentCache();
     system::redirect("/" . self::$routePath . "/#comment_{$commentID}");
     return $commentID;
 }
開發者ID:ygres,項目名稱:sblog,代碼行數:58,代碼來源:model.comments.php


注:本文中的comments::ex_strip_tags方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。