Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22863
Modified Files:
serendipity_admin_entries.inc.php serendipity_entries.php
serendipity_functions.inc.php serendipity_rss_exchange.inc.php
serendipity_xmlrpc.php
Log Message:
This one's dirrty. As dirty as serendipity_entries.php.
When an entry is saved, the trackbacks and xmlrpc pings are opened in an iframe
that has ignore_user_abort(true) in it. Even though the status-iframe's content
is not scrolling nicely but popping up all in one, it's still better than the old
solution.
You can now hit save and close the browser. Or wait to see if the pings work. There
is the possibility that the pings aren't performed, when the user leaves the page
_before_ the iframe's content has _started_ to load. Do you think this is likely?
Maybe on a dialup connection? If so, the constant PERFORMING_XMLRPC_PLEASE_WAIT
should contain something like 'wait a few seconds before you load a new page' or so.
I don't have much time atm, so please, have a look at this commit and try it out,
since the serendipity_updertEntry() function has been modified (added a parameter.
Again, this is dirrty and I don't like it. But you can't define something like
function foo(&$bar = false);
As Garvin asked me to pack up rc1 tomorrow, we really need this tested, because there
has been chaotic code added to chaotic code. Potentially dangerous :-)
Alright, enough babbling. cvs upd and spank me if I broke something or forgot
to reomve debug statements or so...
Index: serendipity_xmlrpc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_xmlrpc.php,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- serendipity_xmlrpc.php 20 Sep 2004 14:00:14 -0000 1.17
+++ serendipity_xmlrpc.php 18 Oct 2004 18:22:07 -0000 1.18
@@ -212,7 +212,7 @@
$entry['body'] = $val->getval();
$entry['allow_comments'] = $serendipity['allowCommentsDefault'];
$entry['moderate_comments'] = $serendipity['moderateCommentsDefault'];
- $id = serendipity_updertEntry($entry);
+ $id = serendipity_updertEntry($entry, $foo);
return new XML_RPC_Response(new XML_RPC_Value($id, 'string'));
}
@@ -229,7 +229,7 @@
$val = $message->params[4];
$entry['body'] = $val->getval();
$entry['author'] = $username;
- $id = serendipity_updertEntry($entry);
+ $id = serendipity_updertEntry($entry, $foo);
return new XML_RPC_Response(new XML_RPC_Value($id, 'string'));
}
@@ -296,7 +296,7 @@
$entry['allow_comments'] = $serendipity['allowCommentsDefault'];
$entry['moderate_comments'] = $serendipity['moderateCommentsDefault'];
- $id = serendipity_updertEntry($entry);
+ $id = serendipity_updertEntry($entry, $foo);
return new XML_RPC_Response(new XML_RPC_Value($id, 'string'));
}
@@ -318,7 +318,7 @@
$entry['isdraft'] = 'false';
$entry['id'] = $postid;
- $id = serendipity_updertEntry($entry);
+ $id = serendipity_updertEntry($entry, $foo);
return new XML_RPC_Response(new XML_RPC_Value($id ? true : false, 'boolean'));
}
@@ -350,7 +350,7 @@
$entry['authorid'] = $serendipity['authorid'];
$entry['id'] = $postid;
- $id = serendipity_updertEntry($entry);
+ $id = serendipity_updertEntry($entry, $foo);
return new XML_RPC_Response(new XML_RPC_Value($id ? true : false, 'boolean'));
}
Index: serendipity_entries.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_entries.php,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- serendipity_entries.php 28 Sep 2004 10:03:47 -0000 1.41
+++ serendipity_entries.php 18 Oct 2004 18:22:06 -0000 1.42
@@ -35,19 +35,21 @@
</head>
<body class="s9y_wrap" id="serendipity_admin_entries_page" onload="if (self.Spawnextended) { Spawnextended(); } if (self.Spawnbody) { Spawnbody(); }">
+<?php if (!$serendipity['GET']['noHeader']) { ?>
<div id="serendipity_banner">
<h1><?php echo $serendipity['blogTitle'] ; ?></h1>
<h2><?php echo SERENDIPITY_AUTHORING_SUITE . ((serendipity_userLoggedIn()) ? ' ('. sprintf(USER_SELF_INFO, $serendipity['serendipityUser'], $serendipity['serendipityUserlevel']) .')' : ''); ?></h2>
</div>
-
<table id="mainpane">
<tr valign="top">
+<?php } ?>
<?php
if ( !serendipity_userLoggedIn() ) {
serendipity_printLogin();
} else {
?>
- <td id="serendipityLeftSideBar">
+<?php if (!$serendipity['GET']['noHeader']) { ?>
+ <td id="serendipityLeftSideBar">
<div class="serendipitySideBarItem">
<div class="serendipitySideBarTitle"><?php echo ucfirst(ENTRIES); ?>:</div>
<div class="serendipitySideBarContent">
@@ -87,9 +89,9 @@
</div>
</div>
</td>
-
<td id="content">
<div class="serendipity_Admin_title"><?php echo SERENDIPITY_AUTHORING_SUITE; ?></div>
+<?php } ?>
<div class="serendipity_Admin">
<?php
if (!isset($serendipity['GET']['adminModule'])) {
@@ -128,10 +130,12 @@
</div>
<?php
}
+if (!$serendipity['GET']['noHeader']) {
?>
</td>
</tr>
</table>
+<?php } ?>
</body>
</html>
<?php
Index: serendipity_admin_entries.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_admin_entries.inc.php,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- serendipity_admin_entries.inc.php 1 Sep 2004 17:17:41 -0000 1.37
+++ serendipity_admin_entries.inc.php 18 Oct 2004 18:22:06 -0000 1.38
@@ -283,7 +283,7 @@
// Save the entry, or just display a preview
if ($serendipity['POST']['preview'] != 'true') {
- $res = serendipity_updertEntry($entry);
+ $res = serendipity_updertEntry($entry, $backendPublish);
if (is_string($res)) {
serendipity_printEntryForm(
'?',
@@ -295,7 +295,13 @@
$entry,
ERROR . ': <b>' . $res . '</b>');
} else {
- echo '<div class="serendipity_msg_notice">' . ENTRY_SAVED . '</div>';
+ echo '<div class="serendipity_msg_notice">' . ENTRY_SAVED . '<br />' .PERFORMING_XMLRPC_PLEASE_WAIT. '</div>';
+ echo '<iframe style="border:0;" src="?serendipity[noHeader]=true&serendipity[adminModule]=entries&serendipity[adminAction]=handleReferences&serendipity[id]='.$res.
+ '&serendipity[backendPublish]='.$backendPublish;
+ foreach($serendipity['POST']['announce_entries'] as $k => $v) {
+ echo '&serendipity[announce_entries]['.$k.']='.$v;
+ }
+ echo '" height="500" width="700" name="s9yTrackbackWindow" />';
}
} else {
// Only display the preview
@@ -330,6 +336,17 @@
}
break;
+ case 'handleReferences':
+ ignore_user_abort(true);
+ $entry = serendipity_fetchEntry('id', $serendipity[GET]['id']);
+ flush();
+ serendipity_handle_references($entry['id'], $serendipity['blogTitle'], $entry['title'], $entry['body'] . $entry['extended'], $newEntry);
+ if ($serendipity['GET']['backendPublish']=='true') {
+ serendipity_plugin_api::hook_event('backend_publish', $entry);
+ }
+ echo '<br />'.PERFORMING_XMLRPC_DONE;
+ break;
+
case 'editSelect':
serendipity_drawList();
break;
Index: serendipity_functions.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v
retrieving revision 1.445
retrieving revision 1.446
diff -u -d -r1.445 -r1.446
--- serendipity_functions.inc.php 16 Oct 2004 20:38:16 -0000 1.445
+++ serendipity_functions.inc.php 18 Oct 2004 18:22:06 -0000 1.446
@@ -2588,7 +2588,7 @@
/**
* Inserts a new entry into the database or updates an existing
**/
-function serendipity_updertEntry($entry) {
+function serendipity_updertEntry($entry, &$backendPublish) {
global $serendipity;
$categories = $entry['categories'];
@@ -2688,17 +2688,15 @@
if ($entry['isdraft'] == 'false') {
serendipity_plugin_api::hook_event('frontend_display', $entry, array('no_scramble' => true));
- serendipity_handle_references($entry['id'], $serendipity['blogTitle'], $entry['title'], $entry['body'] . $entry['extended'], $newEntry);
+
}
serendipity_purgeEntry($entry['id'], $entry['timestamp']);
// 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);
- }
-
+ $backendPublish = ($entry['isdraft'] == 'false' && ($newEntry || $_entry['isdraft'] == 'true')) ? 'true' : 'false';
+
return (int)$entry['id'];
}
Index: serendipity_rss_exchange.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_rss_exchange.inc.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- serendipity_rss_exchange.inc.php 7 Oct 2004 10:34:27 -0000 1.11
+++ serendipity_rss_exchange.inc.php 18 Oct 2004 18:22:07 -0000 1.12
@@ -74,7 +74,7 @@
$serendipity['noautodiscovery'] = 1;
while ($item = $c->getNextItem()) {
if (serendipity_rss_buildEntry($item, $entry)) {
- serendipity_updertEntry($entry);
+ serendipity_updertEntry($entry, $foo);
}
}
|