Plugin Directory

Changeset 1105456


Ignore:
Timestamp:
03/04/2015 09:48:39 PM (11 years ago)
Author:
3dolab
Message:

adding 1.91

Location:
combo-slideshow
Files:
117 added
9 edited

Legend:

Unmodified
Added
Removed
  • combo-slideshow/trunk/CHANGELOG

    r1031090 r1105456  
    11Combo Slideshow Changelog
     2
     3= 1.91 (2015.03.05) =
     4* Added Auto slider post type general option
     5* Auto slider category replaced with taxonomies and terms multiselect
     6* Options table cleaning and update on plugin activation, uninstall and updates
    27
    38= 1.9 (2014.11.22) =
  • combo-slideshow/trunk/combo-slideshow-plugin.php

    r1031090 r1105456  
    11<?php
    22class CMBSLD_GalleryPlugin {
    3     var $version = '1.9';
     3    var $version = '1.91';
    44    var $plugin_name;
    55    var $plugin_base;
     
    7777    }
    7878   
    79     function initialize_options() {
     79    function initialize_options() {
     80   
     81        $general = $this -> get_option('general');
     82        if(!isset($general['version'])||$general['version']<$this->version)
     83            $this -> auto_update_options();
     84           
     85    }
     86   
     87    function auto_update_options() {
    8088   
    8189        $general = array(
     
    8694            'wpns_auto'     => 'N',
    8795            'wpns_auto_position'    => 'B',
    88             'wpns_category' => array('1'),
     96            //'wpns_category'   => array('1'),
     97            'wpns_taxonomies' => array('category'),
     98            'wpns_terms'    => array('1'),
     99            'wpns_post_types' => array('post'),
    89100            'slide_gallery' => '',
    90101            'exclude'       => '',
     
    112123            $this -> delete_option('wpns_effect');
    113124        }
     125        /*
    114126        if($this -> get_option('wpns_category')) {
    115127            $general['wpns_category'] = $this -> get_option('wpns_category');
     128            $this -> delete_option('wpns_category');
     129        }
     130        */
     131        if($this -> get_option('wpns_category')) {
     132            $general['wpns_taxonomies'][] = 'category';
     133            $general['wpns_terms'] = $this -> get_option('wpns_category');
    116134            $this -> delete_option('wpns_category');
    117135        }
     
    312330        }
    313331       
    314         $this -> add_option('general', $general);
    315         $this -> add_option('slides', $slides);
    316         $this -> add_option('styles', $styles);
    317         $this -> add_option('slidestyles', $slidestyles);
    318         $this -> add_option('links', $links);
     332        $tabs = array(
     333                'general' => $general,
     334                'slides' => $slides,
     335                'slidestyles' => $slidestyles,
     336                'styles' => $styles,
     337                'links' => $links );
     338        foreach($tabs as $name => $tab)
     339            $this -> add_option($name, $tab);
     340           
     341        //$general = $this -> get_option('general');
     342        $general = wp_parse_args($this -> get_option('general'), $tabs['general']);
     343        if(isset($general['wpns_category'])&&!empty($general['wpns_category'])){
     344            if(!isset($general['wpns_taxonomies'])||empty($general['wpns_taxonomies']))
     345                $general['wpns_taxonomies'] = array('category');
     346            if(!isset($general['wpns_terms'])||empty($general['wpns_terms']))
     347                $general['wpns_terms'] = array('1');
     348            unset($general['wpns_category']);           
     349        }elseif(isset($general['wpns_category'])&&empty($general['wpns_category'])){
     350            unset($general['wpns_category']);
     351        }
     352        if(!isset($general['wpns_taxonomies'])||empty($general['wpns_taxonomies'])){
     353            $general['wpns_taxonomies'] = array('category');
     354        }
     355        if( !isset($general['wpns_terms'])||empty($general['wpns_terms']) ){
     356            if(in_array('category',$general['wpns_taxonomies']))
     357                $general['wpns_terms'] = array('1');
     358        }
     359        $this -> update_option('general', $general);
    319360    }
    320361   
     
    433474            if (!empty($_GET['page']) && in_array($_GET['page'], (array) $this -> sections)) {
    434475                wp_enqueue_script('autosave');
    435            
     476                /*
    436477                if ($_GET['page'] == 'slideshow') {
    437478                    wp_enqueue_script('common');
     
    440481                   
    441482                    wp_enqueue_script('settings-editor', '/' . CMBSLD_PLUGIN_URL . 'js/settings-editor.js', array('jquery'), '1.0');
    442                 }
    443                
     483                }               
    444484                if ($_GET['page'] == "slideshow-slides" && $_GET['method'] == "order") {
    445485                    wp_enqueue_script('jquery-ui-sortable');
     
    448488               
    449489                add_thickbox();
     490                */
    450491            }
    451492           
    452             wp_enqueue_script($this -> plugin_name . 'admin', CMBSLD_PLUGIN_URL . 'js/admin.js', 'jquery', '1.0');
     493            //wp_enqueue_script($this -> plugin_name . 'admin', CMBSLD_PLUGIN_URL . 'js/admin.js', 'jquery', $this->version);
    453494
    454495        } else {
     
    458499            if($js_framework == 'mootools') {
    459500
    460             wp_register_script('moocore', '/' . CMBSLD_PLUGIN_URL . 'js/mootools-core-1.3.2-full-nocompat-yc.js', false, '1.3');
    461             wp_register_script('moomore', '/' . CMBSLD_PLUGIN_URL . 'js/mootools-more-1.3.2.1-yc.js', false, '1.3');
     501            wp_register_script('moocore', '/' . CMBSLD_PLUGIN_URL . 'js/moo/mootools-core-1.3.2-full-nocompat-yc.js', false, '1.3');
     502            wp_register_script('moomore', '/' . CMBSLD_PLUGIN_URL . 'js/moo/mootools-more-1.3.2.1-yc.js', false, '1.3');
    462503            wp_enqueue_script('moocore');
    463504            wp_enqueue_script('moomore');
    464             wp_enqueue_script('moo_loop', '/' . CMBSLD_PLUGIN_URL . 'js/Loop.js', array('moocore','moomore'), '1.3');
    465             wp_enqueue_script('moo_slideshow', '/' . CMBSLD_PLUGIN_URL . 'js/SlideShow.js', array('moocore','moomore','moo_loop'), '1.3');
     505            wp_enqueue_script('moo_loop', '/' . CMBSLD_PLUGIN_URL . 'js/moo/Loop.js', array('moocore','moomore'), '1.3');
     506            wp_enqueue_script('moo_slideshow', '/' . CMBSLD_PLUGIN_URL . 'js/moo/SlideShow.js', array('moocore','moomore','moo_loop'), '1.3');
    466507            if($general['csstransform'] == 'Y') {
    467                   wp_enqueue_script('cssanimation', $this -> plugin_name, '/' . CMBSLD_PLUGIN_URL . 'js/CSSAnimation.js', false, '1.3');
    468                   wp_enqueue_script('moo_cssanimation', $this -> plugin_name, '/' . CMBSLD_PLUGIN_URL . 'js/CSSAnimation.MooTools.js', array('moocore','moomore','cssanimation'), '1.3');
    469                   wp_enqueue_script('slideshow_css', $this -> plugin_name, '/' . CMBSLD_PLUGIN_URL . 'js/SlideShow.CSS.js', array('moocore','moomore','moo_slideshow','moo_cssanimation'), '1.3');
     508                  wp_enqueue_script('cssanimation', $this -> plugin_name, '/' . CMBSLD_PLUGIN_URL . 'js/moo/CSSAnimation.js', false, '1.3');
     509                  wp_enqueue_script('moo_cssanimation', $this -> plugin_name, '/' . CMBSLD_PLUGIN_URL . 'js/moo/CSSAnimation.MooTools.js', array('moocore','moomore','cssanimation'), '1.3');
     510                  wp_enqueue_script('slideshow_css', $this -> plugin_name, '/' . CMBSLD_PLUGIN_URL . 'js/moo/SlideShow.CSS.js', array('moocore','moomore','moo_slideshow','moo_cssanimation'), '1.3');
    470511            }
    471512
     
    474515            wp_enqueue_script('jquery');
    475516
    476             wp_enqueue_script($this -> plugin_name, CMBSLD_PLUGIN_URL . 'js/jquery.nivo.slider.js', array('jquery'), '2.6' );
     517            wp_enqueue_script($this -> plugin_name, CMBSLD_PLUGIN_URL . 'js/jquery.nivo.slider.js', array('jquery'), '3.2' );
    477518
    478519            $links = $this -> get_option('links');
     
    513554    function get_option($name = '', $stripslashes = true) {
    514555        if ($option = get_option($this -> pre . $name)) {
    515             if (@unserialize($option) !== false) {
     556            if (!is_array($option) && @unserialize($option) !== false) {
    516557                return unserialize($option);
    517558            }
     
    647688    //remove_post_type_support( 'slideshow', 'editor' );
    648689}
    649 function show_combo_slider($category = null, $n_slices = null, $exclude = null, $offset = null, $size = null, $width = null, $height = null) {
     690function show_combo_slider($terms = null, $postlimit = null, $exclude = null, $offset = null, $size = null, $width = null, $height = null, $taxonomies = null, $post_types = null) {
    650691    global $post;
    651692    $post_switch = $post;
     
    679720   
    680721    $jsframe = $general['jsframe'];
     722    $post_limit = $general['postlimit'];
     723       
    681724    $wpns_effect = $slides['wpns_effect'];
    682     $wpns_slices = $slides['wpns_slices'];
    683725    $fadespeed = $slides['fadespeed'];
    684726    $autospeed = $slides['autospeed'];
     
    700742    $wprfss_tips = $slides['wprfss_tips'];
    701743    $slide_theme = $general['slide_theme'];
    702 
     744    $wpns_slices = $slides['wpns_slices'];
    703745    // $category = get_option('wpns_category');
    704     // $n_slices = get_option('wpns_slices');
    705     if (empty($category))
    706         $category = $general['wpns_category'];
    707     if(!is_array($category))
    708         $category = explode(',',$category);
    709     if (empty($n_slices))
    710         $n_slices = $wpns_slices;
     746   
     747    if (empty($terms)&&isset($general['wpns_terms'])&&!empty($general['wpns_terms']))
     748        $terms = $general['wpns_terms'];
     749    elseif(!empty($terms)&&!is_array($terms)&&empty($taxonomies)){
     750        $terms = explode(',',$terms);
     751        $taxonomies = array('category');
     752    }
     753    if (empty($taxonomies)&&isset($general['wpns_taxonomies'])&&!empty($general['wpns_taxonomies']))
     754        $taxonomies = $general['wpns_taxonomies'];
     755    if (empty($post_types)&&isset($general['wpns_post_types'])&&!empty($general['wpns_taxonomies']))
     756        $post_types = $general['wpns_post_types'];
     757   
     758    if (empty($postlimit))
     759        $postlimit = $post_limit;
    711760    if (empty($exclude))
    712761        $exclude = $general['exclude'];
     
    717766        $size = 'comboslide';
    718767    $exclude = explode(',',$exclude);
    719     //$slides = get_posts( 'category='.$category.'&numberposts='.$n_slices );
    720     //query_posts( 'cat='.$category.'&posts_per_page='.$n_slices );
    721     //$query_args = array( 'cat' => $category, 'posts_per_page' => $n_slices, 'post__not_in' => $exclude, 'offset' => $offset );
    722     $query_args = array( 'category__in' => $category, 'posts_per_page' => $n_slices, 'post__not_in' => $exclude, 'offset' => $offset );
     768   
     769    $query_args = array( 'posts_per_page' => $postlimit, 'post__not_in' => $exclude, 'offset' => $offset );
     770   
     771    if(!empty($post_types))
     772        $query_args['post_type'] = $post_types;
     773
     774    $tax_query = array();
     775    if(!empty($taxonomies))
     776        foreach($taxonomies as $tax){
     777            $query_terms = array();
     778            $tax_terms = get_terms($tax, array('fields'=>'ids'));
     779            if(!empty($tax_terms)&&!is_wp_error($tax_terms))
     780                if(!empty($terms))
     781                    $query_terms = array_intersect($terms, $tax_terms);
     782                else
     783                    $query_terms = $tax_terms;
     784            if(!empty($query_terms))
     785                $tax_query[] = array(
     786                                'taxonomy' => $tax,
     787                                'field'    => 'id',
     788                                'terms'    => $query_terms
     789                            );
     790        }
     791    if(!empty($tax_query)){
     792        $tax_query['relation'] = 'AND';
     793        $query_args['tax_query'] = $tax_query;
     794    }
     795   
    723796    $slides = new WP_Query($query_args);
    724 //print_r($query_args);
    725 //print_r($slides);
     797
    726798    if( $slides->have_posts() ){
    727799        $append = '';
  • combo-slideshow/trunk/combo-slideshow.php

    r1031090 r1105456  
    66Author URI: http://www.3dolab.net
    77Description: The features of the best slideshow javascript effects and WP plugins. Blog posts highlights, image gallery, custom slides!
    8 Version: 1.9
     8Version: 1.91
    99*/
    1010if ( ! defined( 'DS' ) )
    1111    define('DS', DIRECTORY_SEPARATOR);
    1212if ( ! defined( 'CMBSLD_VERSION' ) )
    13     define( 'CMBSLD_VERSION', '1.9' );
     13    define( 'CMBSLD_VERSION', '1.91' );
    1414if ( ! defined( 'CMBSLD_PLUGIN_BASENAME' ) )
    1515    define( 'CMBSLD_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
     
    4949        // $this -> add_action('cmbsld_enqueue_styles');
    5050        $this -> add_action('current_screen');
     51       
     52        register_activation_hook( __FILE__, array( $this, 'auto_update_options' ) );
    5153       
    5254        //WordPress filter hooks
     
    178180                case 'settings' :
    179181                    if (!empty($_POST)) {
    180                         foreach ($_POST as $pkey => $pval) {                   
    181                             $this -> update_option($pkey, $pval);
     182                        foreach ($_POST as $pkey => $pval) {
     183                            if(!in_array($pkey,array('method','save')))
     184                                $this -> update_option($pkey, $pval);
    182185                        }
    183186                       
     
    317320       
    318321        if (!empty($caption)) {
    319             if ($slides('information')=='Y' && $caption == 'off') {
     322            if ($slides['information']=='Y' && $caption == 'off') {
    320323                $temps['information_temp'] = 'N';
    321             } elseif ($slides('information')=='N' && $caption == 'on') {
     324            } elseif ($slides['information']=='N' && $caption == 'on') {
    322325                $temps['information_temp'] = 'Y';
    323326            }
    324327        }
    325328        if (!empty($thumbs)) {
    326             if ($slides('thumbnails')=='Y' && $thumbs == 'off') {
     329            if ($slides['thumbnails']=='Y' && $thumbs == 'off') {
    327330                $temps['thumbnails_temp'] = 'N';
    328             } elseif ($slides('thumbnails')=='N' && $thumbs == 'on') {
     331            } elseif ($slides['thumbnails']=='N' && $thumbs == 'on') {
    329332                $temps['thumbnails_temp'] = 'Y';
    330333            }
    331334        }
    332335        if (!empty($auto)) {
    333             if ($slides('autoslide')=='Y' && $auto == 'off') {
     336            if ($slides['autoslide']=='Y' && $auto == 'off') {
    334337                $temps['autoslide_temp'] = 'N';
    335             } elseif ($slides('autoslide')=='N' && $auto == 'on') {
     338            } elseif ($slides['autoslide']=='N' && $auto == 'on') {
    336339                $temps['autoslide_temp'] = 'Y';
    337340            }
     
    354357    }
    355358   
    356     function get_slide_content($post, $custom, $w, $h, $exclude, $include, $size){
     359    function get_slide_content($post, $custom, $w, $h, $exclude, $include, $size, $limit){
    357360        $post_id_orig = $post -> ID;
    358361        if (!empty($custom)) {
     
    412415        }
    413416*/
    414         $content = $this -> get_slide_content($post, $custom, $w, $h, $exclude, $include, $size);
     417        $content = $this -> get_slide_content($post, $custom, $w, $h, $exclude, $include, $size, $limit);
    415418        if ($output) { echo $content; } else { return $content; }
    416419    }
     
    428431        if (empty($h) && !empty($height))
    429432            $h = $height;   
    430         $content = $this -> get_slide_content($post, $custom, $w, $h, $exclude, $include, $size);
     433        $content = $this -> get_slide_content($post, $custom, $w, $h, $exclude, $include, $size, $limit);
    431434        return $content;
    432435    }
  • combo-slideshow/trunk/js/jquery.nivo.slider.js

    r728039 r1105456  
    9696            if(vars.currentImage.attr('title') != '' && vars.currentImage.attr('title') != undefined){
    9797                var title = vars.currentImage.attr('title');
    98                 if(title.substr(0,1) == '#') title = $(title).html();   
     98                //if(title.substr(0,1) == '#')
     99                    title = $('#'+title).html();   
    99100
    100101                if(nivoCaption.css('display') == 'block'){
  • combo-slideshow/trunk/readme.txt

    r1031130 r1105456  
    22Contributors: 3dolab
    33Donate link: http://www.3dolab.net/en/combo-slideshow
    4 Tags: slideshow, slide show, combo, slideshow gallery, slides, image, gallery, content, highlight, showcase, javascript, jquery, mootools, nivo, nivo slider
     4Tags: slideshow, slide show, combo, slider, slideshow gallery, slides, image, gallery, nivo, nivo slider, content, post_types, highlight, showcase, javascript, jquery, mootools
    55Requires at least: 2.8
    66Tested up to: 4.0.1
    7 Stable tag: 1.9
    8 The features of the best slideshow javascript effects and WP plugins:
    9 blog posts highlights, image galleries, custom slides and more!
    10 
     7Stable tag: 1.91
     8Featuring a slideshow javascript with multiple settings and transition effects:
     9blog highlights, post types & taxonomies, galleries, custom slides and more!
    1110
    1211== Description ==
    1312
    14 Combo Slideshow is a photo and image viewing mash-up plugin that integrates the features of the best available javascript slideshow effects and WordPress plugins.
    15 It works natively in conjunction with the WordPress image upload and gallery system, through the javascript frameworks JQuery or MooTools.
     13Combo Slideshow is a photo and image viewing mash-up plugin that integrates the features of the acclaimed jQuery based javascript slideshow Nivo Slider
     14with multiple settings, transition effects and a compatible fallback to the MooTools framework for older or outdated setups.
     15It works natively in conjunction with the WordPress media library.
    1616
    1717= Enjoy: =
     
    2121* Lightbox, FancyBox, MultiBox and custom class names supported
    2222* Navigation Arrows (jQuery) and Tips (MooTools)
    23 * Auto insertion of latest posts (category-based) slideshow in home or single page/post
     23* Auto insertion of latest posts (taxonomy-based) slideshow in home or single page/post
    2424* Custom slides management
    2525* Page/Post gallery shortcode <code>[slideshow]</code> (with optional <code>post_id</code>, <code>custom</code>, <code>exclude</code>, <code>exclude</code>, and <code>auto</code>  parameters)
    2626* Hardcode into any PHP file of a WordPress theme with <code><?php if (class_exists('CMBSLD_Gallery')) { $CMBSLD_Gallery = new CMBSLD_Gallery(); $CMBSLD_Gallery -> slideshow($output = true, $post_id, $exclude, $include, $custom, $width, $height, $thumbs, $caption, $auto, $nolink, $slug, $limit, $size); } ?></code> and the required <code>$post_id</code> or <code>$custom</code> parameters accordingly specified
    27 * Global post slideshow: auto mode in Homepage and/or Posts + manual function show_combo_slider($category, $postlimit, $exclude, $offset, $n_slices, $size, $width, $height)
     27* Global post slideshow: auto mode in Homepage and/or Posts + manual function show_combo_slider($terms, $postlimit, $exclude, $offset, $n_slices, $size, $width, $height, $taxonomies, $post_types)
    2828
    2929Administration and Settings have been completely renewed!
     
    49496. Put the shortcode `[slideshow post_id="X" exclude="" caption="on/off"]` to embed a slideshow with the images of a post into your posts/pages or use `[slideshow custom=1]` to embed a slideshow with your custom added slides or `<?php if (class_exists('CMBSLD_Gallery')) { $CMBSLD_Gallery = new CMBSLD_Gallery(); $CMBSLD_Gallery -> slideshow($output = true, $post_id = null); }; ?>` into your WordPress theme
    5050
    51 * Please take care when updating, due to the new slide administration system any custom slideshow created with previous versions of the plugin will not work and won't even be shown
     51* Please take care when updating from versions older than 1.7: due to the new slide administration system, any custom slideshow created with previous versions of the plugin will not work and won't even be shown
    5252
    5353== Other Notes ==
     54
     55= Additional Parameter Info =
    5456
    5557= [slideshow] shortcode & $CMBSLD_Gallery -> slideshow() =
     
    6971
    7072= $CMBSLD_Gallery -> show_combo_slider() =
    71 * $category (default = null): loads only posts from the specified category
    72 * $n_slices (default = null): limits the amount of slides loaded in the slideshow, or uses the global post limit setting
     73* $terms (default = null): loads only posts from the specified taxonomy terms
     74* $postlimit (default = null): limits the amount of slides loaded in the slideshow, or uses the global post limit setting
    7375* $exclude (default = null): removes the specified attachment IDs (set in a comma-separated list) from the slideshow
    7476* $offset (default = null): starts the slideshow from the nth post
    7577* $width, $height, $size (default = null): sets dimensions in pixels or as in the Media Settings screen
     78* $taxonomy (default = null)
     79* $post_types (default = null)
    7680* please note that, unlike in shortcodes, only the main settings are in use for the caption, links, thumbs and auto options
    7781
     
    114118
    115119== Changelog ==
     120
     121= 1.91 (2015.03.05) =
     122* Added Auto slider post type general option
     123* Auto slider category replaced with taxonomies and terms multiselect
     124* Options table cleaning and update on plugin activation, updates and uninstall
    116125
    117126= 1.9 (2014.11.22) =
  • combo-slideshow/trunk/views/admin/metaboxes/settings-general.php

    r1031090 r1105456  
    1 <?php $styles = $this -> get_option('styles');
    2     $generaloptions = $this -> get_option('general'); ?>
     1<?php $generaloptions = $this -> get_option('general'); ?>
     2<input type="hidden" name="general[version]" value="1.91" id="version" />
    33<table class="form-table">
    44    <tbody>
    5 
    6 <tr valign="top">
    7         <th scope="row"><?php _e('Javascript Framework', $this -> plugin_name); ?></th>
    8         <td>
    9           <label>
    10     <?php $js_framework = $generaloptions['jsframe']; ?>
    11         <select name="general[jsframe]" id="jsframe">
    12           <option onclick="jQuery('.jquery-powered').show();jQuery('.mootools-powered').hide();" value="jquery" <?php if($js_framework == 'jquery') echo 'selected="selected"'; ?>>jQuery + Nivo Slider</option>
    13           <option onclick="jQuery('.jquery-powered').hide();jQuery('.mootools-powered').show();" value="mootools" <?php if($js_framework == 'mootools') echo 'selected="selected"'; ?> >MooTools + SlideShow</option>
    14         </select>
    15           </label>
    16     </td>
    17     </tr>
     5        <tr valign="top">
     6            <th scope="row"><?php _e('Javascript Framework', $this -> plugin_name); ?></th>
     7            <td>
     8                <?php $js_framework = $generaloptions['jsframe']; ?>
     9                <select name="general[jsframe]" id="jsframe">
     10                  <option onclick="jQuery('.jquery-powered').show();jQuery('.mootools-powered').hide();" value="jquery" <?php if($js_framework == 'jquery') echo 'selected="selected"'; ?>>jQuery + Nivo Slider</option>
     11                  <option onclick="jQuery('.jquery-powered').hide();jQuery('.mootools-powered').show();" value="mootools" <?php if($js_framework == 'mootools') echo 'selected="selected"'; ?> >MooTools + SlideShow</option>
     12                </select>
     13                </td>
     14        </tr>
    1815    </tbody>
    1916</table>
     
    2118   <table class="form-table">
    2219    <tbody>   
    23 <tr valign="top">
    24         <th scope="row"><?php _e('Slideshow Theme', $this -> plugin_name); ?></th>
    25         <td>
    26           <label>
    27     <?php $use_themes = $generaloptions['slide_theme']; ?>
    28         <select name="general[slide_theme]" id="slide_theme">
    29           <option onclick="jQuery('#nivocustomtheme_div').hide();" value="0" <?php if($use_themes == '0') echo 'selected="selected"'; ?> ><?php _e('no theme', $this -> plugin_name); ?></option>
    30           <option onclick="jQuery('#nivocustomtheme_div').hide();" value="default" <?php if($use_themes == 'default') echo 'selected="selected"'; ?> ><?php _e('default', $this -> plugin_name); ?></option>
    31           <option onclick="jQuery('#nivocustomtheme_div').hide();" value="orman" <?php if($use_themes == 'orman') echo 'selected="selected"'; ?> >orman</option>
    32           <option onclick="jQuery('#nivocustomtheme_div').hide();" value="pascal" <?php if($use_themes == 'pascal') echo 'selected="selected"'; ?> >pascal</option>
    33           <option onclick="jQuery('#nivocustomtheme_div').show();" value="custom" <?php if($use_themes == 'custom') echo 'selected="selected"'; ?> ><?php _e('custom CSS', $this -> plugin_name); ?></option>
    34         </select>
    35           </label>
    36     </td>
    37     </tr>
     20        <tr valign="top">
     21            <th scope="row"><?php _e('Slideshow Theme', $this -> plugin_name); ?></th>
     22            <td>
     23                <?php $use_themes = $generaloptions['slide_theme']; ?>
     24                <select name="general[slide_theme]" id="slide_theme">
     25                  <option onclick="jQuery('#nivocustomtheme_div').hide();" value="0" <?php if($use_themes == '0') echo 'selected="selected"'; ?> ><?php _e('no theme', $this -> plugin_name); ?></option>
     26                  <option onclick="jQuery('#nivocustomtheme_div').hide();" value="default" <?php if($use_themes == 'default') echo 'selected="selected"'; ?> ><?php _e('default', $this -> plugin_name); ?></option>
     27                  <option onclick="jQuery('#nivocustomtheme_div').hide();" value="orman" <?php if($use_themes == 'orman') echo 'selected="selected"'; ?> >orman</option>
     28                  <option onclick="jQuery('#nivocustomtheme_div').hide();" value="pascal" <?php if($use_themes == 'pascal') echo 'selected="selected"'; ?> >pascal</option>
     29                  <option onclick="jQuery('#nivocustomtheme_div').show();" value="custom" <?php if($use_themes == 'custom') echo 'selected="selected"'; ?> ><?php _e('custom CSS', $this -> plugin_name); ?></option>
     30                </select>
     31            </td>
     32        </tr>
    3833    </tbody>
    3934</table>
    4035</div>
    4136<div id="nivocustomtheme_div" style="display:<?php echo ($generaloptions['slide_theme'] == "custom") ? 'block' : 'none'; ?>;">
    42    <table class="form-table">
    43     <tbody>
    44     <tr valign="top">
    45         <th scope="row"><?php _e('Custom Theme CSS location', $this -> plugin_name); ?></th>
    46     <td>
    47         <label>
    48         <input type="text" name="general[customtheme]" id="customtheme" size="8" value="<?php echo $generaloptions['customtheme']; ?>" />
    49         </label>
    50     <span class="howto"><?php _e('name of both the current theme sub-folder and the CSS file', $this -> plugin_name); ?><br/><?php _e('e.g. use "custom" for /mytheme/custom/custom.css', $this -> plugin_name); ?></span>
    51     </td>
    52     </tr>
    53     </tbody>
    54 </table>
     37    <table class="form-table">
     38        <tbody>
     39            <tr valign="top">
     40                <th scope="row"><?php _e('Custom Theme CSS location', $this -> plugin_name); ?></th>
     41                <td>
     42                    <input type="text" name="general[customtheme]" id="customtheme" size="8" value="<?php echo $generaloptions['customtheme']; ?>" />
     43                    <span class="howto"><?php _e('name of both the current theme sub-folder and the CSS file', $this -> plugin_name); ?><br/><?php _e('e.g. use "custom" for /mytheme/custom/custom.css', $this -> plugin_name); ?></span>
     44                </td>
     45            </tr>
     46        </tbody>
     47    </table>
    5548</div>
    56    <table class="form-table">
    57     <tbody>
    58         <tr valign="top">
    59         <th scope="row"><?php _e('Auto insert in Home page', $this -> plugin_name); ?></th>
    60         <td>
    61           <label><input <?php echo ($generaloptions['wpns_home'] == "N") ? 'checked="checked"' : ''; ?> type="radio" name="general[wpns_home]" value="N" id="wpns_homeN" /> <?php _e('No', $this -> plugin_name); ?></label>
    62           <label><input <?php echo ($generaloptions['wpns_home'] == "Y") ? 'checked="checked"' : ''; ?> type="radio" name="general[wpns_home]" value="Y" id="wpns_homeY" /> <?php _e('Blog', $this -> plugin_name); ?></label>
    63           <label><input <?php echo ($generaloptions['wpns_home'] == "C") ? 'checked="checked"' : ''; ?> type="radio" name="general[wpns_home]" value="C" id="wpns_homeC" /> <?php _e('Custom Slides', $this -> plugin_name); ?></label>
    64     </td>
    65     </tr>
    66     <tr valign="top">
    67         <th scope="row"><?php _e('Auto insert in post / page', $this -> plugin_name); ?></th>
    68         <td>
    69           <label><input <?php echo ($generaloptions['wpns_auto'] == "N") ? 'checked="checked"' : ''; ?> type="radio" name="general[wpns_auto]" value="N" id="wpns_autoN" /> <?php _e('No', $this -> plugin_name); ?></label>
    70           <label><input <?php echo ($generaloptions['wpns_auto'] == "Y") ? 'checked="checked"' : ''; ?> type="radio" name="general[wpns_auto]" value="Y" id="wpns_autoY" /> <?php _e('Gallery', $this -> plugin_name); ?></label>
    71           <label><input <?php echo ($generaloptions['wpns_auto'] == "C") ? 'checked="checked"' : ''; ?> type="radio" name="general[wpns_auto]" value="C" id="wpns_autoC" /> <?php _e('Custom Slides', $this -> plugin_name); ?></label>
    72     </td>
    73     </tr>
    74     <tr valign="top">
    75         <th scope="row"><?php _e('Auto slideshow position', $this -> plugin_name); ?></th>
    76         <td>
    77           <label><input <?php echo ($generaloptions['wpns_auto_position'] == "B") ? 'checked="checked"' : ''; ?> type="radio" name="general[wpns_auto_position]" value="B" id="wpns_positionB" /> <?php _e('Before the content', $this -> plugin_name); ?></label>
    78           <label><input <?php echo ($generaloptions['wpns_auto_position'] == "A") ? 'checked="checked"' : ''; ?> type="radio" name="general[wpns_auto_position]" value="A" id="wpns_positionA" /> <?php _e('After the content', $this -> plugin_name); ?></label>
    79     </td>
    80     </tr>
    81     <tr valign="top">
    82         <th scope="row"><?php _e('Category', $this -> plugin_name); ?></th>
    83         <td>
    84         <select name="general[wpns_category][]" id="wpns_category" multiple>
    85             <?php
    86                 $category = $generaloptions['wpns_category'];
    87                 $categories=  get_categories();
    88                 //echo '<option value="">'.__('select a category', $this -> plugin_name).'</option>';
    89                 foreach ($categories as $cat) {
    90                     $option = '<option value="'.$cat->term_id.'"';
    91                     if (in_array($cat->term_id,$category)||$category == $cat->term_id)
    92                         $option .= ' selected="selected">';
    93                     else { $option .= '>'; }
    94                     $option .= $cat->cat_name;
    95                     $option .= ' ('.$cat->category_count.')';
    96                     $option .= '</option>';
    97                     echo $option;
    98                 }
    99             ?>
    100     </select>
    101     </td>
    102     </tr>
    103     <tr valign="top">
    104         <th scope="row"><?php _e('Custom Slideshow selection', $this -> plugin_name); ?></th>
    105         <td>
    106         <select name="general[slide_gallery]" id="slide_gallery">
    107             <option value=""><?php _e('select a gallery', $this -> plugin_name); ?></option>
    108             <?php
    109                 $gallery = $generaloptions['slide_gallery'];
    110                 $galleries =  get_posts(array('post_type'=>'slideshow'));
    111                 foreach ($galleries as $gall) {
    112                     $gallery_count = count(get_children("post_parent=" . $gall->ID . "&post_type=attachment&post_mime_type=image&orderby=menu_order ASC, ID ASC"));
    113                     $option = '<option value="'.$gall->ID.'"';
    114                     if ($gallery == $gall->ID) $option .= ' selected="selected">';
    115                     else { $option .= '>'; }
    116                     $option .= $gall->post_title;
    117                     $option .= ' ('.$gallery_count.')';
    118                     $option .= '</option>';
    119                     echo $option;
    120                 }
    121             ?>
    122     </select>
    123     </td>
    124     </tr>
    125         <tr valign="top">
    126         <th scope="row"><?php _e('Post limit', $this -> plugin_name); ?></th>
    127         <td>
    128         <label>
    129             <input type="text" name="general[postlimit]" id="postlimit" size="7" value="<?php echo $generaloptions['postlimit']; ?>" />
    130         </label>
    131         </td>
    132     </tr>
    133     </tr>
    134         <tr valign="top">
    135         <th scope="row"><?php _e('Exclude', $this -> plugin_name); ?></th>
    136         <td>
    137         <label>
    138             <input type="text" name="general[exclude]" id="exclude" size="7" value="<?php echo $generaloptions['exclude']; ?>" />
    139         </label>
    140         </td>
    141     </tr>
    142     </tr>
    143         <tr valign="top">
    144         <th scope="row"><?php _e('Offset', $this -> plugin_name); ?></th>
    145         <td>
    146         <label>
    147             <input type="text" name="general[offset]" id="offset" size="7" value="<?php echo $generaloptions['offset']; ?>" />
    148         </label>
    149         </td>
    150     </tr>
     49    <table class="form-table">
     50        <tbody>
     51            <tr valign="top">
     52            <th scope="row"><?php _e('Auto insert in Home page', $this -> plugin_name); ?></th>
     53            <td>
     54              <input <?php echo ($generaloptions['wpns_home'] == "N") ? 'checked="checked"' : ''; ?> type="radio" name="general[wpns_home]" value="N" id="wpns_homeN" /> <?php _e('No', $this -> plugin_name); ?>
     55              <input <?php echo ($generaloptions['wpns_home'] == "Y") ? 'checked="checked"' : ''; ?> type="radio" name="general[wpns_home]" value="Y" id="wpns_homeY" /> <?php _e('Blog', $this -> plugin_name); ?>
     56              <input <?php echo ($generaloptions['wpns_home'] == "C") ? 'checked="checked"' : ''; ?> type="radio" name="general[wpns_home]" value="C" id="wpns_homeC" /> <?php _e('Custom Slides', $this -> plugin_name); ?>
     57            </td>
     58        </tr>
     59        <tr valign="top">
     60            <th scope="row"><?php _e('Auto insert in post / page', $this -> plugin_name); ?></th>
     61            <td>
     62              <input <?php echo ($generaloptions['wpns_auto'] == "N") ? 'checked="checked"' : ''; ?> type="radio" name="general[wpns_auto]" value="N" id="wpns_autoN" /> <?php _e('No', $this -> plugin_name); ?>
     63              <input <?php echo ($generaloptions['wpns_auto'] == "Y") ? 'checked="checked"' : ''; ?> type="radio" name="general[wpns_auto]" value="Y" id="wpns_autoY" /> <?php _e('Gallery', $this -> plugin_name); ?>
     64              <input <?php echo ($generaloptions['wpns_auto'] == "C") ? 'checked="checked"' : ''; ?> type="radio" name="general[wpns_auto]" value="C" id="wpns_autoC" /> <?php _e('Custom Slides', $this -> plugin_name); ?>
     65            </td>
     66        </tr>
     67        <tr valign="top">
     68            <th scope="row"><?php _e('Auto slideshow position', $this -> plugin_name); ?></th>
     69            <td>
     70              <input <?php echo ($generaloptions['wpns_auto_position'] == "B") ? 'checked="checked"' : ''; ?> type="radio" name="general[wpns_auto_position]" value="B" id="wpns_positionB" /> <?php _e('Before the content', $this -> plugin_name); ?>
     71              <input <?php echo ($generaloptions['wpns_auto_position'] == "A") ? 'checked="checked"' : ''; ?> type="radio" name="general[wpns_auto_position]" value="A" id="wpns_positionA" /> <?php _e('After the content', $this -> plugin_name); ?>
     72            </td>
     73        </tr>
     74        <tr valign="top">
     75            <th scope="row"><?php _e('Post Types', $this -> plugin_name); ?></th>
     76            <td>
     77                <i><?php _e('if nothing selected, alteration of the default query parameter - in most cases "post" - would not occur', $this -> plugin_name); ?></i><br />
     78                <select name="general[wpns_post_types][]" id="wpns_post_types" multiple>
     79                <?php
     80                    if(isset($generaloptions['wpns_post_types']))
     81                        $types = $generaloptions['wpns_post_types'];
     82                    else $types = array();
     83                    $type_args = array(
     84                            //'_builtin' => false,
     85                            'public'    => true,
     86                            'show_ui'   => true
     87                        );
     88                    $post_types = get_post_types($type_args, 'names');
     89                    //echo '<option value="">'.__('select a category', $this -> plugin_name).'</option>';
     90                    foreach ($post_types as $post_type) {
     91                        $option = '<option value="'.$post_type.'"';
     92                        if (in_array($post_type,$types)||$types == $post_type)
     93                            $option .= ' selected="selected">';
     94                        else { $option .= '>'; }
     95                        $option .= $post_type;
     96                        $option .= '</option>';
     97                        echo $option;
     98                    }
     99                ?>
     100                </select>
     101            </td>
     102        </tr>
     103        <tr valign="top">
     104            <th scope="row"><?php _e('Taxonomy', $this -> plugin_name); ?></th>
     105            <td>
     106                <select name="general[wpns_taxonomies][]" id="wpns_taxonomies" multiple>
     107                <?php
     108                    if(isset($generaloptions['wpns_taxonomies']))
     109                        $tax = $generaloptions['wpns_taxonomies'];
     110                    else $tax = array();
     111                    $tax_args = array(
     112                            //'_builtin' => false,
     113                            'public'   => true
     114                        );
     115                    $taxonomies = get_taxonomies($tax_args, 'objects');
     116                    //echo '<option value="">'.__('select a category', $this -> plugin_name).'</option>';
     117                    foreach ($taxonomies as $taxonomy) {
     118                        $option = '<option value="'.$taxonomy->rewrite['slug'].'"';
     119                        if (in_array($taxonomy->rewrite['slug'],$tax)||$tax == $taxonomy->rewrite['slug'])
     120                            $option .= ' selected="selected">';
     121                        else { $option .= '>'; }
     122                        $option .= $taxonomy->name;
     123                        $option .= '</option>';
     124                        echo $option;
     125                    }
     126                ?>
     127                </select>
     128            </td>
     129        </tr>
     130        <tr valign="top">
     131            <th scope="row"><?php _e('Terms', $this -> plugin_name); ?></th>
     132            <td>
     133            <i><?php _e('select the taxonomies above and save to refresh', $this -> plugin_name); ?></i><br />
     134            <?php
     135                if(isset($generaloptions['wpns_taxonomies']))
     136                    $taxonomies = $generaloptions['wpns_taxonomies'];
     137                else $taxonomies = array();
     138                if(isset($generaloptions['wpns_terms']))
     139                    $selected = $generaloptions['wpns_terms'];
     140                else $selected = array();
     141   
     142                $terms = array();
     143                $disabled = '';
     144                if(!empty($taxonomies))
     145                    foreach($taxonomies as $tax){
     146                        $tax_terms = get_terms($tax);
     147                        if(!is_wp_error($tax_terms)&&!empty($tax_terms))
     148                            foreach($tax_terms as $tax_term)
     149                                $terms[$tax_term->term_id] = $tax_term;
     150                    }
     151                else $disabled = 'disabled'; ?>
     152                <select name="general[wpns_terms][]" id="wpns_terms" multiple <?php echo $disabled;?>> 
     153                <?php
     154                    //echo '<option value="">'.__('select a category', $this -> plugin_name).'</option>';
     155                    if(!empty($terms))
     156                        foreach ($terms as $term) {
     157                            $option = '<option value="'.$term->term_id.'"';
     158                            if (in_array($term->term_id,$selected)||$selected == $term->term_id)
     159                                $option .= ' selected="selected">';
     160                            else { $option .= '>'; }
     161                            $option .= $term->name;
     162                            $option .= ' ('.$term->count.')';
     163                            $option .= '</option>';
     164                            echo $option;
     165                        }
     166                ?>
     167                </select>
     168            </td>
     169        </tr>
     170        <tr valign="top">
     171            <th scope="row"><?php _e('Custom Slideshow selection', $this -> plugin_name); ?></th>
     172            <td>
     173                <select name="general[slide_gallery]" id="slide_gallery">
     174                    <option value=""><?php _e('select a gallery', $this -> plugin_name); ?></option>
     175                    <?php
     176                    $gallery = $generaloptions['slide_gallery'];
     177                    $galleries =  get_posts(array('post_type'=>'slideshow'));
     178                    foreach ($galleries as $gall) {
     179                        $gallery_count = count(get_children("post_parent=" . $gall->ID . "&post_type=attachment&post_mime_type=image&orderby=menu_order ASC, ID ASC"));
     180                        $option = '<option value="'.$gall->ID.'"';
     181                        if ($gallery == $gall->ID) $option .= ' selected="selected">';
     182                        else { $option .= '>'; }
     183                        $option .= $gall->post_title;
     184                        $option .= ' ('.$gallery_count.')';
     185                        $option .= '</option>';
     186                        echo $option;
     187                    }
     188                ?>
     189                </select>
     190            </td>
     191        </tr>
     192            <tr valign="top">
     193            <th scope="row"><?php _e('Post limit', $this -> plugin_name); ?></th>
     194            <td>
     195                <input type="text" name="general[postlimit]" id="postlimit" size="7" value="<?php echo $generaloptions['postlimit']; ?>" />
     196            </td>
     197        </tr>
     198        </tr>
     199            <tr valign="top">
     200            <th scope="row"><?php _e('Exclude', $this -> plugin_name); ?></th>
     201            <td>
     202                <input type="text" name="general[exclude]" id="exclude" size="7" value="<?php echo $generaloptions['exclude']; ?>" />
     203            </td>
     204        </tr>
     205        </tr>
     206            <tr valign="top">
     207            <th scope="row"><?php _e('Offset', $this -> plugin_name); ?></th>
     208            <td>
     209                <input type="text" name="general[offset]" id="offset" size="7" value="<?php echo $generaloptions['offset']; ?>" />
     210            </td>
     211        </tr>
    151212    </tbody>
    152213  </table>
  • combo-slideshow/trunk/views/admin/settings.php

    r728039 r1105456  
    22global $post, $post_ID;
    33$post_ID = 1;
    4 wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false);
    5 wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false);
     4//wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false);
     5//wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false);
    66?>
    77<div class="wrap">
Note: See TracChangeset for help on using the changeset viewer.