Example #1
0
 $photos = new Photos();
 if (strpos($_POST['user_photo_id'], 'title') === 0) {
     $update['photo_id'] = str_replace('title-', '', $_POST['user_photo_id']);
     $update['photo_title'] = $_POST['title'];
     //echo 'editing TITLE: ';
     echo $photos->updatePhotoTitle($update);
 } elseif (strpos($_POST['user_photo_id'], 'desc') === 0) {
     $update['photo_id'] = str_replace('desc-', '', $_POST['user_photo_id']);
     $update['photo_title'] = $_POST['title'];
     //echo 'editing description: ';
     echo $photos->updatePhotoDesc($update);
 } elseif (strpos($_POST['user_photo_id'], 'caption') === 0) {
     $update['photo_id'] = str_replace('caption-', '', $_POST['user_photo_id']);
     $update['photo_title'] = $_POST['title'];
     //echo 'editing description: ';
     echo $photos->updatePhotoCaption($update);
 } elseif (strpos($_POST['user_photo_id'], 'paypal_url') === 0) {
     $update['photo_id'] = str_replace('paypal_url-', '', $_POST['user_photo_id']);
     $update['photo_title'] = $_POST['title'];
     //echo 'editing caption: ';
     echo $photos->updatePhotoPaypal($update);
 } elseif (strpos($_POST['user_photo_id'], 'event_date') === 0) {
     $update['photo_id'] = str_replace('event_date-', '', $_POST['user_photo_id']);
     $update['photo_title'] = $_POST['title'];
     //echo 'editing caption: ';
     echo $photos->updatePhotoDate($update);
 } elseif (strpos($_POST['user_photo_id'], 'type') === 0) {
     $update['photo_id'] = str_replace('type-', '', $_POST['user_photo_id']);
     $update['photo_title'] = $_POST['title'];
     //echo 'editing type: ';
     echo $photos->updatePhotoType($update);