Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1:/tmp/cvs-serv3901
Modified Files:
serendipity_functions.inc.php serendipity_xmlrpc.php
Log Message:
Removed function serendipity_updateEntry, since this functionality is covered by serendipity_updertEntry (mixture between UPdate and insERT, was meant to say "this function does both"). serendipity_xmlrpc.php was the only file using serendipity_updateEntry() and has been fixed. I think George is the only one using xmlrpc, can you check to make sure it still works?
Index: serendipity_functions.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- serendipity_functions.inc.php 24 May 2003 01:37:32 -0000 1.46
+++ serendipity_functions.inc.php 24 May 2003 14:10:39 -0000 1.47
@@ -1004,37 +1004,6 @@
return (int)$entry['id'];
}
-function serendipity_updateEntry($entry) {
- global $serendipity;
-
- $newEntry = 0;
- $exflag = 0;
-
- if (!is_numeric($entry["id"])) {
- return;
- }
- if(strlen($entry["extended"])) {
- $exflag = 1;
- }
- $querystring = "UPDATE ".$serendipity["dbPrefix"]."entries
- SET title = '".serendipity_db_escape_string($entry["title"])."',
- body = '".serendipity_db_escape_string($entry["body"])."',
- extended = '".serendipity_db_escape_string($entry["extended"])."',
- exflag = '$exflag' WHERE id = ".$entry["id"];
- $query = serendipity_db_query($querystring);
- if (is_string($query)) {
- return $query;
- }
- if($exflag) {
- serendipity_handle_references($entry['id'], $serendipity['blogTitle'], $entry['title'], $entry['extended'], $newEntry);
- }
- else {
- serendipity_handle_references($entry['id'], $serendipity['blogTitle'], $entry['title'], $entry['body'], $newEntry);
- }
- serendipity_purgeEntry($entry['id'], $entry['timestamp']);
- return $entry['id'];
-}
-
/**
* Deletes an entry and everything that belongs to it (comments, etc...) from
* the database
Index: serendipity_xmlrpc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_xmlrpc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- serendipity_xmlrpc.php 23 May 2003 17:33:02 -0000 1.2
+++ serendipity_xmlrpc.php 24 May 2003 14:10:40 -0000 1.3
@@ -3,7 +3,7 @@
require_once 'serendipity_config.inc.php';
require_once 'bundled-libs/XML/RPC/Server.php';
-$dispatches = array('blogger.getUsersBlogs' =>
+$dispatches = array('blogger.getUsersBlogs' =>
array('function' => 'blogger_getUsersBlogs'),
'blogger.getUserInfo' =>
array('function' => 'blogger_getUserInfo'),
@@ -34,7 +34,7 @@
'mt.supportedTextFilters' =>
array('function' => 'mt_supportedTextFilters'));
-function blogger_getUsersBlogs($message)
+function blogger_getUsersBlogs($message)
{
global $serendipity;
@@ -46,8 +46,8 @@
return new XML_RPC_Response('', 4, "Authentication Failed");
}
$blog1 = new XML_RPC_Value(
- array('url' => new XML_RPC_Value($serendipity['baseURL']),
- 'blogid' => new XML_RPC_Value('1'),
+ array('url' => new XML_RPC_Value($serendipity['baseURL']),
+ 'blogid' => new XML_RPC_Value('1'),
'blogName' => new XML_RPC_Value($serendipity['blogTitle'])),
'struct');
$blogs = new XML_RPC_Value( array($blog1), 'array');
@@ -55,7 +55,7 @@
return($r);
}
-function blogger_getUserInfo($message)
+function blogger_getUserInfo($message)
{
global $serendipity;
$val = $message->params[1];
@@ -67,10 +67,10 @@
}
$userdata = new XML_RPC_Value(
array('nickname' => new XML_RPC_Value($serendipity['serendipityUser']),
- 'userid' => new XML_RPC_Value($serendipity['authorid'], 'string'),
- 'url' => new XML_RPC_Value($serendipity['baseURL']),
- 'email' => new XML_RPC_Value($serendipity['serendipityEmail']),
- 'lastname' => new XML_RPC_Value(''),
+ 'userid' => new XML_RPC_Value($serendipity['authorid'], 'string'),
+ 'url' => new XML_RPC_Value($serendipity['baseURL']),
+ 'email' => new XML_RPC_Value($serendipity['serendipityEmail']),
+ 'lastname' => new XML_RPC_Value(''),
'firstname' => new XML_RPC_Value('')),
'struct');
$r = new XML_RPC_Response($userdata);
@@ -94,10 +94,10 @@
$xml_entries_vals[] = new XML_RPC_Value(
array(
'categoryId' => new XML_RPC_Value($cat['categoryid'], 'string'),
- 'categoryName' => new XML_RPC_Value($cat['category_name'], 'string')), 'struct');
+ 'categoryName' => new XML_RPC_Value($cat['category_name'], 'string')), 'struct');
}
$xml_entries = new XML_RPC_Value($xml_entries_vals, 'array');
- return new XML_RPC_Response($xml_entries);
+ return new XML_RPC_Response($xml_entries);
}
function mt_getRecentPostTitles($message)
@@ -123,7 +123,7 @@
'postid' => new XML_RPC_Value($entry['id'], 'string')), 'struct');
}
$xml_entries = new XML_RPC_Value($xml_entries_vals, 'array');
- return new XML_RPC_Response($xml_entries);
+ return new XML_RPC_Response($xml_entries);
}
function mt_supportedTextFilters($message)
@@ -167,7 +167,7 @@
$val = $message->params[4];
$entry['body'] = $val->getval();
$entry['user'] = $username;
- $id = serendipity_updateEntry($entry);
+ $id = serendipity_updertEntry($entry);
return new XML_RPC_Response( new XML_RPC_Value($id, 'string'));
}
@@ -226,7 +226,7 @@
$entry['user'] = $username;
$entry['authorid'] = $serendipity['authorid'];
$entry['id'] = $postid;
- $id = serendipity_updateEntry($entry);
+ $id = serendipity_updertEntry($entry);
return new XML_RPC_Response( new XML_RPC_Value($id));
}
@@ -248,9 +248,9 @@
'dateCreated' => new XML_RPC_Value(XML_RPC_iso8601_encode($entry['timestamp']), 'dateTime.iso8601'),
'postid' => new XML_RPC_Value($postid, 'string'),
'userid' => new XML_RPC_Value($entry['authorid'], 'string'),
- 'description' => new XML_RPC_Value($entry['body'], 'string'),
- 'mt_text_more'=> new XML_RPC_Value($entry['extended'], 'string'),
- 'mt_excerpt'=> new XML_RPC_Value('', 'string'),
+ 'description' => new XML_RPC_Value($entry['body'], 'string'),
+ 'mt_text_more'=> new XML_RPC_Value($entry['extended'], 'string'),
+ 'mt_excerpt'=> new XML_RPC_Value('', 'string'),
'mt_allow_comments' => new XML_RPC_Value(1, 'boolean'),
'mt_allow_pings' => new XML_RPC_Value(1, 'boolean'),
'mt_convert_breaks' => new XML_RPC_Value(0, 'boolean'),
@@ -258,7 +258,7 @@
'permalink' => new XML_RPC_Value($serendipity['baseURL']."/archives/e_$postid.html", 'string'),
'link' => new XML_RPC_Value($serendipity['baseURL']."/archives/e_$postid.html", 'string'));
$entry = new XML_RPC_Value($tmp, 'struct');
- return new XML_RPC_Response($entry);
+ return new XML_RPC_Response($entry);
}
function metaweblog_deletePost($message)
@@ -283,7 +283,7 @@
{
global $serendipity;
$val = $message->params[0];
- $postid = $val->getval();
+ $postid = $val->getval();
$val = $message->params[1];
$username = $val->getval();
$val = $message->params[2];
@@ -294,7 +294,7 @@
foreach ($categories as $cat) {
$val = $cat['categoryId'];
$category_ids[] = $val->getval();
- }
+ }
if(!serendipity_authenticate_author($username, $password)) {
return new XML_RPC_Response('', 4, "Authentication Failed");
}
@@ -318,7 +318,7 @@
{
global $serendipity;
$val = $message->params[0];
- $postid = $val->getval();
+ $postid = $val->getval();
$val = $message->params[1];
$username = $val->getval();
$val = $message->params[2];
|