"; print_r($_POST); echo "";
switch($_REQUEST['action_photos']){
case 'Delete' : {
$albidis = $_GET["albid"];
if(intval(in_array($_POST['featuredimgname'] , $_POST['checkList']))){ // upload featured img name if u delete it
$wpdb->query("UPDATE " . $wpdb->prefix . "asgallalbum SET macFeaturedImage = 0 WHERE asgallAlbum_id='$albidis'");
}
if(intval(in_array($_POST['albumimgname'] , $_POST['checkList']) ) ){ // upload album img name if u delete it
$wpdb->query("UPDATE " . $wpdb->prefix . "asgallalbum SET asgallAlbum_image = 0 WHERE asgallAlbum_id='$albidis'");
}
for ($k = 0; $k < count($_POST['checkList']); $k++) {
$asgallPhoto_id = $_POST['checkList'][$k];
$wpdb->query("UPDATE " . $wpdb->prefix . "asgallphotos SET is_delete = 1 WHERE asgallPhoto_id='$asgallPhoto_id'");
}
$total1 = $wpdb->get_results("SELECT asgallPhoto_id FROM " . $wpdb->prefix . "asgallphotos WHERE asgallAlbum_id = $albidis AND is_delete = 0 ",ARRAY_A);
$stop = count($total1 );
for($i = 0 ; $i< $stop ; $i++ )
{
$id = $total1[$i]['asgallPhoto_id'];
$sql = "UPDATE " . $wpdb->prefix . "asgallphotos SET asgallPhoto_sorting = $i WHERE asgallPhoto_id = $id" ;
$wpdb->query($sql);
}
$msg = 'Photos Deleted Successfully';
}break;
case 'Featured' : {
$val = $_POST['subaction_photos'];
$table = $wpdb->prefix . "asgallphotos";
$data = array('asgallFeaturedCover' => $val );
for ($k = 0; $k < count($_POST['checkList']); $k++) {
$where = array( 'asgallPhoto_id' => $_POST['checkList'][$k]);
$wpdb->update( $table, $data, $where, $format = null, $where_format = null );
}
$msg = 'Updated Successfully';
}break;
case 'Status' : {
$val = $_POST['subaction_photos'];
if($val){
$val = 'ON';
}
else
$val = 'OFF';
$table = $wpdb->prefix . "asgallphotos";
$data = array('asgallPhoto_status' => $val );
for ($k = 0; $k < count($_POST['checkList']); $k++) {
$where = array( 'asgallPhoto_id' => $_POST['checkList'][$k]);
$wpdb->update( $table, $data, $where, $format = null, $where_format = null );
}
$msg = 'Updated Successfully';
}break;
} //switch end hear
}
function listPagesNoTitle($args) { //Pagination
if ($args) {
$args .= '&echo=0';
} else {
$args = 'echo=0';
}
$pages = wp_list_pages($args);
echo $pages;
}
function findStart($limit) { //Pagination
if (!(isset($_REQUEST['pages'])) || ($_REQUEST['pages'] == "1")) {
$start = 0;
$_GET['pages'] = 1;
} else {
$start = ($_GET['pages'] - 1) * $limit;
}
return $start;
}
/*
* int findPages (int count, int limit)
* Returns the number of pages needed based on a count and a limit
*/
function findPages($count, $limit) { //Pagination
$pages = (($count % $limit) == 0) ? $count / $limit : floor($count / $limit) + 1;
if ($pages == 1) {
$pages = '';
}
return $pages;
}
/*
* string pageList (int curpage, int pages)
* Returns a list of pages in the format of "« < [pages] > »"
* */
function pageList($curpage, $pages, $albid) {
//Pagination
$page_list = "";
if ($search != '') {
$self = '?page=' . slidePhotos . '&action=viewPhotos' . '&albid=' . $albid;
} else {
$self = '?page=' . slidePhotos . '&action=viewPhotos' . '&albid=' . $albid;
}
/* Print the first and previous page links if necessary */
if (($curpage != 1) && ($curpage)) {
$page_list .= " << ";
}
if (($curpage - 1) > 0) {
$page_list .= "< ";
}
/* Print the numeric page list; make the current page unlinked and bold */
for ($i = 1; $i <= $pages; $i++) {
if ($i == $curpage) {
$page_list .= "" . $i . "";
} else {
$page_list .= "" . $i . "";
}
$page_list .= " ";
}
/* Print the Next and Last page links if necessary */
if (($curpage + 1) <= $pages) {
$page_list .= "> ";
}
if (($curpage != $pages) && ($pages != 0)) {
$page_list .= ">> ";
}
$page_list .= "\n";
return $page_list;
}
/*
* string nextPrev (int curpage, int pages)
* Returns "Previous | Next" string for individual pagination (it's a word!)
*/
function nextPrev($curpage, $pages) { //Pagination
$next_prev = "";
if (($curpage - 1) <= 0) {
$next_prev .= "Previous";
} else {
$next_prev .= "Previous";
}
$next_prev .= " | ";
if (($curpage + 1) > $pages) {
$next_prev .= "Next";
} else {
$next_prev .= "Next";
}
return $next_prev;
}
?>
asgallAlbum_image;
$path = $uploadDir['baseurl'].'/apptha-slider-gallery';
$site_url = get_bloginfo('url');
if($_REQUEST['albid'] != '' && $_REQUEST['albid']!='0')
{
$albid = $_REQUEST['albid'];
$asgallAlbum = $wpdb->get_row("SELECT * ,asgallGallery_name FROM " . $wpdb->prefix . "asgallalbum," . $wpdb->prefix . "asgallgallery where ". $wpdb->prefix . "asgallgallery.". asgallGallery_id."=". $wpdb->prefix . "asgallalbum." . asgallGallery_id . " and asgallAlbum_id='$albid' and is_delete=0 ORDER BY asgallAlbum_id DESC");
$asgallPhtcount = $wpdb->get_row("SELECT count(*) as total, asgallPhoto_image FROM " . $wpdb->prefix . "asgallphotos WHERE asgallAlbum_id='$albid' and `is_delete` =0 and asgallPhoto_status = 'ON'"); // Getting album name
$picaAlbumList = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "asgallalbum WHERE is_delete=0");
$pageURL = (@$_SERVER["HTTPS"] == "on") ? "https://" : "http://";
if ($_SERVER["SERVER_PORT"] != "80")
{
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
}
else
{
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
$copyofurl = $pageURL;
$pageURL = explode('albid',$pageURL);
?>
asgallAlbum_image){
$albumImgName = $asgallAlbum->asgallAlbum_image;
$albumImgName = explode('_',$albumImgName );
$albumImgName = $albumImgName[0];
}
else{ // if album photo is not set then defalut we give first photo to album
$aid = $_GET['albid'];
$sql = "SELECT asgallPhoto_id , asgallPhoto_image FROM ". $wpdb->prefix ."asgallphotos where asgallAlbum_id = $aid AND is_delete = 0 GROUP BY asgallAlbum_id ";
$newRes = $wpdb->get_results($sql,ARRAY_A);
$idis = $newRes[0]['asgallPhoto_id'];
$listItem = array();
$tab = $wpdb->prefix ."asgallphotos" ;
$imgname = $newRes[0]['asgallPhoto_image'];
if($imgname){
$sql2 = " UPDATE ". $wpdb->prefix ."asgallalbum SET asgallAlbum_image = '$imgname' WHERE asgallAlbum_id = $aid" ;
$wpdb->query("UPDATE $tab SET asgallAlbum_cover = 'ON' WHERE `asgallPhoto_id` = $idis");
$wpdb->query($sql2);
?>
Album Name :
asgallAlbum_name; ?>
asgallAlbum_image)
{
$get_image = explode('_',$asgallAlbum->asgallAlbum_image);
$extension = explode('.',$get_image[1]);
$phototumb = $get_image[0].'_albumthumb.'.$extension[1];
$file_image = $path . '/' . $phototumb;
}
else
{
$file_image = $site_url . '/wp-content/plugins/apptha-slider-gallery/images/nocover.jpg';
}
?>
$limit )
{ ?>
See
All
No albums is selected. Please Go to
back and select the respective album to view images
Select The Album To Upload Photos
Upload multiple image files(jpg, jpeg, png, gif)
Upto 20 files can upload on single click