X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=nucleus%2Flibs%2FCOMMENTS.php;fp=nucleus%2Flibs%2FCOMMENTS.php;h=d74c2bd503ec666647b4a9531eb4ff867c0ad903;hb=83b8a886f41c2d4bc7ac3e736891a387bdd0cbea;hp=375b569c5642e1a9c30abf5023f612c4daedfb1c;hpb=f7d94493eba4601537a73376977881fc90a753d9;p=nucleus-jp%2Fnucleus-next.git diff --git a/nucleus/libs/COMMENTS.php b/nucleus/libs/COMMENTS.php index 375b569..d74c2bd 100644 --- a/nucleus/libs/COMMENTS.php +++ b/nucleus/libs/COMMENTS.php @@ -143,9 +143,8 @@ class Comments { global $CONF, $member, $manager; - $blogid = getBlogIDFromItemID($this->itemid); - - $settings =& $manager->getBlog($blogid); + $item =& $manager->getItem($this->itemid, 0, 0); + $settings =& $manager->getBlog($item['blogid']); $settings->readSettings(); // begin if: comments disabled @@ -233,7 +232,7 @@ class Comments $p = $manager->getPlugin($plugin); $continue = $continue || $p->supportsFeature('handleSpam'); } - + $spamcheck = array( 'type' => 'comment', 'body' => $comment['body'], @@ -310,7 +309,6 @@ class Comments $message .= _NOTIFY_COMMENT . "\n " . $comment['body'] . "\n"; $message .= NOTIFICATION::get_mail_footer(); - $item =& $manager->getItem($this->itemid, 0, 0); $subject = _NOTIFY_NC_TITLE . ' ' . strip_tags($item['title']) . ' (' . $this->itemid . ')'; $from = $member->getNotifyFromMailAddress($comment['email']); @@ -324,11 +322,11 @@ class Comments $name = DB::quoteValue($comment['user']); $url = DB::quoteValue($comment['userid']); - $email = DB::quoteValue($comment['email']); + $email = DB::quoteValue($comment['email']); $body = DB::quoteValue($comment['body']); $host = DB::quoteValue($comment['host']); $ip = DB::quoteValue($comment['ip']); - $memberid = intval($comment['memberid']); + $memberid = (integer) $comment['memberid']; $timestamp = DB::formatDateTime($comment['timestamp']); $itemid = $this->itemid; @@ -339,7 +337,7 @@ class Comments . ' AND cmember = ' . $memberid . ' AND cbody = ' . $body . ' AND citem = ' . $itemid - . ' AND cblog = ' . $blogid; + . ' AND cblog = ' . $item['blogid']; $result = (integer) DB::getValue($qSql); if ( $result > 0 ) @@ -349,7 +347,7 @@ class Comments $query = sprintf('INSERT INTO %s (cuser, cmail, cemail, cmember, cbody, citem, ctime, chost, cip, cblog) ' . 'VALUES (%s, %s, %s, %d, %s, %d, %s, %s, %s, %d)' - , sql_table('comment'), $name, $url, $email, $memberid, $body, $itemid, $timestamp, $host, $ip, $blogid); + , sql_table('comment'), $name, $url, $email, $memberid, $body, $itemid, $timestamp, $host, $ip, $item['blogid']); DB::execute($query);