Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18298
Modified Files:
NEWS serendipity_functions.inc.php
Log Message:
call 'Backend_publish' hook for entries saved first as 'draft' and then as
'publish'.
Index: serendipity_functions.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v
retrieving revision 1.307
retrieving revision 1.308
diff -u -d -r1.307 -r1.308
--- serendipity_functions.inc.php 1 Jul 2004 20:50:22 -0000 1.307
+++ serendipity_functions.inc.php 2 Jul 2004 12:47:46 -0000 1.308
@@ -595,8 +595,7 @@
/**
* Give it a range in YYYYMMDD format to gather the desired entries
-* (For february 2002 you would pass 200202 for all entries withing
-* two timestamps you would pass array(timestamp1,timestamp2)
+* (For february 2002 you would pass 200202 e.g.
**/
function serendipity_fetchEntries($range = null, $full = true, $limit = '', $fetchDrafts = false, $modified_since = false, $orderby = 'timestamp DESC', $filter_sql = '') {
global $serendipity;
@@ -636,11 +635,6 @@
if ($drafts) {
$and .= " AND $drafts";
}
- }
- elseif (is_array($range) && count($range)==2) {
- $startts = $range[0];
- $endts = $range[1];
- $and = " WHERE timestamp >= $startts AND timestamp <= $endts";
} else {
if ($modified_since) {
$unix_modified = strtotime($modified_since);
@@ -1412,8 +1406,10 @@
$i = 0;
foreach ($comments as $comment) {
+ $i++;
+
if (!isset($comment['parent_id']) || $comment['parent_id'] == $parentid) {
- $i++;
+
$comment['comment'] = htmlspecialchars(strip_tags($comment['body']));
if (!empty($comment['url']) && substr($comment['url'], 0, 7) != 'http://' && substr($comment['url'], 0, 8) != 'https://') {
$comment['url'] = 'http://' . $comment['url'];
@@ -2379,8 +2375,9 @@
serendipity_purgeEntry($entry['id'], $entry['timestamp']);
- if ($entry['isdraft'] == 'false' &&
- $newEntry) {
+ // Send publish tags if either a new article has been inserted from scratch, or if the entry was previously
+ // stored as draft and is now published
+ if ($entry['isdraft'] == 'false' && ($newEntry || $_entry['isdraft'] == 'true')) {
serendipity_plugin_api::hook_event('backend_publish', $entry);
}
Index: NEWS
===================================================================
RCS file: /cvsroot/php-blog/serendipity/NEWS,v
retrieving revision 1.163
retrieving revision 1.164
diff -u -d -r1.163 -r1.164
--- NEWS 1 Jul 2004 18:35:17 -0000 1.163
+++ NEWS 2 Jul 2004 12:47:46 -0000 1.164
@@ -3,6 +3,10 @@
Version 0.7 ()
------------------------------------------------------------------------
+ * Plugin hook 'backend_publish' now executed on entries saved as
+ draft first and after that as a public. Fixes weblogpings not sent
+ to those entries. (garvinhicking)
+
* Added the ability to toggle the display of the Serendipity logo and
text in the "Powered by" plugin (tomsommer)
|