尼玛博客评论合并脚本 <?php $dbhost='127.0.0.1'; $d - Assbbs

尼玛博客评论合并脚本 &lt;?php $dbhost=& 39;127.0.0.1& 39;; $dbname=& 39;tp& 39;; $dbuser=& 39;root& 39;; $dbpass=& 39;root& 39;; date default timezone set & 39;PRC& 39; ; try{$pdo=new&nbsp;P…

尼玛博客评论合并脚本 &lt;?php $dbhost=& 39;127.0.0.1& 39;; $dbname=& 39;tp& 39;; $dbuser=& 39;root& 39;; $dbpass=& 39;root& 39;; date default timezone set & 39;PRC& 39; ; try{$pdo=new&nbsp;PDO & 39;mysql:host=& 39;.$dbhost.& 39;;dbname=& 39;.$dbname,$dbuser,$dbpass ;}catch Exception&nbsp;$e {die & 39;sqlsb& 39; ;} $rt=$pdo-&gt;query & 39;SELECT&nbsp; &nbsp;FROM&nbsp; typecho contents &nbsp;LIMIT&nbsp;20& 39; -&gt;fetchAll PDO::FETCH ASSOC ; foreach $rt&nbsp;as&nbsp;$ttt { $rr=$pdo-&gt;query & 39;SELECT&nbsp; &nbsp;FROM&nbsp; typecho comments &nbsp;WHERE&nbsp; cid =& 39;.$ttt & 39;cid& 39; .& 39;&nbsp;ORDER&nbsp;BY&nbsp; coid &nbsp;ASC& 39; -&gt;fetchAll PDO::FETCH ASSOC ; $txt=& 39; &lt;br&nbsp;/&gt; &lt;div&nbsp;class=&quot;nima comments&quot;&gt; & 39;; foreach $rr&nbsp;as&nbsp;$rrr { $txt.=& 39;&lt;hr&nbsp;/&gt; &lt;div&nbsp;class=&quot;nima comment&quot;&nbsp;id=&quot;nima comment & 39;.$rrr & 39;coid& 39; .& 39;&quot;&gt; &lt;span&nbsp;class=&quot;nima comment user&quot;&gt;& 39;. empty $rrr & 39;url& 39; ?$rrr & 39;author& 39; :& 39;&lt;a&nbsp;href=&quot;& 39;.$rrr & 39;url& 39; .& 39;&quot;&nbsp;target=&quot; blank&quot;&nbsp;rel=&quot;nofollow&quot;&gt;& 39;.$rrr & 39;author& 39; .& 39;&lt;/a&gt;& 39; .& 39;&lt;/span&gt; & 39;. $rrr & 39;created& 39; ==28800 ?& 39;& 39;:& 39;在 &lt;span&nbsp;class=&quot;nima comment time&quot;&gt;& 39;.date & 39;Y/m/d&nbsp;H:i:s& 39;,$rrr & 39;created& 39; .& 39;&lt;/span&gt; & 39; . empty $rrr & 39;parent& 39; ?& 39;评论& 39;:& 39;&lt;a&nbsp;href=&quot; nima comment & 39;.$rrr & 39;parent& 39; .& 39;&quot;&gt;回应&lt;/a&gt;& 39; .& 39;: &lt;br&nbsp;/&gt; &lt;span&nbsp;class=&quot;nima comment text&quot;&gt;& 39;.$rrr & 39;text& 39; .& 39;&lt;/span&gt; &lt;/div&gt; & 39;; } $txt.=& 39;&lt;/div&gt; & 39;; $ttt & 39;text& 39; .=$txt; $pdo-&gt;exec & 39;UPDATE&nbsp; typecho contents &nbsp;SET&nbsp; text =&quot;& 39;.addslashes $ttt & 39;text& 39; .& 39;&quot;&nbsp;WHERE&nbsp; cid =& 39;.$ttt & 39;cid& 39; ; } ?&gt; 仅供参考