From 47875a5abb1cfcc9078d27e40c130c8d2d31bd22 Mon Sep 17 00:00:00 2001 From: shizuki Date: Tue, 8 Jul 2008 16:28:43 +0000 Subject: [PATCH] =?utf8?q?=E3=83=8A=E3=82=A4=E3=82=B7=E3=83=A7=E3=82=B3?= =?utf8?q?=E3=83=A1=E3=83=B3=E3=83=88=E5=AF=BE=E5=BF=9C=20=E3=81=B2?= =?utf8?q?=E3=81=A3=E3=81=9D=E3=82=8A=E3=81=A8php4=E3=81=A7=E3=81=AF?= =?utf8?q?=E5=8B=95=E3=81=8B=E3=81=AA=E3=81=8B=E3=81=A3=E3=81=9F=E3=82=8A?= =?utf8?q?=E3=81=97=E3=81=BE=E3=81=99=20=E3=81=82=E3=81=A8=E3=80=81EzComme?= =?utf8?q?nt2=E7=84=A1=E3=81=97=E3=81=AE=E7=92=B0=E5=A2=83=E3=81=A7?= =?utf8?q?=E3=81=AF=E8=A9=A6=E3=81=97=E3=81=A6=E3=81=BE=E3=81=9B=E3=82=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.sourceforge.jp/svnroot/nucleus-jp/plugin@653 1ca29b6e-896d-4ea0-84a5-967f57386b96 --- trunk/NP_LatestWritebacks/NP_LatestWritebacks.php | 60 +++++++++++++++++------ 1 file changed, 46 insertions(+), 14 deletions(-) diff --git a/trunk/NP_LatestWritebacks/NP_LatestWritebacks.php b/trunk/NP_LatestWritebacks/NP_LatestWritebacks.php index 35c02c9..29f6b4a 100644 --- a/trunk/NP_LatestWritebacks/NP_LatestWritebacks.php +++ b/trunk/NP_LatestWritebacks/NP_LatestWritebacks.php @@ -34,7 +34,7 @@ class NP_LatestWritebacks extends NucleusPlugin function getVersion() { - return '1.5a'; + return '1.6'; } function getDescription() @@ -92,6 +92,16 @@ TrackBack list template sample */ } + function pluginCheck($pluginName) + { + global $manager; + if (!$manager->pluginInstalled('NP_' . $pluginName)) { + return false; + } + $plugin =& $manager->getPlugin('NP_' . $pluginName); + return $plugin; + } + function doSkinVar($skinType, $numberOfWritebacks = 5, $filter = '', @@ -130,21 +140,32 @@ TrackBack list template sample $arr_res = array(); if ($TBorCm != 't') { - // select + $join = ''; $query = 'SELECT' - . ' cnumber as commentid,' - . ' cuser as commentator,' - . ' cbody as commentbody,' - . ' citem as itemid,' - . ' cmember as memberid,' -// . ' ctime as commentdate,' - . ' SUBSTRING(ctime, 6, 5) as commentday,' - . ' UNIX_TIMESTAMP(ctime) as ctimest' - . ' FROM ' . sql_table('comment'); + . ' c.cnumber as commentid,' + . ' c.cuser as commentator,' + . ' c.cbody as commentbody,' + . ' c.citem as itemid,' + . ' c.cmember as memberid,' +// . ' c.ctime as commentdate,' + . ' SUBSTRING(c.ctime, 6, 5) as commentday,' + . ' UNIX_TIMESTAMP(c.ctime) as ctimest'; + if ($EzComment2 = $this->pluginCheck('EzComment2')) { + if (method_exists($EzComment2, 'getTemplateParts')) { + $query .= ', s.comid as cid, ' + . 's.secflg as secret, ' + . 's.module as modname, ' + . 's.userID as identity '; + $join = ' LEFT OUTER JOIN ' . sql_table('plug_ezcomment2') . ' as s ' + . ' ON c.cnumber = s.comid '; + } + } + // select + $query .= ' FROM ' . sql_table('comment') .' as c ' . $join; if ($filter) { $query .= ' WHERE ' . $filter; } - $query .= ' ORDER by ctime DESC LIMIT 0, ' . $numberOfWritebacks; + $query .= ' ORDER by c.ctime DESC LIMIT 0, ' . $numberOfWritebacks; $comments = sql_query($query); @@ -154,15 +175,26 @@ TrackBack list template sample $tempBody = strip_tags($content['commentbody']); $tempBody = htmlspecialchars($tempBody, ENT_QUOTES); $tempBody = shorten($tempBody, $numberOfCharacters, $toadd); - $tempBody = htmlspecialchars($tempBody, ENT_QUOTES); + $tempBody = htmlspecialchars(htmlspecialchars_decode($tempBody), ENT_QUOTES); $tempBody = str_replace("\r\n", ' ', $tempBody); $content['commentdate'] = strftime($this->getOption('cmdateformat'), $content['ctimest']); - $content['commentbody'] = $tempBody; + $content['commentbody'] = str_replace("&", '&', $tempBody); if (!empty($row->memberid)) { $mem = new MEMBER; $mem->readFromID(intval($row->memberid)); $content['commentator'] = $mem->getRealName(); } + if ($EzComment2) { + $bid = intval(getBlogIDFromItemID(intval($comment['itemid']))); + if ($EzComment2->getBlogOption($bid, 'secret') == 'yes') { + $b = $manager->getBlog($bid); + global $member; + $judge = $EzComment2->setSecretJudge($bid, $member, $b); + } + } + if ($judge && $content['secret']) { + $content = $EzComment2->JudgementCommentSecrets($content, $judge); + } /* $cid = $row->cnumber; $ct = $row->ctimest; -- 2.11.0