*
* @license http://nucleuscms.org/license.txt GNU General Public License
* @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: ADMIN.php,v 1.20 2007-03-22 03:30:14 kmorimatsu Exp $
- * @version $NucleusJP: ADMIN.php,v 1.19 2007/03/20 19:31:29 kmorimatsu Exp $
+ * @version $Id: ADMIN.php,v 1.24 2008-02-08 09:31:22 kimitake Exp $
+ * @version $NucleusJP: ADMIN.php,v 1.21.2.4 2007/10/30 19:04:24 kmorimatsu Exp $
*/
if ( !function_exists('requestVar') ) exit;
// start index
if (postVar('start'))
- $start = postVar('start');
+ $start = intPostVar('start');
else
$start = 0;
// amount of items to show
if (postVar('amount'))
- $amount = postVar('amount');
+ $amount = intPostVar('amount');
else
$amount = 10;
// start index
if (postVar('start'))
- $start = postVar('start');
+ $start = intPostVar('start');
else
$start = 0;
// amount of items to show
if (postVar('amount'))
- $amount = postVar('amount');
+ $amount = intPostVar('amount');
else
$amount = 10;
// start index
if (postVar('start'))
- $start = postVar('start');
+ $start = intPostVar('start');
else
$start = 0;
// amount of items to show
if (postVar('amount'))
- $amount = postVar('amount');
+ $amount = intPostVar('amount');
else
$amount = 10;
// start index
if (postVar('start'))
- $start = postVar('start');
+ $start = intPostVar('start');
else
$start = 0;
// amount of items to show
if (postVar('amount'))
- $amount = postVar('amount');
+ $amount = intPostVar('amount');
else
$amount = 10;
// edit the item for real
ITEM::update($itemid, $catid, $title, $body, $more, $closed, $wasdraft, $publish, $timestamp);
- if ($draftid > 0) {
+ $blogid = getBlogIDFromItemID($itemid);
+ $blog =& $manager->getBlog($blogid);
+
+ $isFuture = 0;
+ if ($timestamp > $blog->getCorrectTime(time())) {
+ $isFuture = 1;
+ }
+
+ $this->updateFuturePosted($blogid);
+
+ if ($draftid > 0 && $member->canAlterItem($draftid)) {
ITEM::delete($draftid);
}
- $blogid = getBlogIDFromItemID($itemid);
- $blog =& $manager->getBlog($blogid);
- if (!$closed && $publish && $wasdraft && $blog->pingUserland()) {
+ if (!$closed && $publish && $wasdraft && $blog->sendPing() && numberOfEventSubscriber('SendPing') > 0 && !$isFuture) {
$this->action_sendping($blogid);
return;
}
if (!$member->canAlterItem($itemid))
return _ERROR_DISALLOWED;
+ // need to get blogid before the item is deleted
+ $blogid = getBlogIDFromItemId($itemid);
+
$manager->loadClass('ITEM');
ITEM::delete($itemid);
+
+ // update blog's futureposted
+ $this->updateFuturePosted($blogid);
+ }
+
+ /**
+ * Update a blog's future posted flag
+ * @param int $blogid
+ */
+ function updateFuturePosted($blogid) {
+ global $manager;
+
+ $blog =& $manager->getBlog($blogid);
+ $currenttime = $blog->getCorrectTime(time());
+ $result = sql_query("SELECT * FROM ".sql_table('item').
+ " WHERE iblog='".$blogid."' AND iposted=0 AND itime>".mysqldate($currenttime));
+ if (mysql_num_rows($result) > 0) {
+ $blog->setFuturePost();
+ }
+ else {
+ $blog->clearFuturePost();
+ }
}
/**
// only allow if user is allowed to alter item
$member->canUpdateItem($itemid, $catid) or $this->disallow();
+ $old_blogid = getBlogIDFromItemId($itemid);
+
ITEM::move($itemid, $catid);
+ // set the futurePosted flag on the blog
+ $this->updateFuturePosted(getBlogIDFromItemId($itemid));
+
+ // reset the futurePosted in case the item is moved from one blog to another
+ $this->updateFuturePosted($old_blogid);
+
if ($catid != intRequestVar('catid'))
$this->action_categoryedit($catid, $blog->getID());
else
$this->action_categoryedit(
$result['catid'],
$blogid,
- $blog->pingUserland() ? $pingUrl : ''
+ $blog->sendPing() && numberOfEventSubscriber('SendPing') > 0 ? $pingUrl : ''
);
- elseif ((postVar('actiontype') == 'addnow') && $blog->pingUserland())
+ elseif ((postVar('actiontype') == 'addnow') && $blog->sendPing() && numberOfEventSubscriber('SendPing') > 0)
$this->action_sendping($blogid);
else
$this->action_itemlist($blogid);
}
/**
- * Shows a window that says we're about to ping weblogs.com.
+ * Shows a window that says we're about to ping.
* immediately refresh to the real pinging page, which will
* show an error, or redirect to the blog.
*
$this->pagehead('<meta http-equiv="refresh" content="1; url='.htmlspecialchars($rawPingUrl).'" />');
?>
- <h2>Site Updated, Now pinging weblogs.com</h2>
+ <h2>Site Updated, Now pinging various weblog listing services...</h2>
<p>
- Pinging weblogs.com! This can a while...
- <br />
- When the ping is complete (and successfull), your weblog will show up in the weblogs.com updates list.
+ This can take a while...
</p>
<p>
}
/**
- * Ping to Weblogs.com
* Sends the real ping (can take up to 10 seconds!)
*/
function action_rawping() {
$blogid = intRequestVar('blogid');
$blog =& $manager->getBlog($blogid);
- $result = $blog->sendUserlandPing();
-
$this->pagehead();
?>
- <h2>Ping Results</h2>
+ <h2>Pinging services, please wait...</h2>
+ <div class='note'>
+ <?php
- <p>The following message was returned by weblogs.com:</p>
+ // send sendPing event
+ $manager->notify('SendPing', array('blogid' => $blogid));
- <div class='note'><?php echo $result ?></div>
+ ?>
+ </div>
<ul>
<li><a href="index.php?action=itemlist&blogid=<?php echo $blog->getID()?>">View list of recent items for <?php echo htmlspecialchars($blog->getName())?></a></li>
// check if: - there remains at least one blog admin
// - (there remains at least one team member)
- $tmem = MEMBER::createFromID($memberid);
+ $mem = MEMBER::createFromID($memberid);
$manager->notify('PreDeleteTeamMember', array('member' => &$mem, 'blogid' => $blogid));
- if ($tmem->isBlogAdmin($blogid)) {
+ if ($mem->isBlogAdmin($blogid)) {
// check if there are more blog members left and at least one admin
// (check for at least two admins before deletion)
$query = 'SELECT * FROM '.sql_table('team') . ' WHERE tblog='.$blogid.' and tadmin=1';
/><label for="notifyNewItem"><?php echo _EBLOG_NOTIFY_ITEM?></label>
</td>
</tr><tr>
- <td><?php echo _EBLOG_PING?> <?php help('pinguserland'); ?></td>
- <td><?php $this->input_yesno('pinguserland',$blog->pingUserland(),85); ?></td>
+ <?php
+ if (numberOfEventSubscriber('SendPing') > 0) {
+ ?>
+ <td><?php echo _EBLOG_PING?> <?php help('sendping'); ?></td>
+ <td><?php $this->input_yesno('sendping',$blog->sendPing(),85); ?></td>
</tr><tr>
+ <?php
+ }
+ ?>
<td><?php echo _EBLOG_MAXCOMMENTS?> <?php help('blogmaxcomments'); ?></td>
<td><input name="maxcomments" tabindex="90" size="3" value="<?php echo htmlspecialchars($blog->getMaxComments()); ?>" /></td>
</tr><tr>
$blog->setDefaultSkin(intPostVar('defskin'));
$blog->setDescription(trim(postVar('desc')));
$blog->setPublic(postVar('public'));
- $blog->setPingUserland(postVar('pinguserland'));
+ $blog->setPingUserland(postVar('sendping'));
$blog->setConvertBreaks(intPostVar('convertbreaks'));
$blog->setAllowPastPosting(intPostVar('allowpastposting'));
$blog->setDefaultCategory(intPostVar('defcat'));
'name' => &$bname,
'shortname' => &$bshortname,
'timeoffset' => &$btimeoffset,
- 'description' => &$bdescription,
+ 'description' => &$bdesc,
'defaultskin' => &$bdefskin
)
);
sql_query('UPDATE '.sql_table('plugin').' SET porder='.$oldOrder.' WHERE porder='.$newOrder);
sql_query('UPDATE '.sql_table('plugin').' SET porder='.$newOrder.' WHERE pid='.$plugid);
- $this->action_pluginlist();
+ //$this->action_pluginlist();
+ // To avoid showing ticket in the URL, redirect to pluginlist, instead.
+ redirect('?action=pluginlist');
}
/**
sql_query('UPDATE '.sql_table('plugin').' SET porder='.$oldOrder.' WHERE porder='.$newOrder);
sql_query('UPDATE '.sql_table('plugin').' SET porder='.$newOrder.' WHERE pid='.$plugid);
- $this->action_pluginlist();
+ //$this->action_pluginlist();
+ // To avoid showing ticket in the URL, redirect to pluginlist, instead.
+ redirect('?action=pluginlist');
}
/**
} // class ADMIN
-?>
\ No newline at end of file
+?>