Update of /cvsroot/php-blog/serendipity/plugins/serendipity_event_weblogping
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22863/plugins/serendipity_event_weblogping
Modified Files:
serendipity_event_weblogping.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_event_weblogping.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/plugins/serendipity_event_weblogping/serendipity_event_weblogping.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- serendipity_event_weblogping.php 22 Jun 2004 13:45:47 -0000 1.9
+++ serendipity_event_weblogping.php 18 Oct 2004 18:22:10 -0000 1.10
@@ -153,14 +153,14 @@
foreach($this->services AS $index => $service) {
// Detect if the current checkbox needs to be saved. We use the field chk_timestamp to see,
// if the form has already been submitted and individual changes shall be preserved
- $selected = (($serendipity['POST']['chk_timestamp'] && $serendipity['POST']['announce_entries_' . $service['name']]) || (!isset($serendipity['POST']['chk_timestamp']) && $this->get_config($service['name']) == 'true') ? 'checked="checked"' : '');
+ $selected = (($serendipity['POST']['chk_timestamp'] && $serendipity['POST']['announce_entries][' . $service['name']]) || (!isset($serendipity['POST']['chk_timestamp']) && $this->get_config($service['name']) == 'true') ? 'checked="checked"' : '');
$onclick = '';
if (!empty($service['supersedes'])) {
$onclick = 'onclick="';
$supersedes = explode(', ', $service['supersedes']);
foreach($supersedes AS $sid => $servicename) {
- $onclick .= 'document.getElementById(\'serendipity[announce_entries_' . $servicename . ']\').checked = false; ';
+ $onclick .= 'document.getElementById(\'serendipity[announce_entries][' . $servicename . ']\').checked = false; ';
}
$onclick .= '"';
}
@@ -168,8 +168,8 @@
$title = sprintf(PLUGIN_EVENT_WEBLOGPING_SENDINGPING, $service['name'])
. (!empty($service['supersedes']) ? ' ' . sprintf(PLUGIN_EVENT_WEBLOGPING_SUPERSEDES, $service['supersedes']) : '');
?>
- <input <?php echo $onclick; ?> style="margin: 0px; padding: 0px; vertical-align: bottom;" type="checkbox" name="serendipity[announce_entries_<?php echo $service['name']; ?>]" id="serendipity[announce_entries_<?php echo $service['name']; ?>]" value="true" <?php echo $selected; ?> />
- <label title="<?php echo $title; ?>" style="vertical-align: bottom; margin: 0px; padding: 0px;" for="serendipity[announce_entries_<?php echo $service['name']; ?>]"> <?php echo $service['name']; ?> </label><br />
+ <input <?php echo $onclick; ?> style="margin: 0px; padding: 0px; vertical-align: bottom;" type="checkbox" name="serendipity[announce_entries][<?php echo $service['name']; ?>]" id="serendipity[announce_entries][<?php echo $service['name']; ?>]" value="true" <?php echo $selected; ?> />
+ <label title="<?php echo $title; ?>" style="vertical-align: bottom; margin: 0px; padding: 0px;" for="serendipity[announce_entries][<?php echo $service['name']; ?>]"> <?php echo $service['name']; ?> </label><br />
<?php
}
?>
@@ -181,17 +181,17 @@
case 'backend_publish':
// First cycle through list of services to remove superseding services which may have been checked
foreach ($this->services as $index => $service) {
- if (!empty($service['supersedes']) && isset($serendipity['POST']['announce_entries_' . $service['name']])) {
+ if (!empty($service['supersedes']) && isset($serendipity['POST']['announce_entries][' . $service['name']])) {
$supersedes = explode(', ', $service['supersedes']);
foreach($supersedes AS $sid => $servicename) {
// A service has been checked that is superseded by another checked meta-service. Remove that service from the list of services to be ping'd
- unset($serendipity['POST']['announce_entries_' . $servicename]);
+ unset($serendipity['POST']['announce_entries][' . $servicename]);
}
}
}
foreach ($this->services as $index => $service) {
- if (isset($serendipity['POST']['announce_entries_' . $service['name']])) {
+ if (isset($serendipity['GET']['announce_entries'][$service['name']])) {
printf(PLUGIN_EVENT_WEBLOGPING_SENDINGPING . '...<br />', $service['host']);
flush();
|