Karl Rixon aka the php Oracle for the pagination function, the tricks and teaching me php. Gallery options in the Pages menu. Version: 2.2 Author: Thomas Michalak aka TM Author URI: http://www.fuck-dance-lets-art.com */ /* Copyright 2008/2010 Thomas Michalak (email : http://www.fuck-dance-lets-art.com/contact-me ) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ require_once('all_in_one_gallery_functions.php'); /*************************************************************/ /* THE OPTION PANNEL THE OPTION PANNEL THE OPTION PANNEL */ /*************************************************************/ add_option(allInOneGallery_select_page, ''); add_option(allInOneGallery_css_theme, 'Blue'); add_option(allInOneGallery_how_many_columms, '4'); add_option(allInOneGallery_thumb_size, 'default'); add_option(allInOneGallery_ecluded_cat, ''); add_option(allInOneGallery_exclude_empty_cat_switch, "Off"); add_option(allInOneGallery_img_exclude, ''); add_option(allInOneGallery_message_switch, 'On'); add_option(allInOneGallery_welcome_message, 'All images that have been posted on '.get_bloginfo('name').' website are accessible here. Browse through the categories and view all images that are related to each category. Click on a thumbnail to see the full size. You can also read the related post by clicking on view this post'); add_option(allInOneGallery_welcome_category, ''); add_option(allInOneGallery_thumb_link_switch, 'Off'); add_option(allInOneGallery_pagination_switch, 'Off'); add_option(allInOneGallery_post_per_page, '2'); function all_in_one_gallery_menu() { add_pages_page('All in One Gallery Options', 'All in One Gallery', 2, __FILE__, 'all_in_one_gallery_options'); } function all_in_one_gallery_style_and_magic(){ //A bit of style echo ''; //A Bit of magic echo ''; } add_thickbox(); add_action('admin_head', 'all_in_one_gallery_style_and_magic'); /* function my_action_callback() { $test = ''; $catID = $_POST['catID']; $allMyPosts = get_posts('numberposts=-1&post_type=any&category='.$catID); //Get all images $onlyPostsImages = array(); foreach($allMyPosts as $key => $post){ $postID = $post->ID; $post_attch = get_children('post_type=attachment&post_mime_type=image&post_parent='.$postID); if($post_attch !== FALSE){ $thumbs = ''; foreach($post_attch as $attachment => $attachment_object){ $OriginalID = $attachment_object->ID; $imagearray = wp_get_attachment_image_src($OriginalID, 'thumbnail', false); $imageURI = $imagearray[0]; $imageID = get_post($OriginalID); $imageTitle = $imageID->post_title; $imageCaption = $imageID->post_excerpt; $imageDescription = $imageID->post_content; //Output list of thumbs $thumbs .= '
'.get_option('allInOneGallery_welcome_message').'
'; $content .= 'there is no images in this category
'; }else{ //don't say anything } } } //Display Pages else{ $mypages = get_posts('numberposts=-1&post_type=page'); foreach($mypages as $page){ //Info about the post $pageID = $page->ID; $page_attachments = get_children('post_type=attachment&post_mime_type=image&post_parent='.$pageID); if(empty($page_attachments)){ $all_page_attachements[] = FALSE; }else{ $all_page_attachements[] = TRUE; //The post //$content .= $postID.' '; $aPage = get_post($page); $content .= '