Nucleus CMS日本語版SVNをgit-svnしたもの。リポジトリの変換作業用
Revision | 15c500d9ae9741ff99c669036f3c3472c4ac00fe (tree) |
---|---|
Time | 2009-04-22 23:53:37 |
Author | shizuki <shizuki@1ca2...> |
Commiter | shizuki |
git-svn-id: https://svn.sourceforge.jp/svnroot/nucleus-jp/nucleus-jp/tags/release-3-41@1010 1ca29b6e-896d-4ea0-84a5-967f57386b96
@@ -1199,41 +1199,6 @@ class ADMIN { | ||
1199 | 1199 | $wasdraft: set to 1 when the item used to be a draft item |
1200 | 1200 | $publish: set to 1 when the edited item is not a draft |
1201 | 1201 | */ |
1202 | -/*<del by shizuki> | |
1203 | - switch ($actiontype) { | |
1204 | - case 'adddraft': | |
1205 | - $publish = 0; | |
1206 | - $wasdraft = 1; | |
1207 | - $timestamp = 0; | |
1208 | - break; | |
1209 | - case 'addfuture': | |
1210 | - $wasdraft = 1; | |
1211 | - $publish = 1; | |
1212 | - $timestamp = mktime(intPostVar('hour'), intPostVar('minutes'), 0, intPostVar('month'), intPostVar('day'), intPostVar('year')); | |
1213 | - break; | |
1214 | - case 'addnow': | |
1215 | - $wasdraft = 1; | |
1216 | - $publish = 1; | |
1217 | - $timestamp = 0; | |
1218 | - break; | |
1219 | - case 'changedate': | |
1220 | - $timestamp = mktime(intPostVar('hour'), intPostVar('minutes'), 0, intPostVar('month'), intPostVar('day'), intPostVar('year')); | |
1221 | - $publish = 1; | |
1222 | - $wasdraft = 0; | |
1223 | - break; | |
1224 | - case 'backtodrafts': | |
1225 | - $wasdraft = 0; | |
1226 | - $publish = 0; | |
1227 | - $timestamp = 0; | |
1228 | - break; | |
1229 | - case 'edit': | |
1230 | - default: | |
1231 | - $publish = 1; | |
1232 | - $wasdraft = 0; | |
1233 | - $timestamp = 0; | |
1234 | - } | |
1235 | -</del by shizuki>*/ | |
1236 | -// <add by shizuki> | |
1237 | 1202 | $blogid = getBlogIDFromItemID($itemid); |
1238 | 1203 | $blog =& $manager->getBlog($blogid); |
1239 | 1204 |
@@ -1246,21 +1211,10 @@ class ADMIN { | ||
1246 | 1211 | $timestamp =0; |
1247 | 1212 | } |
1248 | 1213 | $doping = ($publish && $timestamp < $blog->getCorrectTime() && postVar('dosendping')) ? 1 : 0; |
1249 | -// </add by shizuki> | |
1250 | 1214 | |
1251 | 1215 | // edit the item for real |
1252 | 1216 | ITEM::update($itemid, $catid, $title, $body, $more, $closed, $wasdraft, $publish, $timestamp); |
1253 | 1217 | |
1254 | -/* <del by shizuki> | |
1255 | - $blogid = getBlogIDFromItemID($itemid); | |
1256 | - $blog =& $manager->getBlog($blogid); | |
1257 | - | |
1258 | - $isFuture = 0; | |
1259 | - if ($timestamp > $blog->getCorrectTime(time())) { | |
1260 | - $isFuture = 1; | |
1261 | - } | |
1262 | - | |
1263 | -</del by shizuki>*/ | |
1264 | 1218 | $this->updateFuturePosted($blogid); |
1265 | 1219 | |
1266 | 1220 | if ($draftid > 0) { |
@@ -1494,23 +1448,7 @@ class ADMIN { | ||
1494 | 1448 | |
1495 | 1449 | $blogid = getBlogIDFromItemID($result['itemid']); |
1496 | 1450 | $blog =& $manager->getBlog($blogid); |
1497 | -/* <del by shizuki> | |
1498 | - $pingUrl = $manager->addTicketToUrl($CONF['AdminURL'] . 'index.php?action=sendping&blogid=' . intval($blogid)); | |
1499 | - | |
1500 | - if ($result['status'] == 'newcategory') | |
1501 | - $this->action_categoryedit( | |
1502 | - $result['catid'], | |
1503 | - $blogid, | |
1504 | - $blog->sendPing() && numberOfEventSubscriber('SendPing') > 0 ? $pingUrl : '' | |
1505 | - ); | |
1506 | - elseif ((postVar('actiontype') == 'addnow') && $blog->sendPing() && numberOfEventSubscriber('SendPing') > 0) | |
1507 | - $this->action_sendping($blogid); | |
1508 | - else | |
1509 | - $this->action_itemlist($blogid); | |
1510 | -</del by shizuki>*/ | |
1511 | -// <add by shizuki> | |
1512 | 1451 | $btimestamp = $blog->getCorrectTime(); |
1513 | - $bPingInfo = ($blog->sendPing() && numberOfEventSubscriber('SendPing') > 0); | |
1514 | 1452 | $item = $manager->getItem(intval($result['itemid']), 1, 1); |
1515 | 1453 | $iPingInfo = (!$item['draft'] && postVar('dosendping') && $item['timestamp'] <= $btimestamp); |
1516 | 1454 | if ($iPingInfo && $bPingInfo) { |
@@ -1519,16 +1457,12 @@ class ADMIN { | ||
1519 | 1457 | $nextAction = 'itemlist'; |
1520 | 1458 | } |
1521 | 1459 | if ($result['status'] == 'newcategory') { |
1522 | -// $distURI = ($nextAction == 'sendping') ? $manager->addTicketToUrl($CONF['AdminURL'] . 'index.php?action=' | |
1523 | -// . $nextAction . '&blogid=' . intval($blogid)) : | |
1524 | -// ''; | |
1525 | 1460 | $distURI = $manager->addTicketToUrl($CONF['AdminURL'] . 'index.php?action=' . $nextAction . '&blogid=' . intval($blogid)); |
1526 | 1461 | $this->action_categoryedit($result['catid'], $blogid, $distURI); |
1527 | 1462 | } else { |
1528 | 1463 | $methodName = 'action_' . $nextAction; |
1529 | 1464 | call_user_func(array(&$this, $methodName), $blogid); |
1530 | 1465 | } |
1531 | -//</add by shizuki> | |
1532 | 1466 | } |
1533 | 1467 | |
1534 | 1468 | /** |
@@ -9,6 +9,7 @@ | ||
9 | 9 | v1.3 - pinged variable support |
10 | 10 | v1.4 - language file support |
11 | 11 | v1.5 - remove arg1 in exec() call |
12 | + v1.6 - move send update ping override option to plugin | |
12 | 13 | */ |
13 | 14 | |
14 | 15 | class NP_Ping extends NucleusPlugin { |
@@ -17,7 +18,7 @@ class NP_Ping extends NucleusPlugin { | ||
17 | 18 | |
18 | 19 | function getAuthor() { return 'admun (Edmond Hui)'; } |
19 | 20 | function getURL() { return 'http://edmondhui.homeip.net/nudn'; } |
20 | - function getVersion() { return '1.5'; } | |
21 | + function getVersion() { return '1.6'; } | |
21 | 22 | |
22 | 23 | function getMinNucleusVersion() { return '330'; } |
23 | 24 |
@@ -56,7 +57,11 @@ class NP_Ping extends NucleusPlugin { | ||
56 | 57 | } |
57 | 58 | |
58 | 59 | function getEventList() { |
59 | - return array('SendPing', 'JustPosted'); | |
60 | + return array( | |
61 | + 'SendPing', | |
62 | + 'JustPosted' | |
63 | + 'AddItemFormExtras', | |
64 | + 'EditItemFormExtras'); | |
60 | 65 | } |
61 | 66 | |
62 | 67 | function event_JustPosted($data) { |
@@ -83,6 +88,26 @@ class NP_Ping extends NucleusPlugin { | ||
83 | 88 | $this->sendPings($data); |
84 | 89 | } |
85 | 90 | |
91 | + function DisplayFormOptions($sendping) { | |
92 | + if ($sendping) { | |
93 | + $check = 'checked="checked"'; | |
94 | + } else { | |
95 | + $check = ''; | |
96 | + } | |
97 | + $output = '<h3>' . _PING_EXTRA_PLUGIN_OPTION . '</h3> | |
98 | + <p><input id="dosendping" name="dosendping" value="1" type="checkbox" ' . $check . '><label for="dosendping">' . _UPDATEDPING_GOSENDPING . '</label> </p>'; | |
99 | + echo $output; | |
100 | + } | |
101 | + | |
102 | + function event_AddItemFormExtras($data){ | |
103 | + $this->DisplayFormOptions($data['blog']->sendPing()); | |
104 | + } | |
105 | + | |
106 | + function event_EditItemFormExtras($data){ | |
107 | + // we are not sending ping by default after edit an item | |
108 | + $this->DisplayFormOptions(0); | |
109 | + } | |
110 | + | |
86 | 111 | function sendPings($data) { |
87 | 112 | if (!class_exists('xmlrpcmsg')) { |
88 | 113 | global $DIR_LIBS; |
@@ -13,4 +13,6 @@ | ||
13 | 13 | define('_PING_PHP_ERROR', 'PHP Error: '); |
14 | 14 | define('_PING_PHP_PING_ERROR', 'Error while trying to send ping. Sorry about that.'); |
15 | 15 | define('_PING_SUCCESS', 'Success'); |
16 | + define('_UPDATEDPING_GOSENDPING', 'Send Update ping'); | |
17 | + define('_PING_EXTRA_PLUGIN_OPTION', 'Blog Tracking Ping Service'); | |
16 | 18 | ?> |
@@ -13,4 +13,6 @@ | ||
13 | 13 | define('_PING_PHP_ERROR', 'PHP エラー: '); |
14 | 14 | define('_PING_PHP_PING_ERROR', '申し訳ありません。ping を送信中にエラーが発生しました。'); |
15 | 15 | define('_PING_SUCCESS', '成功'); |
16 | + define('_UPDATEDPING_GOSENDPING', 'pingを送信する'); | |
17 | + define('_PING_EXTRA_PLUGIN_OPTION', '更新ping'); | |
16 | 18 | ?> |
@@ -13,4 +13,6 @@ | ||
13 | 13 | define('_PING_PHP_ERROR', 'PHP エラー: '); |
14 | 14 | define('_PING_PHP_PING_ERROR', '申し訳ありません。ping を送信中にエラーが発生しました。'); |
15 | 15 | define('_PING_SUCCESS', '成功'); |
16 | + define('_UPDATEDPING_GOSENDPING', 'pingを送信する'); | |
17 | + define('_PING_EXTRA_PLUGIN_OPTION', '更新ping'); | |
16 | 18 | ?> |