Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1:/tmp/cvs-serv30817
Modified Files:
TODO serendipity_config_local.tpl
serendipity_functions.inc.php
Log Message:
Make pinging of weblog services configurable and disabled by default.
Index: TODO
===================================================================
RCS file: /cvsroot/php-blog/serendipity/TODO,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- TODO 18 Jan 2004 12:46:39 -0000 1.12
+++ TODO 18 Jan 2004 14:02:09 -0000 1.13
@@ -15,7 +15,6 @@
* Allow for blogging from GNOME Blog (http://www.gnome.org/~seth/gnome-blog/)
and gaim-blogger (http://gaim-blogger.sourceforge.net/).
* Instead of keeping track of how many comments in the entries table, do some kind of JOIN with the comments table.
-* Make pinging of blo.gs et al. configurable.
! Don't trackback files (zip, rar etc.) (Check headers for content-type? or just file extension?)
! Allow for upgrades of Serendipity in the installer
Index: serendipity_config_local.tpl
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_config_local.tpl,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- serendipity_config_local.tpl 7 Jan 2004 17:45:50 -0000 1.22
+++ serendipity_config_local.tpl 18 Jan 2004 14:02:09 -0000 1.23
@@ -47,4 +47,11 @@
$serendipity['thumbSuffix'] = '{Thumbnail suffix|thumbSuffix|string|serendipityThumb}'; // Thumbnails will be named original.Suffix.ext
$serendipity['thumbSize'] = '{Thumbnail dimensions|thumbSize|int|110}'; // Static width of auto-generated thumbnails
+// Pingin of Weblog Services
+# Announcement of new weblog entries
+$serendipity['announce_entries'] = '{Announce Entries|announce_entries|bool|0}'; // Do you want new entries to be announced?
+$serendipity['announce_entries_blogs'] = '{blo.gs|announce_entries_blogs|bool|0}'; // Do you want new entries to be announced on blo.gs?
+$serendipity['announce_entries_blogrolling'] = '{blogrolling.com|announce_entries_blogrolling|bool|0}'; // Do you want new entries to be announced on blogrolling.com?
+$serendipity['announce_entries_technorati'] = '{technorati.com|announce_entries_technorati|bool|0}'; // Do you want new entries to be announced on technorati.com?
+$serendipity['announce_entries_weblogs'] = '{weblogs.com|announce_entries_weblogs|bool|0}'; // Do you want new entries to be announced on weblogs.com?
?>
Index: serendipity_functions.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v
retrieving revision 1.177
retrieving revision 1.178
diff -u -d -r1.177 -r1.178
--- serendipity_functions.inc.php 18 Jan 2004 12:46:39 -0000 1.177
+++ serendipity_functions.inc.php 18 Jan 2004 14:02:09 -0000 1.178
@@ -1804,7 +1804,9 @@
serendipity_purgeEntry($entry['id'], $entry['timestamp']);
# XXX this may not handle a previously-entered draft being made live
- if ( $entry['isdraft'] == 'false' && $newEntry ) {
+ if ($serendipity['announce_entries'] &&
+ $entry['isdraft'] == 'false' &&
+ $newEntry) {
serendipity_announceEntry();
}
@@ -2517,13 +2519,36 @@
function serendipity_announceEntry() {
global $serendipity;
- # XXX: TODO: Allow the list of services to be configured.
- $services = array(
- 'weblogs.com' => array('host' => 'rpc.weblogs.com', 'path' => '/RPC2'),
- 'blo.gs' => array('host' => 'ping.blo.gs', 'path' => '/', 'extended' => true),
- 'blogrolling.com' => array('host' => 'rpc.blogrolling.com', 'path' => '/pinger/'),
- 'technorati.com' => array('host' => 'rpc.technorati.com', 'path' => '/rpc/ping'),
- );
+ $services = array();
+
+ if ($serendipity['announce_entries_blogs']) {
+ $services[] = array(
+ 'host' => 'ping.blo.gs',
+ 'path' => '/',
+ 'extended' => true
+ );
+ }
+
+ if ($serendipity['announce_entries_blogrolling']) {
+ $services[] = array(
+ 'host' => 'rpc.blogrolling.com',
+ 'path' => '/pinger/'
+ );
+ }
+
+ if ($serendipity['announce_entries_technorati']) {
+ $services[] = array(
+ 'host' => 'rpc.technorati.com',
+ 'path' => '/rpc/ping'
+ );
+ }
+
+ if ($serendipity['announce_entries_weblogs']) {
+ $services[] = array(
+ 'host' => 'rpc.weblogs.com',
+ 'path' => '/RPC2'
+ );
+ }
foreach ($services as $service => $details) {
# XXX append $serendipity['indexFile'] to baseURL?
@@ -2574,4 +2599,4 @@
define("serendipity_FUNCTIONS_LOADED", true);
/* vim: set sts=4 ts=4 expandtab : */
?>
-
\ No newline at end of file
+
\ No newline at end of file
|