update INSTALL and UPGRADE file
[phpfspot.git] / rpc.php
diff --git a/rpc.php b/rpc.php
index bdb62069eb11d7d6605f97f463b0d07c510b24d4..748fd250640326d4ed049fca4736a8d0f657435d 100644 (file)
--- a/rpc.php
+++ b/rpc.php
@@ -65,7 +65,7 @@ class PHPFSPOT_RPC {
       switch($action) {
          case 'showphoto':
             if(isset($_GET['id']) && is_numeric($_GET['id'])) {
-               $phpfspot->showPhoto($_GET['id']);
+               print $phpfspot->showPhoto($_GET['id']);
             }
             break;
    
@@ -98,6 +98,7 @@ class PHPFSPOT_RPC {
             $phpfspot->resetNameSearch();
             $phpfspot->resetTags();
             $phpfspot->resetDateSearch();
+            $phpfspot->resetRateSearch();
             $phpfspot->resetPhotoView();
             break;
 
@@ -117,7 +118,7 @@ class PHPFSPOT_RPC {
             if(isset($_GET['last_photo']) && is_numeric($_GET['last_photo']))
                $_SESSION['last_photo'] = $_GET['last_photo'];
 
-            $phpfspot->showPhotoIndex();
+            print $phpfspot->showPhotoIndex();
             break;
    
          case 'showcredits':
@@ -134,20 +135,25 @@ class PHPFSPOT_RPC {
             }
             break;
 
+         case 'update_photo_version':
+            if(isset($_POST['photo_version']) && is_numeric($_POST['photo_version']) &&
+               isset($_POST['photo_idx']) && is_numeric($_POST['photo_idx'])) {
+               print $phpfspot->update_photo_version($_POST['photo_idx'], $_POST['photo_version']);
+            }
+            break;
+
          case 'get_export':
             /* $_GET['mode'] will be validated by getExport() */
             $phpfspot->getExport($_GET['mode']);
             break;
 
          case 'get_photo_to_show':
-            $phpfspot->getCurrentPhoto();
+            print $phpfspot->get_current_photo();
             break;
 
          case 'get_calendar_matrix':
-            if((is_numeric($_GET['year']) || !isset($_GET['year'])) &&
-               (is_numeric($_GET['month']) || !isset($_GET['month'])) &&
-               (is_numeric($_GET['day']) || !isset($_GET['day']))) {
-               $phpfspot->get_calendar_matrix($_GET['year'], $_GET['month'], $_GET['day']);
+            if(isset($_GET['date']) && is_string($_GET['date'])) {
+               $phpfspot->get_calendar_matrix($_GET['date']);
             }
             break;