user = $aniga->user(); $msg = ""; $msg .= $aniga->checkpath(); if ($_POST['event'] == 'album') { $parent_id = $_POST['cat']; $order = (int) $_POST['order']; if ($parent_id == 0) $msg .= __('You MUST select a parent Album!', 'aniga'); else { $post_author = 1; $post_content = $_POST['longtitel']; $post_title = $_POST['titel']; $post_date = gmdate('Y-m-d H:i:s'); $post_date_gmt = gmdate('Y-m-d H:i:s'); $post_category = 1; $post_status = 'publish'; $comment_status = $_POST['commentstat']; $ping_status = 'open'; $post_parent = $parent_id; $post_type = 'page'; $page_template = 'gallery-picture.php'; $post_data = compact('post_content','post_title','post_date','post_date_gmt','post_author','post_category', 'post_status', 'comment_status', 'ping_status', 'post_status', 'post_parent', 'post_type', 'page_template'); $post_data = add_magic_quotes($post_data); $post_ID = wp_insert_post($post_data); $level = $_POST['level']; $get_new_alb = $aniga->getupdatedpost($post_ID); $insert_new_alb = mysql_query("INSERT INTO $wpdb->aniga_alb (`id`, `name`, `desc`, `level`, `count`, `order`) VALUES ('$post_ID', '$get_new_alb->post_title', '$get_new_alb->post_content', '$level', '0', '$order')"); $insert_new_rel = mysql_query("INSERT INTO $wpdb->aniga_rel (`id`, `parent_id`) VALUES ('$post_ID', '$parent_id')"); $path = get_option('aniga_abspath').'00-gfx/'; $name = 'album_'.$post_ID.'.jpg'; copy(ABSPATH . 'wp-content/plugins/ANIga/noimage.jpg', $path.$name); $t_size = get_option('aniga_caimg_size'); $c_size = get_option('aniga_thumb_csize'); if (get_option('aniga_thumb_square') == 'yes') $crop = true; else $crop = false; if (okfiletype($_FILES['org']['name'], $aniga->allowed_pic)) { $msg .= $aniga_file->handle($_FILES['org']['tmp_name'], $name, $path, $t_size, $c_size, true, false, true, $crop); } else $msg .= "
".$_FILES['org']['name']." ". __('is not a picture file!', 'aniga')."
"; //anigal_calc_gallery(); $msg .= "" . __('Album created:', 'aniga') . " '" . $get_new_alb->post_title . "'
"; } } $aniga_id = get_option('aniga_base-id'); $aniga_title = $wpdb->get_row("SELECT post_title FROM $wpdb->posts WHERE ID=$aniga_id"); ?>