From: shizuki Date: Fri, 4 Jul 2008 11:00:34 +0000 (+0000) Subject: コード書いただけ、実験まだ X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=ee63a194a80d2f8fdd25edf3b1b1f8abdd30e642;p=nucleus-jp%2Fnucleus-plugins.git コード書いただけ、実験まだ git-svn-id: https://svn.sourceforge.jp/svnroot/nucleus-jp/plugin@647 1ca29b6e-896d-4ea0-84a5-967f57386b96 --- diff --git a/trunk/NP_EzComment2/NP_EzComment2.php b/trunk/NP_EzComment2/NP_EzComment2.php index 05d6ca0..dc14e44 100644 --- a/trunk/NP_EzComment2/NP_EzComment2.php +++ b/trunk/NP_EzComment2/NP_EzComment2.php @@ -46,12 +46,16 @@ class NP_EzComment2 extends NucleusPlugin return array( 'ExternalAuth', 'LoginSuccess', + 'FormExtra', + 'PostAddComment', ); } function event_ExternalAuth(&$data) { if ($this->flgLoggedin) return; + $authPlugins = array('OpenId'); + if (!in_array($data['externalauth']['source'], $authPlugins)) return; global $manager; $pluginName = 'NP_' . $data['externalauth']['source']; if ($manager->pluginInstalled($pluginName)) { @@ -69,6 +73,23 @@ class NP_EzComment2 extends NucleusPlugin $this->authModule = $data['member']; } + function event_PostAddComment($data) { + global $manager; + $comment = $data['comment']; + if (intval(getNucleusVersion()) >= 330) { + $email = $comment['email']; + } else { + $email = $comment['userid']; + } + if (postVar('EzComment2_Secret')) { + $secCheck = 1; + } else { + $secCheck = 0; + } + $sql = 'INSERT INTO ' . sql_table('plug_ezcomment2') . '(`comid`, `secflg`) VALUES (%d, %d)'; + sql_query(sprintf($sql, $comment['commentid'], $secCheck)); + } + function install() { if (!TEMPLATE::exists('EzCommentTemplateDefault')) { @@ -108,6 +129,12 @@ class NP_EzComment2 extends NucleusPlugin } } + function event_FormExtra(&$data) { + $this->numcalled++; + echo '
'; + echo '
'; + } + function uninstall() { if ($this->getOption('tabledel') == 'yes') @@ -122,6 +149,7 @@ class NP_EzComment2 extends NucleusPlugin } else { include_once($this->getDirectory() . 'language/english.php'); } + $this->numcalled = 0; } function updateTable()