OSDN Git Service

git-svn-id: https://svn.sourceforge.jp/svnroot/nucleus-jp/nucleus-jp/trunk/utf8@1006... branch-3-4@1007 release-3-41@1009
authorshizuki <shizuki@1ca29b6e-896d-4ea0-84a5-967f57386b96>
Wed, 22 Apr 2009 14:50:03 +0000 (14:50 +0000)
committershizuki <shizuki@1ca29b6e-896d-4ea0-84a5-967f57386b96>
Wed, 22 Apr 2009 14:50:03 +0000 (14:50 +0000)
nucleus/plugins/NP_Ping.php
nucleus/plugins/ping/english.php
nucleus/plugins/ping/japanese-euc.php
nucleus/plugins/ping/japanese-utf8.php

index 9341bec..3fc4b6d 100644 (file)
@@ -9,6 +9,7 @@
     v1.3 - pinged variable support
     v1.4 - language file support
     v1.5 - remove arg1 in exec() call
+    v1.6 - move send update ping override option to plugin
  */
 
 class NP_Ping extends NucleusPlugin {
@@ -17,7 +18,7 @@ class NP_Ping extends NucleusPlugin {
 
        function getAuthor() { return 'admun (Edmond Hui)'; }
        function getURL()    { return 'http://edmondhui.homeip.net/nudn'; }
-       function getVersion() { return '1.5'; }
+       function getVersion() { return '1.6'; }
 
        function getMinNucleusVersion() { return '330'; }
 
@@ -56,7 +57,11 @@ class NP_Ping extends NucleusPlugin {
        }
 
        function getEventList() {
-               return array('SendPing', 'JustPosted');
+               return array(
+                       'SendPing',
+                       'JustPosted'
+                       'AddItemFormExtras',
+                       'EditItemFormExtras');
        }
 
        function event_JustPosted($data) {
@@ -83,6 +88,26 @@ class NP_Ping extends NucleusPlugin {
                 $this->sendPings($data);
        }
 
+       function DisplayFormOptions($sendping) {
+               if ($sendping) {
+                       $check = 'checked="checked"';
+               } else {
+                       $check = '';
+               }
+                $output = '<h3>' . _PING_EXTRA_PLUGIN_OPTION . '</h3>
+                <p><input id="dosendping" name="dosendping" value="1" type="checkbox" ' . $check . '><label for="dosendping">' . _UPDATEDPING_GOSENDPING . '</label> </p>';
+                echo $output;
+       }
+
+        function event_AddItemFormExtras($data){
+               $this->DisplayFormOptions($data['blog']->sendPing());
+       }
+
+        function event_EditItemFormExtras($data){
+               // we are not sending ping by default after edit an item
+               $this->DisplayFormOptions(0);
+       }
+
         function sendPings($data) {
                if (!class_exists('xmlrpcmsg')) {
                        global $DIR_LIBS;
index c81e8b3..627aa50 100644 (file)
@@ -13,4 +13,6 @@
        define('_PING_PHP_ERROR', 'PHP Error: ');
        define('_PING_PHP_PING_ERROR', 'Error while trying to send ping. Sorry about that.');
        define('_PING_SUCCESS', 'Success');
+       define('_UPDATEDPING_GOSENDPING', 'Send Update ping'); 
+       define('_PING_EXTRA_PLUGIN_OPTION', 'Blog Tracking Ping Service');
 ?>
index 0a46131..c2ec03a 100644 (file)
@@ -13,4 +13,6 @@
        define('_PING_PHP_ERROR', 'PHP ¥¨¥é¡¼: ');
        define('_PING_PHP_PING_ERROR', '¿½¤·Ìõ¤¢¤ê¤Þ¤»¤ó¡£ping ¤òÁ÷¿®Ãæ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿¡£');
        define('_PING_SUCCESS', 'À®¸ù');
+       define('_UPDATEDPING_GOSENDPING', 'ping¤òÁ÷¿®¤¹¤ë'); 
+       define('_PING_EXTRA_PLUGIN_OPTION', '¹¹¿·ping');
 ?>
index 3bcd670..5d7e029 100644 (file)
@@ -13,4 +13,6 @@
        define('_PING_PHP_ERROR', 'PHP エラー: ');
        define('_PING_PHP_PING_ERROR', '申し訳ありません。ping を送信中にエラーが発生しました。');
        define('_PING_SUCCESS', '成功');
+       define('_UPDATEDPING_GOSENDPING', 'pingを送信する'); 
+       define('_PING_EXTRA_PLUGIN_OPTION', '更新ping');
 ?>