From 9d6ed35e4faa192ea734bfc353a6be65b977a6e6 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sun, 28 Sep 2008 19:18:26 +0000 Subject: Central: Added countSubscribers() Closes #67 --- central/trunk/xmlrpc.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'central/trunk/xmlrpc.php') diff --git a/central/trunk/xmlrpc.php b/central/trunk/xmlrpc.php index 0e66940..ea77e3f 100644 --- a/central/trunk/xmlrpc.php +++ b/central/trunk/xmlrpc.php @@ -237,6 +237,15 @@ function deinitalizePort($username, $verification, $verificationID) return new xmlrpcresp(new xmlrpcval('1', 'int')); } +function countSubscribers($url) +{ + $cntsub = "SELECT * FROM subscriptions WHERE url = \"" . mysql_real_escape_string($url) . "\""; + $cntsub2 = mysql_query($cntsub); + $cntsub3 = mysql_fetch_array($cntsub2); + + return new xmlrpcresp(new xmlrpcval($cntsub3[0], 'int')); +} + $s = new xmlrpc_server( array( "InstaDisc.checkRegistration" => array("function" => "checkRegistration"), "InstaDisc.deleteItem" => array("function" => "deleteItem"), "InstaDisc.resendItem" => array("function" => "resendItem"), @@ -248,7 +257,8 @@ $s = new xmlrpc_server( array( "InstaDisc.checkRegistration" => array("function" "InstaDisc.downloadItemModeTest" => array("function" => "downloadItemModeTest"), "InstaDisc.setDownloadItemMode" => array("function" => "setDownloadItemMode"), "InstaDisc.initalizePort" => array("function" => "initalizePort"), - "InstaDisc.deinitalizePort" => array("function" => "deinitalizePort") + "InstaDisc.deinitalizePort" => array("function" => "deinitalizePort"), + "InstaDisc.countSubscribers" => array("function" => "countSubscribers") ),0); $s->functions_parameters_type = 'phpvals'; $s->service(); -- cgit 1.4.1