prefix . "ai_album"; $ai_show_table_photos = $wpdb->prefix . "ai_photos"; if($_REQUEST['action'] == 'Delete') { $ai_photo_get_image=$wpdb->get_results("SELECT photo_filename from $ai_show_table_photos WHERE photo_id = '".$_REQUEST['photoid']."' and photo_album_id = '".$_REQUEST['albumid']."'",ARRAY_A); if(file_exists(AI_PHOTO_DIR_PATH.'/'.$ai_photo_get_image[0]['photo_filename'])){ @unlink(AI_PHOTO_DIR_PATH.'/'.$ai_photo_get_image[0]['photo_filename']); } $ai_photo_thumb_name= explode('.',$ai_photo_get_image[0]['photo_filename']); $ai_thumb_photo_name=$ai_photo_thumb_name[0].'-thumb'.'.'.$ai_photo_thumb_name[1]; if(file_exists(AI_PHOTO_THUMB_DIR_PATH.'/'.$ai_thumb_photo_name)){ @unlink(AI_PHOTO_THUMB_DIR_PATH.'/'. $ai_thumb_photo_name); } $wpdb->query($wpdb->prepare("DELETE FROM $ai_show_table_photos WHERE photo_id = %d",$_REQUEST['photoid'])); $location=admin_url().'admin.php?page=ai_listing_photos&photo_delete_success=1&album_id='.$_REQUEST['albumid']; echo' '; } if($_REQUEST['action'] == 'Disable') { $wpdb->query($wpdb->prepare("UPDATE $ai_show_table_photos SET photo_visible=0 WHERE photo_id = %d",$_REQUEST['photoid'])); $location=admin_url().'admin.php?page=ai_listing_photos&photo_disable_success=1&album_id='.$_REQUEST['albumid']; echo' '; } if($_REQUEST['action'] == 'Enable') { $wpdb->query($wpdb->prepare("UPDATE $ai_show_table_photos SET photo_visible=1 WHERE photo_id =%d",$_REQUEST['photoid'])); $location= admin_url().'admin.php?page=ai_listing_photos&photo_enable_success=1&album_id='.$_REQUEST['albumid']; echo' '; } if($_REQUEST['Action'] == 'EnableDisableSelected') { $edittable=$_POST['selector']; $params = join(',', $edittable); $wpdb->query($wpdb->prepare("UPDATE $ai_show_table_photos SET photo_visible='".$_POST['visible']."' WHERE photo_id IN ($params)",ARRAY_N)); if($_POST['visible'] == '1') { $location= admin_url().'admin.php?page=ai_listing_photos&photo_enable_success=1&album_id='.$_REQUEST['albumid']; echo' '; } if($_POST['visible'] == '0') { $location= admin_url().'admin.php?page=ai_listing_photos&photo_disable_success=1&album_id='.$_REQUEST['albumid']; echo' '; } } if ($_REQUEST['Action'] == 'DeleteSelected') { $edittable=$_POST['selector']; $params = join(',', $edittable); //unlink photo image from uploaded path $ai_photo_get_image=$wpdb->get_results("SELECT photo_filename from $ai_show_table_photos WHERE photo_id IN ($params)",ARRAY_A); foreach($ai_photo_get_image as $photo_key => $photo_val) { if(file_exists(AI_PHOTO_DIR_PATH.'/'.$photo_val['photo_filename'])){ @unlink(AI_PHOTO_DIR_PATH.'/'.$photo_val['photo_filename']); } $ai_photo_thumb_name= explode('.',$photo_val['photo_filename']); $ai_thumb_photo_name=$ai_photo_thumb_name[0].'-thumb'.'.'.$ai_photo_thumb_name[1]; if(file_exists(AI_PHOTO_THUMB_DIR_PATH.'/'.$ai_thumb_photo_name)){ @unlink(AI_PHOTO_THUMB_DIR_PATH.'/'. $ai_thumb_photo_name); } } $wpdb->query($wpdb->prepare("DELETE FROM $ai_show_table_photos WHERE photo_id IN ($params)",ARRAY_N)); $location=admin_url().'admin.php?page=ai_listing_photos&photo_delete_success=1&album_id='.$_REQUEST['albumid']; echo' '; } $res=$wpdb->get_results("select * from $ai_show_table_photos where photo_album_id='".$_REQUEST['album_id']."' ORDER BY photo_order ASC "); $ai_album_name=$wpdb->get_results("select album_title from $ai_show_table_album where album_id='".$_REQUEST['album_id']."'",ARRAY_A); ?>

+ Add New Photos « Back To Albums


Photo Inserted Successfully.
"; } if(isset($_GET['photo_update_success']) && $_GET['photo_update_success']==1) { echo "
Selected Photo Update Successfully.
"; } if(isset($_GET['photo_delete_success']) && $_GET['photo_delete_success']==1) { echo "
Selected Photo Delete Successfully.
"; } if(isset($_GET['photo_disable_success']) && $_GET['photo_disable_success']==1) { echo "
Selected Photo Disable Successfully.
"; } if(isset($_GET['photo_enable_success']) && $_GET['photo_enable_success']==1) { echo "
Selected Photo Enable Successfully.
"; } ?>
0) { foreach($res as $key => $val) { if(!empty($val->photo_filename)) { $ai_file_thumb=AI_PHOTO_THUMB_URL_PATH.'/'; $ai_photo_name= explode('.',$val->photo_filename); $ai_thumb_photo_name=$ai_photo_name[0].'-thumb'.'.'.$ai_photo_name[1]; } else { $ai_file_thumb = AI_URL_PATH.'/images/'; $ai_thumb_photo_name= 'no_photo.jpg'; } $color='style="background-color:#CCCCCC;"'; ?> photo_visible == 0){echo $color;}?> id="recordsArray_photo_id ;?>" class="ui-state-default">
+ Add New Photos    « Back To Albums
   Photo Title Photo Photo Date Photo Slug Action
photo_id; ?>> photo_title; ?> No Image photo_date; ?> photo_slug; ?> )'>Edit )'>Delete photo_visible == 1) { ?> )'>Disable )'>Enable
   Photo Title Photo Photo Date Photo Slug Action
Check All / Uncheck All