user = $aniga->user(); $aniga_id = get_option('aniga_base-id'); $msg = ""; $msg .= $aniga->checkpath(); ?>
| x px | insert |
".$_FILES['org']['name']." is not a picture file!
"; } if ($changecat == 'yes') { if ($cat_ID == '0') { $msg .= "" . __('You MUST select a Category, if you want to move this Album...', 'aniga') . "
"; $post_data = compact('post_content','post_title', 'ID', 'comment_status'); } else { $update_albcat = mysql_query("UPDATE `$wpdb->aniga_rel` SET `parent_id` = '$parent_id' WHERE `id` = '$ID' LIMIT 1"); $post_parent = $parent_id; $post_data = compact('post_content', 'post_title', 'post_name', 'ID', 'post_parent', 'comment_status'); //anigal_calc_gallery(); $msg .= "" . __('Album successfully moved...', 'aniga') . "
"; } } else { $post_data = compact('post_content','post_title', 'post_name', 'ID', 'comment_status'); } $post_data = add_magic_quotes($post_data); $post_ID = wp_update_post($post_data); $get_new_cat = $aniga->getupdatedpost($ID); $update_alb = mysql_query("UPDATE `$wpdb->aniga_alb` SET `name` = '$get_new_cat->post_title', `desc` = '$get_new_cat->post_content', `level` = '$level', `order` = '$order' WHERE id = '$ID'"); $msg .= "" . __('Album edited:', 'aniga') . " '$get_new_cat->post_title'
"; anigal_mng_gallery($msg); } elseif ($_GET['event'] == 'album') { // call anigal_mng_pictures($msg, $alb_id) from $_GET $ID = (int) $_GET['wpid']; anigal_mng_pictures($msg, $ID); } elseif ($_GET['event'] == 'mng_album') { // call anigal_mng_pictures($msg, $alb_id) from $_POST if ($_POST['albid'] != 0) $ID = $_POST['albid']; else $ID = $_POST['wpid']; anigal_mng_pictures($msg, $ID); } elseif ($_GET['event'] == 'edited_pic') { // write changes for picture in db $new_id = (int) $_POST['albid']; $old_id = (int) $_POST['wpid']; if ($_POST['multiple_edit']) { if ( !empty( $_POST['edit_img'] ) ) : $i = 0; foreach ($_POST['edit_img'] as $pid) : $pid = (int) $pid; $filename = $_POST['filename'.$pid]; $hits = $_POST['hits'.$pid]; $caption = $_POST['caption'.$pid]; $caption = htmlentities($caption, ENT_QUOTES, 'UTF-8'); if ($new_id != $old_id) { $new_alb = $aniga->getalbum($new_id); $move_pic = mysql_query("UPDATE $wpdb->aniga_pic SET `parent_id` = '$new_alb->id' WHERE pid = $pid"); $move_com_req = "SELECT * FROM $wpdb->comments WHERE comment_pid_ID = '$pid'"; $move_com_ret = $wpdb->get_results($move_com_req); if ($move_com_ret) { $count = $wpdb->num_rows; $update_com = mysql_query("UPDATE $wpdb->comments SET comment_post_ID = '$new_id' WHERE comment_pid_ID = $pid"); $new_post = $aniga->getupdatedpost($new_id); $old_post = $aniga->getupdatedpost($old_id); $comment_count_new = $new_post->comment_count + $count; $comment_count_old = $old_post->comment_count - $count; $update_post_new = mysql_query("UPDATE $wpdb->posts SET comment_count = '$comment_count_new' WHERE ID = $new_id"); $update_post_old = mysql_query("UPDATE $wpdb->posts SET comment_count = '$comment_count_old' WHERE ID = $old_id"); } $msg .= "" . sprintf(__('Picture \'%1$s\' moved to Album \'%2$s\'.', 'aniga'), $filename, $new_alb->name) . "
"; } $update_pic = mysql_query("UPDATE $wpdb->aniga_pic SET hits = '$hits', caption = '$caption' WHERE pid = $pid"); $msg .= "" . sprintf(__('Picture \'%s\' updated.', 'aniga'), $filename) . "
"; $i++; endforeach; //anigal_calc_gallery(); endif; } elseif ($_POST['multiple_level']) { if ( !empty( $_POST['edit_img'] ) ) : $i = 0; foreach ($_POST['edit_img'] as $pid) : $pid = (int) $pid; $level = $_POST['mlevel']; $update_pic = mysql_query("UPDATE $wpdb->aniga_pic SET level = '$level' WHERE pid = $pid"); $i++; endforeach; $msg .= "" . sprintf(__('level for %s pictures updated', 'aniga'), $i) . "
"; endif; } elseif ($_POST['multiple_delete']) { if ( !empty( $_POST['edit_img'] ) ) : $i = 0; foreach ($_POST['edit_img'] as $pid) : $pid = (int) $pid; $ID = $_POST['wpid']; $del_com_req = "SELECT * FROM $wpdb->comments WHERE comment_pid_ID = $pid"; $del_com_ret = $wpdb->get_results($del_com_req); if ($del_com_ret) { foreach ($del_com_ret as $del_com) { wp_delete_comment($del_com->comment_ID); } } if (get_option('aniga_delete') == 'yes') { $picture = $aniga->getpic($pid); $abspath = str_replace(get_option('aniga_dirpath'), get_option('aniga_abspath'), $picture->path); if (is_file($abspath.$picture->filename)) unlink($abspath.$picture->filename); if (is_file($abspath.'thumb_'.$picture->filename)) unlink($abspath.'thumb_'.$picture->filename); if (is_file($abspath.'normal_'.$picture->filename)) unlink($abspath.'normal_'.$picture->filename); if (substr($abspath, -10, 10) != '00-single/') @rmdir(substr($abspath, 0, -1)); } $del_pic = mysql_query("DELETE FROM $wpdb->aniga_pic WHERE pid = $pid LIMIT 1"); $i++; endforeach; //anigal_calc_gallery(); $msg .= "". sprintf(__('%s pictures deleted!', 'aniga'), $i) . "
"; endif; } else { // only one picture updated. foreach($_POST as $varname => $value) { if (substr($varname, 0, 3) == 'pid'): $pid = substr($varname, 3); $filename = $_POST['filename'.$pid]; $hits = $_POST['hits'.$pid]; $caption = $_POST['caption'.$pid]; $caption = htmlentities($caption, ENT_QUOTES, 'UTF-8'); $level = $_POST['level'.$pid]; $update_pic = mysql_query("UPDATE $wpdb->aniga_pic SET hits = '$hits', caption = '$caption', level = '$level' WHERE pid = $pid"); $msg .= "" . sprintf(__('Picture \'%s\' updated.', 'aniga'), $filename) . "
"; endif; } } $ID = $_POST['wpid']; anigal_mng_pictures($msg, $ID); } elseif ($_GET['event'] == 'delete_alb') { // confirm delete album and pictures from db switch ( (int) $_GET['msg'] ): case 1: $msg = "". __('album with all pictures deleted!', 'aniga') . "
"; break; case 2: $msg = "". __('huh. which album?', 'aniga') . "
"; break; case 3: $msg = "". __('album still has some child pages and was NOT deleted!', 'aniga') . "
"; endswitch; anigal_mng_gallery($msg); } elseif ($_GET['event'] == 'delete_pic') { // delete picture with commens from db switch ( (int) $_GET['msg'] ): case 1: $msg = "". __('picture deleted!', 'aniga') . "
"; break; endswitch; anigal_mng_pictures($msg, $_GET['wpid']); } else { anigal_mng_gallery($msg); } ?> getalbum($alb_id); $aniga->getchildren(get_option('aniga_base-id'), ' ', true); $row_color=""; ?>
getchildren(get_option('aniga_base-id'), ' ', true); $row_color=""; foreach ($aniga->child_array as $i => $val): $count = $aniga->c_alb_pic($i); if ($val['has_child']) $sum_count = $count + $aniga->getchildren_c_pic($i); ?> > nowrap="nowrap"> nowrap="nowrap"> nowrap="nowrap"> nowrap="nowrap"> nowrap="nowrap"> nowrap="nowrap"> " onclick="return confirm(' \n ')" class="delete" >