Changeset 425147
- Timestamp:
- 08/18/2011 01:26:59 AM (14 years ago)
- Location:
- wp-slimbox2/trunk
- Files:
-
- 2 added
- 7 edited
-
adminpage.php (modified) (25 diffs)
-
index.php (modified) (8 diffs)
-
initialize.php (modified) (1 diff)
-
javascript/slimbox2_autoload.js (modified) (1 diff)
-
languages/wp-slimbox2-pt_BR.mo (added)
-
languages/wp-slimbox2-pt_BR.po (added)
-
readme.txt (modified) (5 diffs)
-
src/slimbox2_autoload.js (modified) (1 diff)
-
statTrack.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-slimbox2/trunk/adminpage.php
r196034 r425147 1 1 <?php 2 $easingArray = array(swing,easeInQuad,easeOutQuad,easeInOutQuad,easeInCubic,easeOutCubic,easeInOutCubic,easeInQuart,easeOutQuart,easeInOutQuart,easeInQuint,easeOutQuint,easeInOutQuint,easeInSine,easeOutSine,easeInOutSine,easeInExpo,easeOutExpo,easeInOutExpo,easeInCirc,easeOutCirc,easeInOutCirc,easeInElastic,easeOutElastic,easeInOutElastic,easeInBack,easeOutBack,easeInOutBack,easeInBounce,easeOutBounce,easeInOutBounce);3 $overlayOpacity = array(0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1);4 $msArray = array(1,100,200,300,400,500,600,700,800,900,1000);5 $captions = array('a-title','img-alt','img-title','href','None');6 7 ?>8 <div class="wrap">9 <form method="post" action="" id="options"><?php echo wp_nonce_field('update-options','wp_slimbox_wpnonce'); ?><h2><?php _e('WP Slimbox2 Plugin', 'wp-slimbox2'); ?></h2>10 <?php11 if(isset($_POST['action']) && wp_verify_nonce($_POST['wp_slimbox_wpnonce'], 'update-options')) {12 $options->update_option(13 array(14 'autoload' => $_POST['wp_slimbox_autoload'],15 'loop' => $_POST['wp_slimbox_loop'],16 'overlayOpacity' => $_POST['wp_slimbox_overlayOpacity'],17 'overlayColor' => $_POST['wp_slimbox_overlayColor'],18 'overlayFadeDuration' => $_POST['wp_slimbox_overlayFadeDuration'],19 'resizeDuration' => $_POST['wp_slimbox_resizeDuration'],20 'resizeEasing' => $_POST['wp_slimbox_resizeEasing'],21 'initialWidth' => $_POST['wp_slimbox_initialWidth'],22 'initialHeight' => $_POST['wp_slimbox_initialHeight'],23 'imageFadeDuration' => $_POST['wp_slimbox_imageFadeDuration'],24 'captionAnimationDuration' => $_POST['wp_slimbox_captionAnimationDuration'],25 'caption' => array($_POST['wp_slimbox_caption1'],$_POST['wp_slimbox_caption2'],$_POST['wp_slimbox_caption3'],$_POST['wp_slimbox_caption4']),26 'url' => $_POST['wp_slimbox_url'],27 'selector' => $_POST['wp_slimbox_selector'],28 'counterText' => $_POST['wp_slimbox_counterText'],29 'closeKeys' => $_POST['wp_slimbox_closeKeys'],30 'previousKeys' => $_POST['wp_slimbox_previousKeys'],31 'nextKeys' => $_POST['wp_slimbox_nextKeys'],32 'picasaweb' => $_POST['wp_slimbox_picasaweb'],33 'flickr' => $_POST['wp_slimbox_flickr'],34 'mobile' => $_POST['wp_slimbox_mobile'],35 'maintenance' => $_POST['wp_slimbox_maintenance'],36 'cache' => $_POST['wp_slimbox_cache']37 )38 );39 echo '<div id="message" class="updated fade"><p><strong>'.__('Settings Saved', 'wp-slimbox2').'.</strong></p></div>';40 }41 $caption = $options->get_option('caption');42 43 2 function selectionGen(&$option,&$array) { 44 3 foreach($array as $key=> $ms) { … … 47 6 } 48 7 } 8 ?> 9 <div class="wrap"> 10 <h2><?php _e('WP Slimbox2 Plugin', 'wp-slimbox2'); ?></h2> 11 <form method="post" action="options.php"> 12 <?php 13 settings_fields('wp_slimbox_options'); 14 global $options; 15 $easingArray = array('swing','easeInQuad','easeOutQuad','easeInOutQuad','easeInCubic','easeOutCubic','easeInOutCubic','easeInQuart','easeOutQuart','easeInOutQuart','easeInQuint','easeOutQuint','easeInOutQuint','easeInSine','easeOutSine','easeInOutSine','easeInExpo','easeOutExpo','easeInOutExpo','easeInCirc','easeOutCirc','easeInOutCirc','easeInElastic','easeOutElastic','easeInOutElastic','easeInBack','easeOutBack','easeInOutBack','easeInBounce','easeOutBounce','easeInOutBounce'); 16 $overlayOpacity = array(0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1); 17 $msArray = array(1,100,200,300,400,500,600,700,800,900,1000); 18 $captions = array('a-title','img-alt','img-title','href','None'); 49 19 ?> 50 20 <div style="clear:both;padding-top:5px;"></div> … … 69 39 <td class='name'><?php _e('Autoload?', 'wp-slimbox2'); ?></td> 70 40 <th scope='row' class='check-column'> 71 <input type="checkbox" name="wp_slimbox _autoload"<?php if ($options->get_option('autoload') == 'on') echo ' checked="yes"';?> />41 <input type="checkbox" name="wp_slimbox[autoload]"<?php if (isset($options['autoload'])) echo ' checked="yes"';?> /> 72 42 </th> 73 43 <td class='desc'> … … 79 49 <td class='name'><?php _e('Enable Picasaweb Integration?', 'wp-slimbox2'); ?></td> 80 50 <th scope='row' class='check-column'> 81 <input type="checkbox" name="wp_slimbox _picasaweb"<?php if ($options->get_option('picasaweb') == 'on') echo ' checked="yes"';?> />51 <input type="checkbox" name="wp_slimbox[picasaweb]"<?php if (isset($options['picasaweb'])) echo ' checked="yes"';?> /> 82 52 </th> 83 53 <td class='desc'> … … 89 59 <td class='name'><?php _e('Enable Flickr Integration?', 'wp-slimbox2'); ?></td> 90 60 <th scope='row' class='check-column'> 91 <input type="checkbox" name="wp_slimbox _flickr"<?php if ($options->get_option('flickr') == 'on') echo ' checked="yes"';?> />61 <input type="checkbox" name="wp_slimbox[flickr]"<?php if (isset($options['flickr'])) echo ' checked="yes"';?> /> 92 62 </th> 93 63 <td class='desc'> … … 99 69 <td class='name'><?php _e('Loop?', 'wp-slimbox2'); ?></td> 100 70 <th scope='row' class='check-column'> 101 <input type="checkbox" name="wp_slimbox _loop"<?php if ($options->get_option('loop') == 'on') echo ' checked="yes"';?> />71 <input type="checkbox" name="wp_slimbox[loop]"<?php if (isset($options['loop'])) echo ' checked="yes"';?> /> 102 72 </th> 103 73 <td class='desc'> … … 109 79 <td class='name'><?php _e('Overlay Opacity', 'wp-slimbox2'); ?></td> 110 80 <th scope='row' class='check-column'> 111 <select name="wp_slimbox _overlayOpacity">112 <?php selectionGen($options ->get_option('overlayOpacity'),$overlayOpacity); ?>81 <select name="wp_slimbox[overlayOpacity]"> 82 <?php selectionGen($options['overlayOpacity'],$overlayOpacity); ?> 113 83 </select> 114 84 </th> … … 121 91 <td class='name'><?php _e('Overlay Color', 'wp-slimbox2'); ?></td> 122 92 <th scope='row' class='check-column'> 123 <input type="text" id="wp_slimbox_overlayColor" name="wp_slimbox _overlayColor" value="<?php echo $options->get_option('overlayColor'); ?>" size="7" maxlength="7"/><div id="picker"></div>93 <input type="text" id="wp_slimbox_overlayColor" name="wp_slimbox[overlayColor]" value="<?php echo $options['overlayColor']; ?>" size="7" maxlength="7"/><div id="picker"></div> 124 94 125 95 </th> … … 132 102 <td class='name'><?php _e('Overlay Fade Duration', 'wp-slimbox2'); ?></td> 133 103 <th scope='row' class='check-column'> 134 <select name="wp_slimbox _overlayFadeDuration">135 <?php selectionGen($options ->get_option('overlayFadeDuration'),$msArray); ?>104 <select name="wp_slimbox[overlayFadeDuration]"> 105 <?php selectionGen($options['overlayFadeDuration'],$msArray); ?> 136 106 </select> 137 107 </th> … … 144 114 <td class='name'><?php _e('Resize Duration', 'wp-slimbox2'); ?></td> 145 115 <th scope='row' class='check-column'> 146 <select name="wp_slimbox _resizeDuration">147 <?php selectionGen($options ->get_option('resizeDuration'),$msArray); ?>116 <select name="wp_slimbox[resizeDuration]"> 117 <?php selectionGen($options['resizeDuration'],$msArray); ?> 148 118 </select> 149 119 </th> … … 156 126 <td class='name'><?php _e('Resize Easing', 'wp-slimbox2'); ?></td> 157 127 <th scope='row' class='check-column'> 158 <select name="wp_slimbox _resizeEasing">159 <?php selectionGen($options ->get_option('resizeEasing'),$easingArray); ?>128 <select name="wp_slimbox[resizeEasing]"> 129 <?php selectionGen($options['resizeEasing'],$easingArray); ?> 160 130 </select> 161 131 </th> … … 168 138 <td class='name'><?php _e('Initial Width', 'wp-slimbox2'); ?></td> 169 139 <th scope='row' class='check-column'> 170 <input type="text" name="wp_slimbox _initialWidth" value="<?php echo $options->get_option('initialWidth'); ?>" />140 <input type="text" name="wp_slimbox[initialWidth]" value="<?php echo $options['initialWidth']; ?>" /> 171 141 </th> 172 142 <td class='desc'> … … 178 148 <td class='name'><?php _e('Initial Height', 'wp-slimbox2'); ?></td> 179 149 <th scope='row' class='check-column'> 180 <input type="text" name="wp_slimbox _initialHeight" value="<?php echo $options->get_option('initialHeight'); ?>" />150 <input type="text" name="wp_slimbox[initialHeight]" value="<?php echo $options['initialHeight']; ?>" /> 181 151 </th> 182 152 <td class='desc'> … … 187 157 <td class='name'><?php _e('Image Fade Duration', 'wp-slimbox2'); ?></td> 188 158 <th scope='row' class='check-column'> 189 <select name="wp_slimbox _imageFadeDuration">190 <?php selectionGen($options ->get_option('imageFadeDuration'),$msArray); ?>159 <select name="wp_slimbox[imageFadeDuration]"> 160 <?php selectionGen($options['imageFadeDuration'],$msArray); ?> 191 161 </select> 192 162 </th> … … 199 169 <td class='name'><?php _e('Caption Animation Duration', 'wp-slimbox2'); ?></td> 200 170 <th scope='row' class='check-column'> 201 <select name="wp_slimbox _captionAnimationDuration">202 <?php selectionGen($options ->get_option('captionAnimationDuration'),$msArray); ?>171 <select name="wp_slimbox[captionAnimationDuration]"> 172 <?php selectionGen($options['captionAnimationDuration'],$msArray); ?> 203 173 </select> 204 174 </th> … … 210 180 <td class='name'><?php _e('Image Caption Source Order', 'wp-slimbox2'); ?></td> 211 181 <th scope='row' class='check-column'> 212 <select name="wp_slimbox _caption1">213 <?php selectionGen($ caption[0],$captions); ?>214 </select> 215 <select name="wp_slimbox _caption2">216 <?php selectionGen($ caption[1],$captions); ?>217 </select> 218 <select name="wp_slimbox _caption3">219 <?php selectionGen($ caption[2],$captions); ?>220 </select> 221 <select name="wp_slimbox _caption4">222 <?php selectionGen($ caption[3],$captions); ?>182 <select name="wp_slimbox[caption][]"> 183 <?php selectionGen($options['caption'][0],$captions); ?> 184 </select> 185 <select name="wp_slimbox[caption][]"> 186 <?php selectionGen($options['caption'][1],$captions); ?> 187 </select> 188 <select name="wp_slimbox[caption][]"> 189 <?php selectionGen($options['caption'][2],$captions); ?> 190 </select> 191 <select name="wp_slimbox[caption][]"> 192 <?php selectionGen($options['caption'][3],$captions); ?> 223 193 </select> 224 194 </th> … … 231 201 <td class='name'><?php _e('Caption is URL', 'wp-slimbox2'); ?></td> 232 202 <th scope='row' class='check-column'> 233 <input type="checkbox" name="wp_slimbox _url"<?php if ($options->get_option('url') == 'on') echo ' checked="yes"';?> />203 <input type="checkbox" name="wp_slimbox[url]"<?php if (isset($options['url'])) echo ' checked="yes"';?> /> 234 204 </th> 235 205 <td class='desc'> … … 240 210 <td class='name'><?php _e('Autoload Selector', 'wp-slimbox2'); ?></td> 241 211 <th scope='row' class='check-column'> 242 <input type="text" name="wp_slimbox _selector" value="<?php echo $options->get_option('selector'); ?>" />212 <input type="text" name="wp_slimbox[selector]" value="<?php echo $options['selector']; ?>" /> 243 213 </th> 244 214 <td class='desc'> … … 250 220 <td class='name'><?php _e('Counter Text', 'wp-slimbox2'); ?></td> 251 221 <th scope='row' class='check-column'> 252 <input type="text" name="wp_slimbox _counterText" value="<?php echo $options->get_option('counterText'); ?>" />222 <input type="text" name="wp_slimbox[counterText]" value="<?php echo $options['counterText']; ?>" /> 253 223 </th> 254 224 <td class='desc'> … … 259 229 <td class='name'><?php _e('Close Keys', 'wp-slimbox2'); ?></td> 260 230 <th scope='row' class='check-column'> 261 <input type="text" name="wp_slimbox _closeKeys" class="keys" value="<?php echo $options->get_option('closeKeys'); ?>"/>231 <input type="text" name="wp_slimbox[closeKeys]" class="keys" value="<?php echo $options['closeKeys']; ?>"/> 262 232 </th> 263 233 <td class='desc' rowspan=3> … … 269 239 <td class='name'><?php _e('Previous Keys', 'wp-slimbox2'); ?></td> 270 240 <th scope='row' class='check-column'> 271 <input type="text" name="wp_slimbox _previousKeys" class="keys" value="<?php echo $options->get_option('previousKeys'); ?>"/>241 <input type="text" name="wp_slimbox[previousKeys]" class="keys" value="<?php echo $options['previousKeys']; ?>"/> 272 242 </th> 273 243 </tr> … … 275 245 <td class='name'><?php _e('Next Keys', 'wp-slimbox2'); ?></td> 276 246 <th scope='row' class='check-column'> 277 <input type="text" name="wp_slimbox _nextKeys" class="keys" value="<?php echo $options->get_option('nextKeys'); ?>"/>247 <input type="text" name="wp_slimbox[nextKeys]" class="keys" value="<?php echo $options['nextKeys']; ?>"/> 278 248 </th> 279 249 </tr> … … 281 251 <td class='name'><?php _e('Enable on mobiles?', 'wp-slimbox2'); ?></td> 282 252 <th scope='row' class='check-column'> 283 <input type="checkbox" name="wp_slimbox _mobile"<?php if ($options->get_option('mobile') == 'on') echo ' checked="yes"';?> />253 <input type="checkbox" name="wp_slimbox[mobile]"<?php if (isset($options['mobile'])) echo ' checked="yes"';?> /> 284 254 </th> 285 255 <td class='desc'> … … 290 260 <td class='name'><?php _e('Maintenance mode', 'wp-slimbox2'); ?></td> 291 261 <th scope='row' class='check-column'> 292 <input type="checkbox" name="wp_slimbox _maintenance"<?php if ($options->get_option('maintenance') == 'on') echo ' checked="yes"';?> />262 <input type="checkbox" name="wp_slimbox[maintenance]"<?php if (isset($options['maintenance'])) echo ' checked="yes"';?> /> 293 263 </th> 294 264 <td class='desc'> … … 296 266 </p> 297 267 </tr> 298 <input type="hidden" name="wp_slimbox_cache" value="<?php echo time(); ?>" />299 268 </tbody> 300 269 </table> 301 <input type="hidden" name="action" value="update" />302 270 <div style="clear:both;padding-top:20px;"></div> 303 <p class="submit"><input type="submit" name="Submit" value="<?php _e('Update Options','wp-slimbox2'); ?>" /></p> 271 <p class="submit"> 272 <input type="submit" class="button-primary" value="<?php _e('Update Options','wp-slimbox2'); ?>" /> 273 </p> 304 274 <div style="clear:both;padding-top:20px;"></div> 305 275 </form> -
wp-slimbox2/trunk/index.php
r237599 r425147 3 3 Plugin Name: WP-Slimbox2 4 4 Plugin URI: http://transientmonkey.com/wp-slimbox2 5 Description: A Wordpress implementation of the Slimbox2 javascript, utilizing jQuery, originally written by Christophe Beyls. Requires WP 2. 6+5 Description: A Wordpress implementation of the Slimbox2 javascript, utilizing jQuery, originally written by Christophe Beyls. Requires WP 2.8+ 6 6 Author: Greg Yingling (malcalevak) 7 Version: 1.0. 3.27 Version: 1.0.4b 8 8 Author URI: http://transientmonkey.com/ 9 9 … … 24 24 */ 25 25 26 if ( !class_exists('WPlize') ) { 27 require_once('WPlize/WPlize.php'); 26 load_plugin_textdomain ('wp-slimbox2', WP_PLUGIN_DIR.'/wp-slimbox2/languages', '/wp-slimbox2/languages'); 27 28 $options = wp_slimbox_validate(get_option('wp_slimbox',wp_slimbox_initialize())); 29 30 add_action('wp_print_scripts', 'wp_slimbox_scripts'); 31 add_action('wp_print_styles', 'wp_slimbox_styles'); 32 33 function wp_slimbox_initialize() { 34 require('initialize.php'); 35 return wp_slimbox_initialize_variables(); 28 36 } 29 37 30 load_plugin_textdomain ('wp-slimbox2', WP_PLUGIN_DIR.'/wp-slimbox2/languages', '/wp-slimbox2/languages');31 add_action('wp_print_scripts', 'wp_slimbox_scripts');32 add_action('wp_print_styles', 'wp_slimbox_styles');33 register_activation_hook( __FILE__, 'wp_slimbox_activate' );34 35 function wp_slimbox_activate() {36 $options = new WPlize('wp_slimbox');37 require('initialize.php');38 if(file_exists( WP_PLUGIN_DIR.'/wp-slimbox2/statTrack.php')){39 require_once('statTrack.php');40 statTrack();41 }42 }43 44 45 46 38 function wp_slimbox_styles() { 47 $options = new WPlize('wp_slimbox');48 39 wp_register_style('slimbox2', WP_PLUGIN_URL.'/wp-slimbox2/slimbox2.css','','1.1','screen'); 49 40 wp_enqueue_style('slimbox2'); … … 53 44 } 54 45 wp_register_script('slimbox2', WP_PLUGIN_URL.'/wp-slimbox2/javascript/slimbox2.js',array('jquery'), '2.04'); 55 wp_register_script('slimbox2_autoload', WP_PLUGIN_URL.'/wp-slimbox2/javascript/slimbox2_autoload.js',array('slimbox2'), $options->get_option('cache'));//add option for version number, update with each save46 wp_register_script('slimbox2_autoload', WP_PLUGIN_URL.'/wp-slimbox2/javascript/slimbox2_autoload.js',array('slimbox2'),'1.0.4b'); 56 47 wp_register_script('jquery_easing', WP_PLUGIN_URL.'/wp-slimbox2/javascript/jquery.easing.1.3.js',array('jquery'), '1.3'); 57 48 } 49 58 50 function wp_slimbox_scripts() { 59 $options = new WPlize('wp_slimbox');60 51 if (!is_admin()) 61 52 { 62 if($options->get_option('maintenance') == 'on') { 63 if (isset($_REQUEST['slimbox'])) setcookie('slimboxC',$_REQUEST['slimbox'],0,'/'); 64 if ($_REQUEST['slimbox'] == 'off' OR (!isset($_REQUEST['slimbox']) AND $_COOKIE['slimboxC'] != 'on')) return; 53 global $options; 54 if(isset($options['maintenance'])) { 55 if (isset($_REQUEST['slimbox'])) $_SESSION['slimboxC']=$_REQUEST['slimbox']; 56 else if(!isset($_SESSION['slimboxC'])) $_SESSION['slimboxC']='off'; 57 if ($_SESSION['slimboxC'] != 'on') return; 65 58 } 66 if($options ->get_option('resizeEasing')!= 'swing') wp_enqueue_script('jquery_easing');59 if($options['resizeEasing'] != 'swing') wp_enqueue_script('jquery_easing'); 67 60 wp_enqueue_script('slimbox2_autoload'); 68 $captions = $options ->get_option('caption');61 $captions = $options['caption']; 69 62 $caption = ''; 70 63 for ($i = 0; $i<4; $i++) { … … 89 82 $caption .= 'el.href'; 90 83 wp_localize_script( 'slimbox2_autoload', 'slimbox2_options', array( 91 'autoload' => ( ($options->get_option('autoload') == 'on')?true:false),92 'overlayColor' => $options ->get_option('overlayColor'),93 'loop' => ( ($options->get_option('loop') == 'on')?true:false),94 'overlayOpacity' => $options ->get_option('overlayOpacity'),95 'overlayFadeDuration' => $options ->get_option('overlayFadeDuration'),96 'resizeDuration' => $options ->get_option('resizeDuration'),97 'resizeEasing' => $options ->get_option('resizeEasing'),98 'initialWidth' => $options ->get_option('initialWidth'),99 'initialHeight' => $options ->get_option('initialHeight'),100 'imageFadeDuration' => $options ->get_option('imageFadeDuration'),101 'captionAnimationDuration' => $options ->get_option('captionAnimationDuration'),84 'autoload' => (isset($options['autoload'])?true:false), 85 'overlayColor' => $options['overlayColor'], 86 'loop' => (isset($options['loop'])?true:false), 87 'overlayOpacity' => $options['overlayOpacity'], 88 'overlayFadeDuration' => $options['overlayFadeDuration'], 89 'resizeDuration' => $options['resizeDuration'], 90 'resizeEasing' => $options['resizeEasing'], 91 'initialWidth' => $options['initialWidth'], 92 'initialHeight' => $options['initialHeight'], 93 'imageFadeDuration' => $options['imageFadeDuration'], 94 'captionAnimationDuration' => $options['captionAnimationDuration'], 102 95 'caption' => $caption, 103 'url' => ( ($options->get_option('url') == 'on')?true:false),104 'selector' => $options ->get_option('selector'),105 'counterText' => $options ->get_option('counterText'),106 'closeKeys' => $options ->get_option('closeKeys'),107 'previousKeys' => $options ->get_option('previousKeys'),108 'nextKeys' => $options ->get_option('nextKeys'),96 'url' => (isset($options['url'])?true:false), 97 'selector' => $options['selector'], 98 'counterText' => $options['counterText'], 99 'closeKeys' => $options['closeKeys'], 100 'previousKeys' => $options['previousKeys'], 101 'nextKeys' => $options['nextKeys'], 109 102 'prev' => WP_PLUGIN_URL.'/wp-slimbox2/images/'.__('default/prevlabel.gif', 'wp-slimbox2'), 110 103 'next' => WP_PLUGIN_URL.'/wp-slimbox2/images/'.__('default/nextlabel.gif', 'wp-slimbox2'), 111 104 'close' => WP_PLUGIN_URL.'/wp-slimbox2/images/'.__('default/closelabel.gif', 'wp-slimbox2'), 112 'picasaweb' => ( ($options->get_option('picasaweb') == 'on')?true:false),113 'flickr' => ( ($options->get_option('flickr') == 'on')?true:false),114 'mobile' => ( ($options->get_option('mobile') == 'on')?true:false)105 'picasaweb' => (isset($options['picasaweb'])?true:false), 106 'flickr' => (isset($options['flickr'])?true:false), 107 'mobile' => (isset($options['mobile'])?true:false) 115 108 )); 116 109 } … … 121 114 122 115 function show_slimbox_options() { 123 $page = add_options_page('WP-Slimbox2 Options', 'WP-Slimbox2', 8, 'slimbox2options', 'slimbox_options');116 $page = add_options_page('WP-Slimbox2 Options', 'WP-Slimbox2', 'edit_pages', 'slimbox2options', 'slimbox_options'); 124 117 add_action( "admin_print_scripts-$page", 'slimbox_adminhead' ); 125 118 add_action( "admin_print_styles-$page", 'slimbox_admin_styles' ); … … 127 120 128 121 function slimbox_options() { 129 $options = new WPlize('wp_slimbox');130 122 require('adminpage.php'); 131 123 } … … 136 128 wp_register_script('load_farbtastic', WP_PLUGIN_URL.'/wp-slimbox2/javascript/farbtastic/load_farbtastic.js',array('jquery_farbtastic'), '1.0'); 137 129 wp_register_script('load_keypress', WP_PLUGIN_URL.'/wp-slimbox2/javascript/keypress.js',array('jquery'), '1.1'); 130 register_setting( 'wp_slimbox_options', 'wp_slimbox', 'wp_slimbox_validate'); 138 131 } 139 132 … … 146 139 wp_enqueue_script('load_keypress'); 147 140 } 141 142 function wp_slimbox_validate($options) { 143 $easingArray = array('swing','easeInQuad','easeOutQuad','easeInOutQuad','easeInCubic','easeOutCubic','easeInOutCubic','easeInQuart','easeOutQuart','easeInOutQuart','easeInQuint','easeOutQuint','easeInOutQuint','easeInSine','easeOutSine','easeInOutSine','easeInExpo','easeOutExpo','easeInOutExpo','easeInCirc','easeOutCirc','easeInOutCirc','easeInElastic','easeOutElastic','easeInOutElastic','easeInBack','easeOutBack','easeInOutBack','easeInBounce','easeOutBounce','easeInOutBounce'); 144 $overlayOpacity = array(0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1); 145 $msArray = array(1,100,200,300,400,500,600,700,800,900,1000); 146 $captions = array('a-title','img-alt','img-title','href','None'); 147 if(isset($options['autoload'])) $options['autoload'] = 'on'; 148 if(isset($options['loop'])) $options['loop'] = 'on'; 149 if(isset($options['url'])) $options['url'] = 'on'; 150 if(isset($options['picasaweb'])) $options['picasaweb'] = 'on'; 151 if(isset($options['flickr'])) $options['flickr'] = 'on'; 152 if(isset($options['mobile'])) $options['mobile'] = 'on'; 153 $options['overlayOpacity'] = (isset($options['overlayOpacity']) && in_array($options['overlayOpacity'],$overlayOpacity))? $options['overlayOpacity']:'0.8'; 154 $options['overlayFadeDuration'] = (isset($options['overlayFadeDuration']) && in_array($options['overlayFadeDuration'],$msArray))? $options['overlayFadeDuration']:'400'; 155 $options['resizeDuration'] = (isset($options['resizeDuration']) && in_array($options['resizeDuration'],$msArray))? $options['resizeDuration']:'400'; 156 $options['resizeEasing'] = (isset($options['resizeEasing']) && in_array($options['resizeEasing'],$easingArray))? $options['resizeEasing']:'swing'; 157 $options['imageFadeDuration'] = (isset($options['imageFadeDuration']) && in_array($options['imageFadeDuration'],$msArray))? $options['imageFadeDuration']:'400'; 158 $options['captionAnimationDuration'] = (isset($options['captionAnimationDuration']) && in_array($options['captionAnimationDuration'],$msArray))? $options['captionAnimationDuration']:'400'; 159 $options['initialWidth'] = (isset($options['initialWidth']) && is_int($options['initialWidth']))? $options['initialWidth']:'250'; 160 $options['initialHeight'] = (isset($options['initialHeight']) && is_int($options['initialHeight']))? $options['initialHeight']:'250'; 161 if(isset($options['caption'])) foreach ($options['caption'] as $key => $caption) $caption=(in_array($caption,$captions,true)?$caption:$captions[$key]); 162 else $options['caption'] = $captions; 163 $options['counterText'] = wp_filter_nohtml_kses( $options['counterText'] ); 164 $closekeys = explode(',',$options['closeKeys']); 165 foreach($closekeys as $closeKey) $closeKey = is_int($closeKey)?$closeKey:''; 166 $options['closeKeys'] = implode(',',$closekeys); 167 $previousKeys = explode(',',$options['previousKeys']); 168 foreach($previousKeys as $previousKey) $previousKey = is_int($previousKey)?$previousKey:''; 169 $options['previousKeys'] = implode(',',$previousKeys); 170 $nextKeys = explode(',',$options['nextKeys']); 171 foreach($nextKeys as $nextKey) $nextKey = is_int($nextKey)?$nextKey:''; 172 $options['nextKeys'] = implode(',',$nextKeys); 173 $options['selector'] = isset($options['selector'])?wp_filter_nohtml_kses( $options['selector'] ):'div.entry-content, div.gallery, div.entry, div.post, div#page, body'; 174 //finish setting defaults, check color 175 return $options; 176 } 177 148 178 ?> -
wp-slimbox2/trunk/initialize.php
r237598 r425147 1 1 <?php 2 if(get_option('wp_slimbox_autoload')) {//if we're using a really old version of the plugin, transfer the settings, then delete them 3 $options->init_option(array( 4 'autoload' => get_option('wp_slimbox_autoload'), 5 'loop' => get_option('wp_slimbox_loop'), 6 'overlayOpacity' => get_option('wp_slimbox_overlayOpacity'), 7 'overlayColor' => get_option('wp_slimbox_overlayColor'), 8 'overlayFadeDuration' => get_option('wp_slimbox_overlayFadeDuration'), 9 'resizeDuration' => get_option('wp_slimbox_resizeDuration'), 10 'resizeEasing' => get_option('wp_slimbox_resizeEasing'), 11 'initialWidth' => get_option('wp_slimbox_initialWidth'), 12 'initialHeight' => get_option('wp_slimbox_initialHeight'), 13 'imageFadeDuration' => get_option('wp_slimbox_imageFadeDuration'), 14 'captionAnimationDuration' => get_option('wp_slimbox_captionAnimationDuration'), 15 'caption' => array('a-title','img-alt','img-title','href'), 16 'url' => 'on', 17 'selector' => 'div.entry-content, div.gallery, div.entry, div.post, div#page, body', 18 'counterText' => get_option('wp_slimbox_counterText'), 19 'closeKeys' => get_option('wp_slimbox_closeKeys'), 20 'previousKeys' => get_option('wp_slimbox_previousKeys'), 21 'nextKeys' => get_option('wp_slimbox_nextKeys'), 22 'picasaweb' => get_option('wp_slimbox_picasaweb'), 23 'flickr' => get_option('wp_slimbox_flickr'), 24 'mobile' => 'off', 25 'maintenance' => get_option('wp_slimbox_maintenance'), 26 'cache' => get_option('wp_slimbox_cache') 27 )); 28 delete_option('wp_slimbox_autoload'); 29 delete_option('wp_slimbox_loop'); 30 delete_option('wp_slimbox_overlayOpacity'); 31 delete_option('wp_slimbox_overlayColor'); 32 delete_option('wp_slimbox_overlayFadeDuration'); 33 delete_option('wp_slimbox_resizeDuration'); 34 delete_option('wp_slimbox_resizeEasing'); 35 delete_option('wp_slimbox_initialWidth'); 36 delete_option('wp_slimbox_initialHeight'); 37 delete_option('wp_slimbox_imageFadeDuration'); 38 delete_option('wp_slimbox_captionAnimationDuration'); 39 delete_option('wp_slimbox_counterText'); 40 delete_option('wp_slimbox_closeKeys'); 41 delete_option('wp_slimbox_previousKeys'); 42 delete_option('wp_slimbox_nextKeys'); 43 delete_option('wp_slimbox_picasaweb'); 44 delete_option('wp_slimbox_flickr'); 45 delete_option('wp_slimbox_maintenance'); 46 delete_option('wp_slimbox_cache'); 47 } else if (!$options->get_option('autoload')){// new plugin users get all defaults loaded 48 $options->init_option(array( 49 'autoload' => 'off', 50 'loop' => 'off', 51 'overlayOpacity' => '0.8', 52 'overlayColor' => '#000000', 53 'overlayFadeDuration' => '400', 54 'resizeDuration' => '400', 55 'resizeEasing' => 'swing', 56 'initialWidth' => '250', 57 'initialHeight' => '250', 58 'imageFadeDuration' => '400', 59 'captionAnimationDuration' => '400', 60 'caption' => array('a-title','img-alt','img-title','href'), 61 'url' => 'on', 62 'selector' => 'div.entry-content, div.gallery, div.entry, div.post, div#page, body', 63 'counterText' => __('Image {x} of {y}', 'wp-slimbox2'), 64 'closeKeys' => __('27,88,67', 'wp-slimbox2'), 65 'previousKeys' => __('37,80', 'wp-slimbox2'), 66 'nextKeys' => __('39,78', 'wp-slimbox2'), 67 'picasaweb' => 'off', 68 'flickr' => 'off', 69 'maintenance' => 'off', 70 'mobile' => 'off', 71 'cache' => time() 72 )); 73 } 74 if (!$options->get_option('caption')){//upgraders get the new options and defaults added 75 $options->update_option(array( 76 'caption' => array('a-title','img-alt','img-title','href'), 77 'url' => 'on', 78 'selector' => 'div.entry-content, div.gallery, div.entry, div.post, div#page, body', 79 'mobile' => 'off' 80 )); 2 function wp_slimbox_initialize_variables() { 3 if(get_option('wp_slimbox_autoload')!=false) {//if it's an old version of the plugin, transfer the variables and delete the old 4 $options = array( 5 'autoload' => get_option('wp_slimbox_autoload','on'), 6 'overlayOpacity' => get_option('wp_slimbox_overlayOpacity','0.8'), 7 'overlayColor' => get_option('wp_slimbox_overlayColor','#000000'), 8 'overlayFadeDuration' => get_option('wp_slimbox_overlayFadeDuration','400'), 9 'resizeDuration' => get_option('wp_slimbox_resizeDuration','400'), 10 'resizeEasing' => get_option('wp_slimbox_resizeEasing','swing'), 11 'initialWidth' => get_option('wp_slimbox_initialWidth','250'), 12 'initialHeight' => get_option('wp_slimbox_initialHeight','250'), 13 'imageFadeDuration' => get_option('wp_slimbox_imageFadeDuration','400'), 14 'captionAnimationDuration' => get_option('wp_slimbox_captionAnimationDuration','400'), 15 'caption' => array('a-title','img-alt','img-title','href'), 16 'url' => 'on', 17 'selector' => 'div.entry-content, div.gallery, div.entry, div.post, div#page, body', 18 'counterText' => get_option('wp_slimbox_counterText',__('Image {x} of {y}', 'wp-slimbox2')), 19 'closeKeys' => get_option('wp_slimbox_closeKeys',__('27,88,67', 'wp-slimbox2')), 20 'previousKeys' => get_option('wp_slimbox_previousKeys',__('37,80', 'wp-slimbox2')), 21 'nextKeys' => get_option('wp_slimbox_nextKeys',__('39,78', 'wp-slimbox2')) 22 ); 23 if(get_option('wp_slimbox_loop')=='on') $options['wp_slimbox_loop'] == 'on'; 24 if(get_option('wp_slimbox_picasaweb')=='on') $options['wp_slimbox_picasaweb'] == 'on'; 25 if(get_option('wp_slimbox_flickr')=='on') $options['wp_slimbox_flickr'] == 'on'; 26 if(get_option('wp_slimbox_maintenance')=='on') $options['wp_slimbox_maintenance'] == 'on'; 27 delete_option('wp_slimbox_autoload'); 28 delete_option('wp_slimbox_loop'); 29 delete_option('wp_slimbox_overlayOpacity'); 30 delete_option('wp_slimbox_overlayColor'); 31 delete_option('wp_slimbox_overlayFadeDuration'); 32 delete_option('wp_slimbox_resizeDuration'); 33 delete_option('wp_slimbox_resizeEasing'); 34 delete_option('wp_slimbox_initialWidth'); 35 delete_option('wp_slimbox_initialHeight'); 36 delete_option('wp_slimbox_imageFadeDuration'); 37 delete_option('wp_slimbox_captionAnimationDuration'); 38 delete_option('wp_slimbox_counterText'); 39 delete_option('wp_slimbox_closeKeys'); 40 delete_option('wp_slimbox_previousKeys'); 41 delete_option('wp_slimbox_nextKeys'); 42 delete_option('wp_slimbox_picasaweb'); 43 delete_option('wp_slimbox_flickr'); 44 delete_option('wp_slimbox_maintenance'); 45 delete_option('wp_slimbox_cache'); 46 } else { 47 $options = array( 48 'autoload' => 'on', 49 'overlayOpacity' => '0.8', 50 'overlayColor' => '#000000', 51 'overlayFadeDuration' => '400', 52 'resizeDuration' => '400', 53 'resizeEasing' => 'swing', 54 'initialWidth' => '250', 55 'initialHeight' => '250', 56 'imageFadeDuration' => '400', 57 'captionAnimationDuration' => '400', 58 'caption' => array('a-title','img-alt','img-title','href'), 59 'url' => 'on', 60 'selector' => 'div.entry-content, div.gallery, div.entry, div.post, div#page, body', 61 'counterText' => __('Image {x} of {y}', 'wp-slimbox2'), 62 'closeKeys' => __('27,88,67', 'wp-slimbox2'), 63 'previousKeys' => __('37,80', 'wp-slimbox2'), 64 'nextKeys' => __('39,78', 'wp-slimbox2') 65 ); 66 } 67 return $options; 81 68 } 82 69 ?> -
wp-slimbox2/trunk/javascript/slimbox2_autoload.js
r236404 r425147 1 jQuery(document).ready(function(b){if(slimbox2_options.mobile||!/android|iphone|ipod|series60|symbian|windows ce|blackberry/i.test(navigator.userAgent)){slimbox_CSS();closeKeys=slimbox2_options.closeKeys.split(",");previousKeys=slimbox2_options.previousKeys.split(",");nextKeys=slimbox2_options.nextKeys.split(",");for(var a in closeKeys){closeKeys[a]=parseInt(closeKeys[a])}for(var a in previousKeys){previousKeys[a]=parseInt(previousKeys[a])}for(var a in nextKeys){nextKeys[a]=parseInt(nextKeys[a])}load_slimbox()}});function slimbox_CSS(){jQuery(function(a){a("#lbOverlay").css("background-color",slimbox2_options.overlayColor);a("#lbPrevLink").hover(function(){a(this).css("background-image","url("+slimbox2_options.prev+")")},function(){a(this).css("background-image","")});a("#lbNextLink").hover(function(){a(this).css("background-image","url("+slimbox2_options.next+")")},function(){a(this).css("background-image","")});a("#lbCloseLink").css("background-image","url("+slimbox2_options.close+")")})}function load_slimbox(){jQuery(function($){var options={loop:slimbox2_options.loop,overlayOpacity:slimbox2_options.overlayOpacity,overlayFadeDuration:parseInt(slimbox2_options.overlayFadeDuration),resizeDuration:parseInt(slimbox2_options.resizeDuration),resizeEasing:slimbox2_options.resizeEasing,initialWidth:parseInt(slimbox2_options.initialWidth),initialHeight:parseInt(slimbox2_options.initialHeight),imageFadeDuration:parseInt(slimbox2_options.imageFadeDuration),captionAnimationDuration:parseInt(slimbox2_options.captionAnimationDuration),counterText:slimbox2_options.counterText,closeKeys:closeKeys,previousKeys:previousKeys,nextKeys:nextKeys};if(slimbox2_options.autoload){$("a[href]").filter(function(){return/\.(jpeg|bmp|jpg|png|gif)(\?[\d\w=&]*)?$/i.test(this.href)}).unbind("click").slimbox(options,function(el){return[encodeURI(el.href),(slimbox2_options.url)?'<a href="'+encodeURI(el.href)+'">'+eval(slimbox2_options.caption)+"</a>":eval(slimbox2_options.caption)]},function(el){return(this==el)||($(this).closest(slimbox2_options.selector)[0]&&($(this).closest(slimbox2_options.selector)[0]==$(el).closest(slimbox2_options.selector)[0]))})}else{$("a[rel^='lightbox']").unbind("click").slimbox(options,function(el){return[encodeURI(el.href),(slimbox2_options.url)?'<a href="'+encodeURI(el.href)+'">'+eval(slimbox2_options.caption)+"</a>":eval(slimbox2_options.caption)]},function(el){return(this==el)||((this.rel.length>8)&&(this.rel==el.rel))})}if(slimbox2_options.picasaweb){$("a[href^='http://picasaweb.google.'] > img:first-child[src]").parent().unbind("click").slimbox(options,function(el){return[el.firstChild.src.replace(/\/s\d+(?:\-c)?\/([^\/]+)$/,"/s640/$2"),(el.title||el.firstChild.alt)+'<br /><a href="'+encodeURI(el.href)+'">Picasa Web Albums page</a>']})}if(slimbox2_options.flickr){$("a[href^='http://www.flickr.com/photos/'] > img:first-child[src]").parent().unbind("click").slimbox(options,function(el){return[el.firstChild.src.replace(/_[mts]\.(\w+)$/,".$1"),(el.title||el.firstChild.alt)+'<br /><a href="'+encodeURI(el.href)+'">Flickr page</a>']})}})}; 1 jQuery(document).ready(function($) { 2 if(slimbox2_options['mobile'] || !/android|iphone|ipod|series60|symbian|windows ce|blackberry/i.test(navigator.userAgent)){ 3 slimbox_CSS(); 4 closeKeys = slimbox2_options['closeKeys'].split(','); 5 previousKeys = slimbox2_options['previousKeys'].split(','); 6 nextKeys = slimbox2_options['nextKeys'].split(','); 7 for ( var i in closeKeys) closeKeys[i] = parseInt(closeKeys[i]); 8 for ( var i in previousKeys) previousKeys[i] = parseInt(previousKeys[i]); 9 for ( var i in nextKeys) nextKeys[i] = parseInt(nextKeys[i]); 10 load_slimbox(); 11 } 12 }); 13 function slimbox_CSS() {jQuery(function($) { 14 $("#lbOverlay").css("background-color",slimbox2_options['overlayColor']); 15 $("#lbPrevLink").hover( 16 function () { 17 $(this).css("background-image","url("+slimbox2_options["prev"]+")"); 18 }, 19 function () { 20 $(this).css("background-image",""); 21 } 22 ); 23 $("#lbNextLink").hover( 24 function () { 25 $(this).css("background-image","url("+slimbox2_options["next"]+")"); 26 }, 27 function () { 28 $(this).css("background-image",""); 29 } 30 ); 31 $("#lbCloseLink").css("background-image","url("+slimbox2_options["close"]+")"); 32 })}; 33 34 function load_slimbox() {jQuery(function($) { 35 var options = { 36 loop: slimbox2_options['loop'], 37 overlayOpacity: slimbox2_options['overlayOpacity'], 38 overlayFadeDuration: parseInt(slimbox2_options['overlayFadeDuration']), 39 resizeDuration: parseInt(slimbox2_options['resizeDuration']), 40 resizeEasing: slimbox2_options['resizeEasing'], 41 initialWidth: parseInt(slimbox2_options['initialWidth']), 42 initialHeight: parseInt(slimbox2_options['initialHeight']), 43 imageFadeDuration: parseInt(slimbox2_options['imageFadeDuration']), 44 captionAnimationDuration: parseInt(slimbox2_options['captionAnimationDuration']), 45 counterText: slimbox2_options['counterText'], 46 closeKeys: closeKeys, 47 previousKeys: previousKeys, 48 nextKeys: nextKeys 49 } 50 51 if(slimbox2_options['autoload']) { 52 var images = $("a[href]").not("[rel^='nolightbox']").filter(function() {return /\.(jpeg|bmp|jpg|png|gif)(\?[\d\w=&]*)?$/i.test(this.href);}); 53 if(slimbox2_options['picasaweb']) images = images.add($("a[href^='http://picasaweb.google.'] > img:first-child[src]").parent()); 54 if(slimbox2_options['flickr']) images = images.add($("a[href^='http://www.flickr.com/photos/'] > img:first-child[src]").parent()); 55 } else 56 var images = $("a[rel^='lightbox']"); 57 images.unbind("click").slimbox(options, function(el) { 58 if (el.href.match(/^http:\/\/picasaweb.google./)!=null) { 59 var href = el.firstChild.src.replace(/\/s\d+(?:\-c)?\/([^\/]+)$/, "/s640/$2"); 60 } else if (el.href.match(/^http:\/\/www.flickr.com\/photos\//)!=null) { 61 var href = el.firstChild.src.replace(/_[mts]\.(\w+)$/, ".$1"); 62 } else var href = el.href; 63 return parseForURL(href,eval(slimbox2_options['caption'])); 64 }, function(el) { 65 if(slimbox2_options['autoload']) return (this == el) || ($(this).closest(slimbox2_options['selector'])[0] && ($(this).closest(slimbox2_options['selector'])[0] == $(el).closest(slimbox2_options['selector'])[0])); 66 else return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel)); 67 }); 68 })}; 69 70 function parseForURL(uri, caption) { 71 t = caption.split('/*'); 72 href=uri; 73 if(t.length > 1) t = t[1].split('*/'); 74 if (t.length > 1) { 75 uri = t[0]; 76 caption = t[1] 77 if(uri.toLowerCase().match(/^javascript:/)!=null) uri = uri.substring(11,uri.length); 78 } 79 return [href, (slimbox2_options['url'])?'<a href="' + uri + '">'+caption+'</a>':caption]; 80 }; -
wp-slimbox2/trunk/readme.txt
r237876 r425147 4 4 Tags: slimbox, slimbox2, lightbox, jQuery, picture, photo, image, overlay, display, lightbox2 5 5 Requires at least: 2.8 6 Tested up to: 2.9.2 7 Stable Tag: 1.0.3.2 6 Stable Tag: 1.0.4 8 7 9 A WordPress implementation of the Slimbox2 javascript.8 An WordPress implementation of the Slimbox2 javascript. 10 9 11 10 == Description == … … 17 16 Support forums are generously hosted by Ryan Hellyer of PixoPoint, <a href="http://pixopoint.com/forum/index.php?board=6.0">here</a>. 18 17 19 Recent Changes in v1.0.3.2: 20 1. Fix for defaults in new installs. 21 22 Recent Changes in v1.0.3.1: 23 1. Forgot to commit one of the RTL specific changes. 24 25 Recent Changes in v1.0.3: 26 1. Updated to Version 2.0.4 of Slimbox. 27 2. Added encodeURI to autoload script to automatically fix URLs containing invalid characters. 28 3. All "fixed" CSS moved to static CSS files, addition of RTL specific CSS. 29 4. Addition of Belarusian/Беларускі Translation. 30 5. Addition of Chinese/中文 Translation. 31 6. Update of Spanish/Español and Dutch/Nederlandse Translations. 32 7. Update of German/Deutsch Translation. 33 8. Addition of Localization Tracking (see FAQ for details). 34 9. Minor fixes/tweaks. 35 18 Recent Changes in v1.0.4:<br /> 19 1. Several Minor Fixes to eliminate PHP notices.<br /><br /> 20 2. Removal of encodeURI to eliminate issues with images having spaces.<br /><br /> 21 3. Ability to use <code>rel="nolightbox"</code> to exclude an image.<br /><br /> 22 4. Ability to customize image link URLs by simply placing '/*DESIRED URL*/' in front of the caption.<br /><br /> 23 grouping of flickr, picasa and other images combined, autoload groups by selector, lightbox groups by rel. 24 removal of WPlize in favor of built in option arrays. 25 fix for settings initialization issues 36 26 37 27 == Installation == … … 39 29 After you've downloaded and extracted the files: 40 30 41 1. Upload the complete `WP-Slimbox2` folder to the `/wp-content/plugins/` directory 42 2. Activate the plugin through the 'Plugins' menu in WordPress 43 3. Visit the "WP-Slimbox2" page in your WordPress options menu to configure any advanced settings. 44 5. Manually add the <code>rel="lightbox"</code> attribute to any link tag to activate the lightbox or <code>rel="lightbox-imagesetname"</code> for an image set, using the title attribute to store a caption. Alternatively you may use the autoload option to automatically prepare links to images and additionally enable picasaweb and flickr integration to easily utilize their albums. 31 1. Upload the complete `WP-Slimbox2` folder to the `/wp-content/plugins/` directory<br /> 32 2. Activate the plugin through the 'Plugins' menu in WordPress<br /> 33 3. Visit the "WP-Slimbox2" page in your WordPress options menu to configure any advanced settings.<br /> 34 5. Manually add the <code>rel="lightbox"</code> attribute to any link tag to activate the lightbox or <code>rel="lightbox-imagesetname"</code> for an image set, using the title attribute to store a caption. Alternatively you may use the autoload option to automatically prepare links to images and additionally enable picasaweb and flickr integration to easily utilize their albums.<br /> 45 35 46 36 == Frequently Asked Questions == 47 37 38 = Does Slimbox2 support the resizing of images? = 39 40 No. As stated in the script creator's FAQ, Slimbox was designed to display images only, resizing images is the user's responsibility.. <br /> 41 48 42 = Does Slimbox2 support the lightbox effect on pages and videos? = 49 43 50 No. As stated in the script creator s FAQ, Slimbox was designed to display images only, to be simple and to have the smallest code.44 No. As stated in the script creator's FAQ, Slimbox was designed to display images only, to be simple and to have the smallest code. <br /> 51 45 52 46 = What kind of grouping does autoload utilize? = … … 55 49 = Why do I need WordPress 2.8+? = 56 50 57 The Javascript requires jQuery 1.3+ which wasn't included in WordPress until 2.8. If you're using something to override the included jQuery with a newer version (a feature I may add at a later date) it should be compatible from 2.1+ since I believe that was when wp_enqueue_script() was implemented. 51 The Javascript requires jQuery 1.3+ which wasn't included in WordPress until 2.8. If you're using something to override the included jQuery with a newer version (a feature I may add at a later date) it should be compatible from 2.1+ since I believe that was when wp_enqueue_script() was implemented.<br /> 58 52 59 53 = Why can't the plugin do X, Y or Z? = 60 54 61 Either the Javascript doesn't support it, or I haven't gotten around to adding it. 55 Either the Javascript doesn't support it, or I haven't gotten around to adding it.<br /> 62 56 63 57 = Why isn't the plugin in my language? Could I contribute a translation? = 64 58 65 I only know English, but as of v.0.9.4 the plugin supports localization using PO and MO files, just like WordPress. 66 A copy of the POT file to use in your translations can be found in the languages directory as wp-slimbox2.pot. 67 If you're willing to provide a translation I'd be more than happy to include it. The NEXT, PREV, and Close buttons can be translated as well. 68 If you've translated the plugin or would like to find out more please let me know by posting on our <a href="http://pixopoint.com/forum/index.php?topic=1383.0">support forums</a>. 59 I only know English, but as of v.0.9.4 the plugin supports localization using PO and MO files, just like WordPress.<br /> 60 A copy of the POT file to use in your translations can be found in the languages directory as wp-slimbox2.pot.<br /> 61 If you're willing to provide a translation I'd be more than happy to include it. The NEXT, PREV, and Close buttons can be translated as well.<br /> 62 If you've translated the plugin or would like to find out more please let me know by posting on our <a href="http://pixopoint.com/forum/index.php?topic=1383.0">support forums</a>.<br /> 69 63 70 64 = Why should I use this plugin? = 71 65 72 You want Lightbox or Slimbox effects using the jQuery library, and don't want any sort of "ad". 73 You want complete control over all the javascript settings from the admin page. 66 You want Lightbox or Slimbox effects using the jQuery library, and don't want any sort of "ad".<br /> 67 You want complete control over all the javascript settings from the admin page.<br /> 74 68 75 69 = What is Localization Tracking? = 76 70 77 To satisfy my own curiosity regarding how many people are using a non-English version of the plugin I've written a small script, statTrack.php. During activiation of the plugin it submits the localization of the WordPress install to my server for recording. It will only do this once, and no other information is transmitted. To disable it, you can safely delete statTrack.php and the plugin should function normally. 71 To satisfy my own curiosity regarding how many people are using a non-English version of the plugin I've written a small script, statTrack.php. During activiation of the plugin it submits the localization of the WordPress install to my server for recording. It will only do this once, and no other information is transmitted. To disable it, you can safely delete statTrack.php and the plugin should function normally.<br /> 78 72 79 73 = What if I have other questions that haven't been answered? = 80 74 81 Please try our <a href="http://pixopoint.com/forum/index.php?board=6.0">support forums</a>, and read the Slimbox creators <a href="http://code.google.com/p/slimbox/wiki/FAQ">FAQ</a>. 75 Please try our <a href="http://pixopoint.com/forum/index.php?board=6.0">support forums</a>, and read the Slimbox creators <a href="http://code.google.com/p/slimbox/wiki/FAQ">FAQ</a>.<br /> 82 76 83 77 == Screenshots == … … 86 80 2. Overlay effect. 87 81 88 == Changelog == 89 = Version 1.0.3.1 - May-04-2010 = 90 * Fix for defaults in new installs. 91 = Version 1.0.3.1 - May-03-2010 = 92 * Forgot to commit one of the RTL specific changes. 93 = Version 1.0.3 - May-02-2010 = 94 * Updated to Version 2.0.4 of Slimbox. 95 * Added encodeURI to autoload script to automatically fix URLs containing invalid characters. 96 * All "fixed" CSS moved to static CSS files, addition of RTL specific CSS. 97 * Addition of Belarusian/Беларускі Translation. 98 * Addition of Chinese/中文 Translation. 99 * Update of Spanish/Español and Dutch/Nederlandse Translations. 100 * Update of German/Deutsch Translation. 101 * Addition of Localization Tracking (see FAQ for details). 102 * Minor fixes/tweaks. 103 = Version 1.0.2 - Jan-21-2010 = 104 * Fixed IE Javascript issue. 105 * Fixed potential XSS vulnerability and rare inability to update. 106 * Addition of Turkish/Türkçe Translation. 107 * Update of French/Français Translation. 108 = Version 1.0.1 - Jan-20-2010 = 109 * To accomodate some installs the global options variable was removed. 110 * To repair a small issue regarding selectors, .closest was used instead of .parents, bumping the jQuery requirement to 1.3, in turn bumping the WP requirement to 2.8. (If you insist on using an older version of WP, you can either manually upgrade jQuery, or switch back to using .parents, and specifically choose the selector value you want to use). 111 = Version 1.0 Beta - Jan-19-2010 = 112 * Addition of options to select caption source, render the caption as a hyperlink to the image, control autoload grouping element, and disable the effect on mobile phones. 113 * Initialization is now encapsulated within a function (usable in Infinite Scroll plugin, etc) 114 * All Javascript is now static, no more dynamic files. 115 * All Javascript and CSS compressed using YUI Compressor. 116 = Version 0.9.7 Beta - Apr-21-2009 = 117 * Addition of farbtastic overlay color select. 118 * Automatic key code recognition. 119 * Addition of French/Français and Dutch/Nederlandse languages. 120 * Options transferred to WPlize class, less database calls. 121 * Flickr and Picasaweb images now properly load Slimbox settings. 122 * Minor typographical corrections. 123 = Version 0.9.6 Beta - Feb-19-2009 = 124 * Added rudimentary German/Deutsch translation - thanks Laws 125 * Tiling Next/Prev Links in Safari Fix - thanks monodistortion 126 * Switch from wp-blog-header to wp-load, may resolve issue on certain servers that fail to properly serve dynamic JS and CSS 127 = Version 0.9.5 Beta - Feb-01-2009 = 128 * Added minor IE6 fix to prevent tiling of next and previous images in a unique scenario. 129 * Español/Spanish language typo correction. 130 * Updated to Slimbox 2.02 (and adjusted version # accordingly, see Slimbox website for more details) 131 * Support for RTL languages added (proper image progression and button display) 132 * Caching/compression reenabled on javascript - cache for one year, or until version change which occurs on option update. 133 * Support options on autoloaded image files (ie .jpg?w=400 now is properly detected) 134 = Version 0.9.4.1 Beta - Jan-24-2009 = 135 * Removed caching of autload script, for real this time. 136 = Version 0.9.4 Beta - Jan-24-2009 = 137 * Localization support implemented. Currently only Español/Spanish provided. See FAQ to contribute other languages. Removed caching of autload script, at least for now. 138 = Version 0.9.3 Beta - Jan-14-2009 = 139 * Flickr and Picasaweb Integration, Slimbox 2.01, maintenance mode, autogrouping by post/page, compression and caching 140 = Version 0.9.2.3 Beta - Jan-08-2009 = 141 * Bug fix. Autoload wasn't loading options 142 = Version 0.9.2.2 Beta - Jan-07-2009 = 143 * Emergency Admin for minor overlay opacity setting error 144 = Version 0.9.2.1 Beta - Jan-07-2009 = 145 * Emergency JS Fix 146 = Version 0.9.2 Beta - Jan-07-2009 = 147 * Addition of option to change the overlay color 148 = Version 0.9.1 Beta - Jan-06-2009 = 149 * Addition of option to enable automatically applying to all image links (png,jpg,gif) 150 = Version 0.9 Beta - Jan-05-2008 = 151 * Intial release 82 == History == 83 Recent Changes in v1.0.4:<br /> 84 Several Minor Fixes to eliminate PHP notices.<br /> 85 Removal of encodeURI to eliminate issues with images having spaces.<br /> 86 Ability to use <code>rel="nolightbox"</code> to exclude an image.<br /> 87 Ability to customize image link URLs by simply placing '/*DESIRED URL*/' in front of the caption.<br /> 88 Version 1.0.3.2 - May-04-2010:<br /> 89 Fix for defaults in new installs.<br /> 90 Version 1.0.3.1 - May-03-2010:<br /> 91 Forgot to commit one of the RTL specific changes.<br /> 92 Version 1.0.3 - May-02-2010:<br /> 93 Updated to Version 2.0.4 of Slimbox.<br /> 94 Added encodeURI to autoload script to automatically fix URLs containing invalid characters.<br /> 95 All "fixed" CSS moved to static CSS files, addition of RTL specific CSS.<br /> 96 Addition of Belarusian/Беларускі Translation.<br /> 97 Addition of Chinese/中文 Translation.<br /> 98 Update of Spanish/Español and Dutch/Nederlandse Translations.<br /> 99 Update of German/Deutsch Translation.<br /> 100 Addition of Localization Tracking (see FAQ for details).<br /> 101 Minor fixes/tweaks.<br /><br /> 102 Version 1.0.2 - Jan-21-2010:<br /> 103 Fixed IE Javascript issue.<br /> 104 Fixed potential XSS vulnerability and rare inability to update.<br /> 105 Addition of Turkish/Türkçe Translation.<br /> 106 Update of French/Français Translation.<br /><br /> 107 Version 1.0.1 - Jan-20-2010:<br /> 108 To accomodate some installs the global options variable was removed.<br /> 109 To repair a small issue regarding selectors, .closest was used instead of .parents, bumping the jQuery requirement to 1.3, in turn bumping the WP requirement to 2.8. (If you insist on using an older version of WP, you can either manually upgrade jQuery, or switch back to using .parents, and specifically choose the selector value you want to use).<br /><br /> 110 Version 1.0 Beta - Jan-19-2010:<br /> 111 Addition of options to select caption source, render the caption as a hyperlink to the image, control autoload grouping element, and disable the effect on mobile phones.<br /> 112 Initialization is now encapsulated within a function (usable in Infinite Scroll plugin, etc)<br /> 113 All Javascript is now static, no more dynamic files.<br /> 114 All Javascript and CSS compressed using YUI Compressor.<br /><br /> 115 Version 0.9.7 Beta - Apr-21-2009:<br /> 116 Addition of farbtastic overlay color select.<br /> 117 Automatic key code recognition.<br /> 118 Addition of French/Français and Dutch/Nederlandse languages.<br /> 119 Options transferred to WPlize class, less database calls.<br /> 120 Flickr and Picasaweb images now properly load Slimbox settings.<br /> 121 Minor typographical corrections.<br /><br /> 122 Version 0.9.6 Beta - Feb-19-2009:<br /> 123 Added rudimentary German/Deutsch translation - thanks Laws<br /> 124 Tiling Next/Prev Links in Safari Fix - thanks monodistortion<br /> 125 Switch from wp-blog-header to wp-load, may resolve issue on certain servers that fail to properly serve dynamic JS and CSS<br /><br /> 126 Version 0.9.5 Beta - Feb-01-2009:<br /> 127 Added minor IE6 fix to prevent tiling of next and previous images in a unique scenario.<br /> 128 Español/Spanish language typo correction.<br /> 129 Updated to Slimbox 2.02 (and adjusted version # accordingly, see Slimbox website for more details)<br /> 130 Support for RTL languages added (proper image progression and button display)<br /> 131 Caching/compression reenabled on javascript - cache for one year, or until version change which occurs on option update.<br /> 132 Support options on autoloaded image files (ie .jpg?w=400 now is properly detected)<br /><br /> 133 Version 0.9.4.1 Beta: Removed caching of autload script, for real this time. - v0.9.4.1 - Jan-24-2009<br /><br /> 134 Version 0.9.4 Beta: Localization support implemented. Currently only Español/Spanish provided. See FAQ to contribute other languages. Removed caching of autload script, at least for now. - v0.9.4 - Jan-24-2009<br /><br /> 135 Version 0.9.3 Beta: Flickr and Picasaweb Integration, Slimbox 2.01, maintenance mode, autogrouping by post/page, compression and caching - Jan-14-2009<br /><br /> 136 Version 0.9.2.3 Beta: Bug fix. Autoload wasn't loading options. - v0.9.2.3 - Jan-08-2009<br /><br /> 137 Version 0.9.2.2 Beta: Emergency Admin for minor overlay opacity setting error - Jan-07-2009<br /><br /> 138 Version 0.9.2.1 Beta: Emergency JS Fix - Jan-07-2009<br /><br /> 139 Version 0.9.2 Beta: Addition of option to change the overlay color - Jan-07-2009<br /><br /> 140 Version 0.9.1 Beta: Addition of option to enable automatically applying to all image links (png,jpg,gif) - Jan-06-2009<br /><br /> 141 Version 0.9 Beta: Intial release - Jan-05-2008<br /><br /> 152 142 153 143 = Credits = 154 144 155 Thanks to the following for help with the development of this plugin: 145 Thanks to the following for help with the development of this plugin:<br /> 156 146 157 * <a href="http://www.digitalia.be/software/slimbox2">Christophe Beyls</a> - Creator of the Slimbox2 Javascript 158 * <a href="http://gsgd.co.uk/sandbox/jquery/easing/">George McGinley Smith</a> - Creator of the jQuery Easing Plugin Javascript 159 * <a href="http://acko.net/dev/farbtastic/">Steven Wittens</a> - Creator of the jQuery Farbtastic colorpicker Javascript 160 * <a href="http://pixopoint.com">Ryan Hellyer</a> - For spurring my interest in WordPress plugins by welcoming my assistance on his <a href="http://pixopoint.com/multi-level-navigation/">Multi-level Navigation plugin</a> and for hosting our <a href="http://pixopoint.com/forum/index.php?board=6.0">support forums</a>. 161 * Spi for code suggestion to autogroup items by post. 162 * <a href="http://nv1962.net/">nv1962</a> - Suggestion to implement localization and Spanish/Español and Dutch/Nederlandse translations. 163 * Laws for German/Deutsch localization. 164 * monodistortion for CSS tweaks to prevent tiling of images. 147 * <a href="http://www.digitalia.be/software/slimbox2">Christophe Beyls</a> - Creator of the Slimbox2 Javascript<br /> 148 * <a href="http://gsgd.co.uk/sandbox/jquery/easing/">George McGinley Smith</a> - Creator of the jQuery Easing Plugin Javascript<br /> 149 * <a href="http://acko.net/dev/farbtastic/">Steven Wittens</a> - Creator of the jQuery Farbtastic colorpicker Javascript<br /> 150 * <a href="http://pixopoint.com">Ryan Hellyer</a> - For spurring my interest in WordPress plugins by welcoming my assistance on his <a href="http://pixopoint.com/multi-level-navigation/">Multi-level Navigation plugin</a> and for hosting our <a href="http://pixopoint.com/forum/index.php?board=6.0">support forums</a>.<br /> 151 * Spi for code suggestion to autogroup items by post.<br /> 152 * <a href="http://nv1962.net/">nv1962</a> - Suggestion to implement localization and Spanish/Español and Dutch/Nederlandse translations.<br /> 153 * Laws for German/Deutsch localization.<br /> 154 * monodistortion for CSS tweaks to prevent tiling of images.<br /> 165 155 * Jandry for the French/Français translation. 166 156 * <a href="http://www.serhatyolacan.com">Serhat Yolaçan</a> for the Turkish/Türkçe translation. 167 157 * <a href="http://pc.de">Marcis G.</a> for the Belarusian/Беларускі translation. 168 158 * <a href="http://www.easespot.com">easespot</a> for the Chinese/中文 translation and FunDo for additional assistance. 169 * Anyone else I forgot to mention who's made a suggestion or provided me with ideas. 159 * Anyone else I forgot to mention who's made a suggestion or provided me with ideas.<br /> -
wp-slimbox2/trunk/src/slimbox2_autoload.js
r236404 r425147 36 36 jQuery(function($) { 37 37 var options = { 38 loop: slimbox2_options['loop'], 39 overlayOpacity: slimbox2_options['overlayOpacity'], 40 overlayFadeDuration: parseInt(slimbox2_options['overlayFadeDuration']), 41 resizeDuration: parseInt(slimbox2_options['resizeDuration']), 42 resizeEasing: slimbox2_options['resizeEasing'], 43 initialWidth: parseInt(slimbox2_options['initialWidth']), 44 initialHeight: parseInt(slimbox2_options['initialHeight']), 45 imageFadeDuration: parseInt(slimbox2_options['imageFadeDuration']), 46 captionAnimationDuration: parseInt(slimbox2_options['captionAnimationDuration']), 47 counterText: slimbox2_options['counterText'], 48 closeKeys: closeKeys, 49 previousKeys: previousKeys, 50 nextKeys: nextKeys 51 } 38 loop: slimbox2_options['loop'], 39 overlayOpacity: slimbox2_options['overlayOpacity'], 40 overlayFadeDuration: parseInt(slimbox2_options['overlayFadeDuration']), 41 resizeDuration: parseInt(slimbox2_options['resizeDuration']), 42 resizeEasing: slimbox2_options['resizeEasing'], 43 initialWidth: parseInt(slimbox2_options['initialWidth']), 44 initialHeight: parseInt(slimbox2_options['initialHeight']), 45 imageFadeDuration: parseInt(slimbox2_options['imageFadeDuration']), 46 captionAnimationDuration: parseInt(slimbox2_options['captionAnimationDuration']), 47 counterText: slimbox2_options['counterText'], 48 closeKeys: closeKeys, 49 previousKeys: previousKeys, 50 nextKeys: nextKeys 51 } 52 var uri = encodeURI(el.href); 53 var caption = eval(slimbox2_options['caption']); 54 t = caption.split('/*'); 55 if(t.length > 1) t = t.split('*/'); 56 if (t.length > 1) { 57 URI = test2[0]; 58 caption = test2[1] 59 } 52 60 if(slimbox2_options['autoload']) { 53 $("a[href]"). filter(function() {61 $("a[href]").not("[rel^='nolightbox']").filter(function() { 54 62 return /\.(jpeg|bmp|jpg|png|gif)(\?[\d\w=&]*)?$/i.test(this.href); 55 63 }).unbind("click").slimbox(options, function(el) { 56 return [encodeURI(el.href), (slimbox2_options['url'])?'<a href="' + encodeURI(el.href) + '">'+eval(slimbox2_options['caption'])+'</a>':eval(slimbox2_options['caption'])];64 return [encodeURI(el.href), (slimbox2_options['url'])?'<a href="' + uri + '">'+caption+'</a>':eval(slimbox2_options['caption'])]; 57 65 }, function(el) { 58 66 return (this == el) || ($(this).closest(slimbox2_options['selector'])[0] && ($(this).closest(slimbox2_options['selector'])[0] == $(el).closest(slimbox2_options['selector'])[0])); 59 67 }); 60 68 } else { 61 $("a[rel^='lightbox']"). unbind("click").slimbox(options, function(el) {62 return [encodeURI(el.href), (slimbox2_options['url'])?'<a href="' + encodeURI(el.href) + '">'+eval(slimbox2_options['caption'])+'</a>':eval(slimbox2_options['caption'])];69 $("a[rel^='lightbox']").not("[rel^='nolightbox']").unbind("click").slimbox(options, function(el) { 70 return [encodeURI(el.href), (slimbox2_options['url'])?'<a href="' + uri + '">'+caption+'</a>':eval(slimbox2_options['caption'])]; 63 71 }, function(el) { 64 72 return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel)); -
wp-slimbox2/trunk/statTrack.php
r237598 r425147 1 1 <?php 2 function statTrack() { 3 $options = new WPlize('wp_slimbox'); 4 if( $options->get_option('lang_track') != 'true') {2 //error_reporting(0); 3 function statTrack(&$options) { 4 if(!isset($options['lang_track']) OR $options['lang_track']=='false') { 5 5 $data = array( 6 6 'table' => 'wp_slimbox2', … … 12 12 $data 13 13 ); 14 14 15 if(strpos($content, 'true')=== false) $content = 'false'; 15 16 else $content = 'true'; 16 $options->update_option(array(17 'lang_track' => $content18 ));19 17 18 $options['lang_track'] = $content; 20 19 } 21 20 } … … 43 42 // open a socket connection on port 80 44 43 $fp = fsockopen($host, 80); 45 46 // send the request headers: 47 fputs($fp, "POST $path HTTP/1.1\r\n"); 48 fputs($fp, "Host: $host\r\n"); 49 fputs($fp, "Referer: $referer\r\n"); 50 fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n"); 51 fputs($fp, "Content-length: ". strlen($data) ."\r\n"); 52 fputs($fp, "Connection: close\r\n\r\n"); 53 fputs($fp, $data); 54 55 $result = ''; 56 while(!feof($fp)) { 57 // receive the results of the request 58 $result .= fgets($fp, 128); 59 } 60 61 // close the socket connection: 62 fclose($fp); 63 64 // split the result header from the content 65 $result = explode("\r\n\r\n", $result, 2); 44 if ($fp) { 45 // send the request headers: 46 fputs($fp, "POST $path HTTP/1.1\r\n"); 47 fputs($fp, "Host: $host\r\n"); 48 fputs($fp, "Referer: $referer\r\n"); 49 fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n"); 50 fputs($fp, "Content-length: ". strlen($data) ."\r\n"); 51 fputs($fp, "Connection: close\r\n\r\n"); 52 fputs($fp, $data); 53 54 $result = ''; 55 while(!feof($fp)) { 56 // receive the results of the request 57 $result .= fgets($fp, 128); 58 } 59 60 // close the socket connection: 61 fclose($fp); 62 63 // split the result header from the content 64 $result = explode("\r\n\r\n", $result, 2); 65 } 66 66 67 67 $header = isset($result[0]) ? $result[0] : '';
Note: See TracChangeset
for help on using the changeset viewer.