Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1:/tmp/cvs-serv6617
Modified Files:
serendipity_functions.inc.php serendipity_lang_de.inc.php
serendipity_lang_en.inc.php NEWS
Log Message:
* Added blogg.de to RPC-ping list
* Made pinging of weblog directories configurable in the entry creation
screen (uses defaults set in the configuration)
* Added some trackback output after those were sent
* Modified login a bit more for better understandable code
Index: serendipity_functions.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v
retrieving revision 1.181
retrieving revision 1.182
diff -u -d -r1.181 -r1.182
--- serendipity_functions.inc.php 21 Jan 2004 08:40:54 -0000 1.181
+++ serendipity_functions.inc.php 21 Jan 2004 10:10:39 -0000 1.182
@@ -15,7 +15,7 @@
function serendipity_login() {
global $serendipity;
- if ( serendipity_authenticate_author("", "") ) {
+ if (serendipity_authenticate_author()) {
#The session has this data already
#we previously just checked the value of $_SESSION['serendipityAuthedUser'] but
#we need the authorid still, so call serendipity_authenticate_author with blank
@@ -2164,6 +2164,35 @@
<textarea name="serendipity[extended]" id="serendipity[extended]" cols="80" rows="20"><?php echo isset($entry['extended']) ? htmlentities($entry['extended']) : ''; ?></textarea>
</td>
</tr>
+
+<?php
+ if ($serendipity['announce_entries']) {
+?>
+ <tr>
+ <td colspan="3">
+ <br />
+ <fieldset>
+ <legend><b><?php echo ADVANCED_OPTIONS; ?></b></legend>
+ <fieldset>
+ <legend><?php echo PING_WEBLOGS; ?></legend>
+<?php
+ $services = array('blogs' => 'blo.gs', 'blogrolling' => 'blogrolling.com', 'technorati' => 'technorati.com', 'weblogs' => 'weblogs.com', 'bloggde' => 'blogg.de');
+ foreach($services AS $service => $service_desc) {
+ // 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]) || (!isset($serendipity['POST']['chk_timestamp']) && $serendipity['announce_entries_' . $service])? 'checked="checked"' : '');
+?>
+ <input style="margin: 0px; padding: 0px; vertical-align: bottom;" type="checkbox" name="serendipity[announce_entries_<?php echo $service; ?>]" id="serendipity[announce_entries_<?php echo $service; ?>]" value="true" <?php echo $selected; ?> />
+ <label style="vertical-align: bottom; margin: 0px; padding: 0px;" for="serendipity[announce_entries_<?php echo $service; ?>]"> <?php echo $service_desc; ?> </label>
+<?php
+ }
+?>
+ </fieldset>
+ </td>
+ </tr>
+<?php
+ }
+?>
</table>
</form>
<?php
@@ -2176,7 +2205,7 @@
}
}
-function serendipity_authenticate_author($username, $password) {
+function serendipity_authenticate_author($username = '', $password = '') {
global $serendipity;
if (isset($_SESSION['serendipityUser']) && isset($_SESSION['serendipityEmail']) && isset($_SESSION['serendipityAuthorid']) && isset($_SESSION['serendipityAuthedUser']) && $_SESSION['serendipityAuthedUser'] == true) {
@@ -2186,25 +2215,27 @@
return true;
}
- $password = md5($password);
-
- $query = "SELECT DISTINCT
- email, authorid
- FROM
- $serendipity[dbPrefix]authors
- WHERE
- username = '$username'
- AND password = '$password'";
- $row = serendipity_db_query($query, true, 'assoc');
-
- if (is_array($row)) {
- $_SESSION['serendipityUser'] = $serendipity['serendipityUser'] = $username;
- $_SESSION['serendipityEmail'] = $serendipity['serendipityEmail'] = $row['email'];
- $_SESSION['serendipityAuthorid'] = $serendipity['authorid'] = $row['authorid'];
- $_SESSION['serendipityAuthedUser'] = $serendipity['serendipityAuthedUser'] = true;
- return true;
+ if ($username != '') {
+ $password = md5($password);
+
+ $query = "SELECT DISTINCT
+ email, authorid
+ FROM
+ $serendipity[dbPrefix]authors
+ WHERE
+ username = '$username'
+ AND password = '$password'";
+ $row = serendipity_db_query($query, true, 'assoc');
+
+ if (is_array($row)) {
+ $_SESSION['serendipityUser'] = $serendipity['serendipityUser'] = $username;
+ $_SESSION['serendipityEmail'] = $serendipity['serendipityEmail'] = $row['email'];
+ $_SESSION['serendipityAuthorid'] = $serendipity['authorid'] = $row['authorid'];
+ $_SESSION['serendipityAuthedUser'] = $serendipity['serendipityAuthedUser'] = true;
+ return true;
+ }
}
-
+
return false;
}
@@ -2523,7 +2554,7 @@
$services = array();
- if ($serendipity['announce_entries_blogs']) {
+ if ($serendipity['announce_entries_blogs'] && $serendipity['POST']['announce_entries_blogs'] == 'true') {
$services[] = array(
'host' => 'ping.blo.gs',
'path' => '/',
@@ -2531,28 +2562,37 @@
);
}
- if ($serendipity['announce_entries_blogrolling']) {
+ if ($serendipity['announce_entries_blogrolling'] && $serendipity['POST']['announce_entries_blogrolling'] == 'true') {
$services[] = array(
'host' => 'rpc.blogrolling.com',
'path' => '/pinger/'
);
}
- if ($serendipity['announce_entries_technorati']) {
+ if ($serendipity['announce_entries_technorati'] && $serendipity['POST']['announce_entries_technorati'] == 'true') {
$services[] = array(
'host' => 'rpc.technorati.com',
'path' => '/rpc/ping'
);
}
- if ($serendipity['announce_entries_weblogs']) {
+ if ($serendipity['announce_entries_weblogs'] && $serendipity['POST']['announce_entries_weblogs'] == 'true') {
$services[] = array(
'host' => 'rpc.weblogs.com',
'path' => '/RPC2'
);
}
+ if ($serendipity['announce_entries_bloggde'] && $serendipity['POST']['announce_entries_bloggde'] == 'true') {
+ $services[] = array(
+ 'host' => 'ping.blogg.de',
+ 'path' => '/'
+ );
+ }
+
foreach ($services as $service => $details) {
+ printf(SENDING_PING . '...<br />', $details['host']);
+
# XXX append $serendipity['indexFile'] to baseURL?
$args = array(
new XML_RPC_Value(
Index: serendipity_lang_de.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_lang_de.inc.php,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- serendipity_lang_de.inc.php 20 Jan 2004 11:12:37 -0000 1.40
+++ serendipity_lang_de.inc.php 21 Jan 2004 10:10:39 -0000 1.41
@@ -316,6 +316,9 @@
@define('GENERAL_PLUGIN_LANGUAGE', 'Anzeigesprache');
@define('GENERAL_PLUGIN_LANGUAGE_BLAHBLAH', 'In welcher Sprache soll das Datum formatiert werden? ("en|de", Standard "en")');
@define('ERROR_TEMPLATE_FILE', 'Die Templatedatei konnte nicht geöffnet werden, bitte die serendipity-Version aktualisieren!');
+@define('ADVANCED_OPTIONS', 'Erweiterte Optionen');
+@define('PING_WEBLOGS', 'Einträge ankündigen (via XML-RPC ping) bei:');
+@define('SENDING_PING', 'Sende XML-RPC ping zu %s');
/* vim: set sts=4 ts=4 expandtab : */
?>
Index: serendipity_lang_en.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_lang_en.inc.php,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- serendipity_lang_en.inc.php 20 Jan 2004 11:12:37 -0000 1.51
+++ serendipity_lang_en.inc.php 21 Jan 2004 10:10:39 -0000 1.52
@@ -316,6 +316,9 @@
@define('GENERAL_PLUGIN_LANGUAGE', 'Output language');
@define('GENERAL_PLUGIN_LANGUAGE_BLAHBLAH', 'What is your output language used for date and text formatting? ("en|de", default "en")');
@define('ERROR_TEMPLATE_FILE', 'Unable to open template file, please update serendipity!');
+@define('ADVANCED_OPTIONS', 'Advanced Options');
+@define('PING_WEBLOGS', 'Announce entries (via XML-RPC ping) to:');
+@define('SENDING_PING', 'Sending XML-RPC ping to host %s');
/* vim: set sts=4 ts=4 expandtab : */
?>
Index: NEWS
===================================================================
RCS file: /cvsroot/php-blog/serendipity/NEWS,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- NEWS 21 Jan 2004 08:49:05 -0000 1.44
+++ NEWS 21 Jan 2004 10:10:39 -0000 1.45
@@ -2,6 +2,7 @@
Version 0.5 ()
------------------------------------
+ * Made pinging blogs configurable/changeable per-entry. Added "blogg.de" to RPC-ping list (garvinhicking)
* Fixed referrer and exit tracking on PostgreSQL (jtate)
* Added support for pinging weblogs.com, blo.gs, blogrolling.com and technorati.com to announce new entries. (jimwinstead & sebastianbergmann)
* Added mod_rewrite rules to .htaccess templates (garvinhicking)
|