OSDN Git Service

FIX: PHP5/MySQL5における文法違反コードの修正
[nucleus-jp/nucleus-jp-ancient.git] / nucleus / libs / COMMENTS.php
index 92adf96..323b561 100755 (executable)
@@ -70,8 +70,8 @@ class COMMENTS {
                global $CONF, $manager;
 
                // create parser object & action handler
-               $actions =& new COMMENTACTIONS($this);
-               $parser =& new PARSER($actions->getDefinedActions(),$actions);
+               $actions = new COMMENTACTIONS($this);
+               $parser = new PARSER($actions->getDefinedActions(), $actions);
                $actions->setTemplate($template);
                $actions->setParser($parser);
 
@@ -106,9 +106,11 @@ class COMMENTS {
                        $comment['timestamp'] = strtotime($comment['ctime']);
                        $actions->setCurrentComment($comment);
                        $actions->setHighlight($highlight);
-                       $manager->notify('PreComment', array('comment' => &$comment));
+                       $param = array('comment' => &$comment);
+                       $manager->notify('PreComment', $param);
                        $parser->parse($template['COMMENTS_BODY']);
-                       $manager->notify('PostComment', array('comment' => &$comment));
+                       $param = array('comment' => &$comment);
+                       $manager->notify('PostComment', $param);
                }
 
                $parser->parse($template['COMMENTS_FOOTER']);
@@ -256,7 +258,8 @@ class COMMENTS {
                        $spamcheck['url'] = $comment['userid'];
                } // end if
 
-               $manager->notify('SpamCheck', array('spamcheck' => &$spamcheck) );
+               $param = array('spamcheck' => &$spamcheck);
+               $manager->notify('SpamCheck', $param);
 
                if ( !$continue && isset($spamcheck['result']) && $spamcheck['result'] == TRUE )
                {
@@ -316,13 +319,17 @@ class COMMENTS {
 
                        $frommail = $member->getNotifyFromMailAddress($comment['email']);
 
-                       $notify =& new NOTIFICATION($settings->getNotifyAddress() );
+                       $notify = new NOTIFICATION($settings->getNotifyAddress() );
                        $notify->notify($mailto_title, $mailto_msg , $frommail);
                }
 
                $comment = COMMENT::prepare($comment);
 
-               $manager->notify('PreAddComment', array('comment' => &$comment, 'spamcheck' => &$spamcheck) );
+               $param = array(
+                       'comment'       => &$comment,
+                       'spamcheck'     => &$spamcheck
+               );
+               $manager->notify('PreAddComment', $param);
 
                $name           = sql_real_escape_string($comment['user']);
                $url            = sql_real_escape_string($comment['userid']);
@@ -356,7 +363,12 @@ class COMMENTS {
 
                // post add comment
                $commentid = sql_insert_id();
-               $manager->notify('PostAddComment', array('comment' => &$comment, 'commentid' => &$commentid, 'spamcheck' => &$spamcheck) );
+               $param = array(
+                       'comment'       => &$comment,
+                       'commentid'     => &$commentid,
+                       'spamcheck'     => &$spamcheck
+               );
+               $manager->notify('PostAddComment', $param);
 
                // succeeded !
                return TRUE;
@@ -423,7 +435,13 @@ class COMMENTS {
                // let plugins do verification (any plugin which thinks the comment is invalid
                // can change 'error' to something other than '1')
                $result = 1;
-               $manager->notify('ValidateForm', array('type' => 'comment', 'comment' => &$comment, 'error' => &$result, 'spamcheck' => &$spamcheck) );
+               $param = array(
+                       'type'          => 'comment',
+                       'comment'       => &$comment,
+                       'error'         => &$result,
+                       'spamcheck'     => &$spamcheck
+               );
+               $manager->notify('ValidateForm', $param);
 
                return $result;
        }