Plugin Directory

Changeset 339811


Ignore:
Timestamp:
02/02/2011 09:20:15 AM (15 years ago)
Author:
hellysium
Message:
 
Location:
all-in-one-slideshow/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • all-in-one-slideshow/trunk/all-in-one-slideshow.php

    r317955 r339811  
    44Plugin URI: http://www.sramekdesign.com/wordpress/plugins/all-in-one-slideshow/
    55Description: All-In-One Slideshow plugin implements jCycle, Easing and Cufon scripts into the highly customizable slideshow gallery. You can combine 27 transition and 8 easing effects! The plugin comes with package of 8 cufon fonts. You can easlily add new fonts. Choose between arrow and numbered navigation. Or use both at once. Try out how easy it is to customize this slideshow gallery without knowledge of programming.
    6 Version: 1.2.1
     6Version: 1.3
    77Author: Tom Sramek
    88Author URI: http://www.sramekdesign.com/
     
    111111//  define our defaults (filterable)
    112112$aio_slideshow_defaults = apply_filters('aio_slideshow_defaults', array(
     113    'on_posts' => '',
     114    'on_pages' => '',
     115    'on_archive' => 1,
    113116    'rotate' => 1,
    114117    'effect' => 'fade',
     
    547550    <div class="inside">
    548551    <table class="form-table">
     552    <tr><th scope="row">Show slideshow on these single posts:</th>
     553        <td> 1. Leave this field empty if you want to load the slideshow's scripts / write CSS styles into the header on all single posts.<br />
     554        2. Type in "1,2,3" if you want to load slidesow on single posts with IDs 1,2 and 3.<br />
     555       
     556            <input type="text" name="aio_slideshow_settings[on_posts]" value="<?php echo $options['on_posts'] ?>" />
     557        </td></tr>
     558        <tr><th scope="row">Show slideshow on these pages:</th>
     559        <td> 1. Leave this field empty if you want to load the slideshow's scripts / write CSS styles into the header on all pages.<br />
     560        2. Type in "1,2,3" if you want to load slideshow on pages with IDs 1,2 and 3.<br />
     561       
     562            <input type="text" name="aio_slideshow_settings[on_pages]" value="<?php echo $options['on_pages'] ?>" />
     563        </td></tr>
     564       
     565            <tr valign="top"><th scope="row">Show on archive pages</th>
     566        <td><input name="aio_slideshow_settings[on_archive]" type="checkbox" value="1" <?php checked('1', $options['on_archive']); ?> /> <label for="aio_slideshow_settings[on_archive]">Check this box if you want to show your slideshow on archive pages ( is_home, is_archive(), is_author(), is_category() )</td>
     567        </tr>
    549568       
    550569        <tr valign="top"><th scope="row">Transition Enabled</th>
     
    795814   
    796815    </div><!-- /#poststuff -->
    797        
     816   
     817    <div style="clear: both;"></div>
     818    <p class="submit"><input type="submit" class="button-primary" value="<?php _e('Save Settings') ?>" /></p>   
    798819         
    799820    </div><!-- /.wrap -->
     
    804825    <div class="clear"></div>
    805826    <!-- The Reset Option -->
    806     <form method="post" action="options.php">
     827    <form method="post" action="options.php" style="margin: -48px 0 0 150px;" >
    807828    <?php settings_fields('aio_slideshow_settings'); ?>
    808829    <?php global $aio_slideshow_defaults; // use the defaults ?>
     
    826847//  this function sanitizes our settings data for storage
    827848function aio_slideshow_settings_validate($input) {
     849    $input['on_archive'] = ($input['on_archive'] == 1 ? 1 : 0);
    828850    $input['rotate'] = ($input['rotate'] == 1 ? 1 : 0);
    829851    $input['effect'] = wp_filter_nohtml_kses($input['effect']);
     
    865887function aio_slideshow($args = array(), $content = null) {
    866888    global $aio_slideshow_settings, $aio_slideshow_images, $value;
    867    
     889     
    868890    // possible future use
    869891    $args = wp_parse_args($args, $aio_slideshow_settings);
     
    903925    echo '<div id="prevnext"><a id="prev" href="#prevslide">Prev</a> <a id="next" href="#nextslide">Next</a></div>';
    904926    echo '</div>'.$newline;
     927    echo $aio_slideshow_settings['on_pages'];
    905928}
    906929
     
    918941}
    919942
    920 add_action('wp_print_scripts', 'aio_slideshow_scripts');
     943
    921944function aio_slideshow_scripts() {
    922945    global $aio_slideshow_settings;
     
    931954}
    932955
    933 add_action('wp_footer', 'aio_slideshow_args', 15);
     956
    934957function aio_slideshow_args() {
    935958    global $aio_slideshow_settings; ?>
     
    10061029<?php endif; ?>
    10071030
    1008 <?php }
    1009 
    1010 add_action( 'wp_head', 'aio_slideshow_style' );
    1011 function aio_slideshow_style() {
     1031<?php } // end of aio_slideshow_args()
     1032
     1033function aio_slideshow_style() {     
     1034   
    10121035    global $aio_slideshow_settings; ?>
    10131036   
     
    11291152</style>
    11301153
    1131 <?php }
     1154<?php } // end of aio_slideshow_style()
     1155
     1156/**
     1157 * next 3 functions check whethe to load slideshow scripts (since 1.3))
     1158 */
     1159
     1160//decide when you want to write styles into the header
     1161add_action( 'wp_head', 'aio_slideshow_when_styles' );
     1162function aio_slideshow_when_styles() {
     1163   
     1164  global $aio_slideshow_settings, $post;   
     1165 
     1166  //POSTS
     1167  //if posts field is empty
     1168  if( is_single() && $aio_slideshow_settings['on_posts'] == '' ) {   
     1169     
     1170     aio_slideshow_style();
     1171     
     1172  }
     1173 
     1174  //if posts field is not empty 
     1175  if($aio_slideshow_settings['on_posts'] !== '') {
     1176   
     1177  $on_posts_list = $aio_slideshow_settings['on_posts'];
     1178  $on_posts = explode(',', $on_posts_list); 
     1179  if( is_single($on_posts)) {   
     1180     
     1181     aio_slideshow_style();
     1182     
     1183   }
     1184   
     1185  }
     1186 
     1187  //PAGES
     1188  //if pages field is empty
     1189  if( is_page() && $aio_slideshow_settings['on_pages'] == '' ) {   
     1190     
     1191     aio_slideshow_style();
     1192     
     1193  }
     1194 
     1195  //if pages field is not empty 
     1196  if($aio_slideshow_settings['on_pages'] !== '') {
     1197   
     1198  $on_pages_list = $aio_slideshow_settings['on_pages'];
     1199  $on_pages = explode(',', $on_pages_list); 
     1200  if( is_page($on_pages)) {   
     1201     
     1202     aio_slideshow_style();
     1203     
     1204   }
     1205   
     1206  }
     1207 
     1208  //ARCHIVE
     1209  if(($aio_slideshow_settings['on_archive']) && ( is_home() || is_archive() || is_category() || is_author() ) ) {
     1210   
     1211    aio_slideshow_style();
     1212   
     1213  }
     1214   
     1215}
     1216
     1217//decide when you want hook scripts into the wp_print_scripts
     1218add_action('wp_print_scripts', 'aio_slideshow_when_scripts');
     1219function aio_slideshow_when_scripts() {
     1220   
     1221  global $aio_slideshow_settings, $post;   
     1222 
     1223  //POSTS
     1224  //if posts field is empty
     1225  if( is_single() && $aio_slideshow_settings['on_posts'] == '' ) {   
     1226     
     1227     aio_slideshow_scripts();
     1228     
     1229  }
     1230 
     1231  //if posts field is not empty 
     1232  if($aio_slideshow_settings['on_posts'] !== '') {
     1233   
     1234  $on_posts_list = $aio_slideshow_settings['on_posts'];
     1235  $on_posts = explode(',', $on_posts_list); 
     1236  if( is_single($on_posts)) {   
     1237     
     1238     aio_slideshow_scripts();
     1239     
     1240   }
     1241   
     1242  }
     1243 
     1244  //PAGES
     1245  //if pages field is empty
     1246  if( is_page() && $aio_slideshow_settings['on_pages'] == '' ) {   
     1247     
     1248     aio_slideshow_scripts(); 
     1249     
     1250  }
     1251 
     1252  //if pages field is not empty 
     1253  if($aio_slideshow_settings['on_pages'] !== '') {
     1254   
     1255  $on_pages_list = $aio_slideshow_settings['on_pages'];
     1256  $on_pages = explode(',', $on_pages_list); 
     1257  if( is_page($on_pages)) {   
     1258     
     1259     aio_slideshow_scripts(); 
     1260     
     1261   }
     1262   
     1263  }
     1264 
     1265  //ARCHIVE
     1266  if(($aio_slideshow_settings['on_archive']) && ( is_home() || is_archive() || is_category() || is_author() ) ) {
     1267   
     1268    aio_slideshow_scripts();
     1269   
     1270  }
     1271   
     1272}
     1273
     1274//decide when you want load / write scripts into the footer
     1275add_action('wp_footer', 'aio_slideshow_when_args', 15);
     1276
     1277function aio_slideshow_when_args() {
     1278   
     1279  global $aio_slideshow_settings, $post;   
     1280
     1281 
     1282  //ARCHIVE
     1283  if(($aio_slideshow_settings['on_archive']) && ( is_home() || is_archive() || is_category() || is_author() ) ) {
     1284   
     1285    aio_slideshow_args();
     1286   
     1287  }
     1288   
     1289}
    11321290
    11331291/**
  • all-in-one-slideshow/trunk/readme.txt

    r317953 r339811  
    2626     1.2.0     2010/12/01 conflict with custom menus solved.
    2727     1.2.1     2010/12/02 identifier #nav changed to #aio-nav, added upload tutorial, fixed 'settings link'. I apologize for the 3rd update in 3 days but I just want all users to be satisfied with the plugin. thank you!
     28     1.3.0     2011/02/02 one save button, option to set loading of scripts/styles only when you need them
    2829
    2930Thanks to all who sent bug reports and ideas for
Note: See TracChangeset for help on using the changeset viewer.