aboutsummaryrefslogtreecommitdiffstats
path: root/ws.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2007-02-22 01:12:32 +0000
committerrvelices <rv-github@modusoptimus.com>2007-02-22 01:12:32 +0000
commitcea58b64ee31c3b34887845bef6761edee3c6fc7 (patch)
tree66e631cdcad99b2189f57627fc77806fc3ca644f /ws.php
parent64108c075b87b5b4815f451909dd9d9b3a7f545a (diff)
- user comments are not saved in the database with htmlspecialchars anymore
- web service: added the possibility to enter a user comment using the service... - new comment functions from picture_comment.inc.php git-svn-id: http://piwigo.org/svn/trunk@1849 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'ws.php')
-rw-r--r--ws.php21
1 files changed, 18 insertions, 3 deletions
diff --git a/ws.php b/ws.php
index 740f5b03e..ca3832a44 100644
--- a/ws.php
+++ b/ws.php
@@ -3,7 +3,6 @@
// | PhpWebGallery - a PHP based picture gallery |
// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
// +-----------------------------------------------------------------------+
-// | branch : BSF (Best So Far)
// | file : $Id$
// | last update : $Date$
// | last modifier : $Author$
@@ -40,7 +39,7 @@ if ( !$conf['allow_web_services'] )
function ws_addDefaultMethods( $arr )
{
include_once(PHPWG_ROOT_PATH.'include/ws_functions.inc.php');
- global $conf;
+ global $conf, $user;
$service = &$arr[0];
$service->addMethod('pwg.getVersion', 'ws_getVersion', null,
'retrieves the PWG version');
@@ -77,8 +76,24 @@ function ws_addDefaultMethods( $arr )
),
'retrieves a list of categories' );
+ $service->addMethod('pwg.images.addComment', 'ws_images_addComment',
+ array(
+ 'image_id' => array(),
+ 'author' => array( 'default' => $user['is_the_guest']? 'guest':$user['username']),
+ 'content' => array(),
+ 'key' => array(),
+ ),
+ 'add a comment to an image' );
+
$service->addMethod('pwg.images.getInfo', 'ws_images_getInfo',
- array('image_id'),
+ array(
+ 'image_id' => array(),
+ 'comments_page' => array('default'=>0 ),
+ 'comments_per_page' => array(
+ 'default' => $conf['nb_comment_page'],
+ 'maxValue' => 2*$conf['nb_comment_page'],
+ ),
+ ),
'retrieves information about the given photo' );
$service->addMethod('pwg.images.search', 'ws_images_search',