Plugin Directory

Changeset 425147


Ignore:
Timestamp:
08/18/2011 01:26:59 AM (14 years ago)
Author:
malcalevak
Message:

Beta Version 1.0.4
Removal of WPlize, adoption of standard WordPress array variables.
Several fixes to prevent PHP error/warning notices.
Removal of encodeURI from JS.
Addition of 'rel="nolightbox"' to exclude an image.
Custom links in front of captions.
Combined grouping (Picasa, Flickr, lightbox, etc)
Initialization fix.
Addition of Brazilian Portuguese

Location:
wp-slimbox2/trunk
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • wp-slimbox2/trunk/adminpage.php

    r196034 r425147  
    11<?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 <?php
    11     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    
    432    function selectionGen(&$option,&$array) {
    443        foreach($array as $key=> $ms) {
     
    476        }
    487    }
     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');
    4919?>
    5020    <div style="clear:both;padding-top:5px;"></div>
     
    6939                <td class='name'><?php _e('Autoload?', 'wp-slimbox2'); ?></td>
    7040                <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"';?> />
    7242                </th>
    7343                <td class='desc'>
     
    7949                <td class='name'><?php _e('Enable Picasaweb Integration?', 'wp-slimbox2'); ?></td>
    8050                <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"';?> />
    8252                </th>
    8353                <td class='desc'>
     
    8959                <td class='name'><?php _e('Enable Flickr Integration?', 'wp-slimbox2'); ?></td>
    9060                <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"';?> />
    9262                </th>
    9363                <td class='desc'>
     
    9969                <td class='name'><?php _e('Loop?', 'wp-slimbox2'); ?></td>
    10070                <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"';?> />
    10272                </th>
    10373                <td class='desc'>
     
    10979                <td class='name'><?php _e('Overlay Opacity', 'wp-slimbox2'); ?></td>
    11080                <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); ?>
    11383                    </select>
    11484                </th>
     
    12191                <td class='name'><?php _e('Overlay Color', 'wp-slimbox2'); ?></td>
    12292                <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>
    12494
    12595                </th>
     
    132102                <td class='name'><?php _e('Overlay Fade Duration', 'wp-slimbox2'); ?></td>
    133103                <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); ?>
    136106                    </select>
    137107                </th>
     
    144114                <td class='name'><?php _e('Resize Duration', 'wp-slimbox2'); ?></td>
    145115                <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); ?>
    148118                    </select>
    149119                </th>
     
    156126                <td class='name'><?php _e('Resize Easing', 'wp-slimbox2'); ?></td>
    157127                <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); ?>
    160130                    </select>
    161131                </th>
     
    168138                <td class='name'><?php _e('Initial Width', 'wp-slimbox2'); ?></td>
    169139                <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']; ?>" />
    171141                </th>
    172142                <td class='desc'>
     
    178148                <td class='name'><?php _e('Initial Height', 'wp-slimbox2'); ?></td>
    179149                <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']; ?>" />
    181151                </th>
    182152                <td class='desc'>
     
    187157                <td class='name'><?php _e('Image Fade Duration', 'wp-slimbox2'); ?></td>
    188158                <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); ?>
    191161                    </select>
    192162                </th>
     
    199169                <td class='name'><?php _e('Caption Animation Duration', 'wp-slimbox2'); ?></td>
    200170                <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); ?>
    203173                    </select>
    204174                </th>
     
    210180                <td class='name'><?php _e('Image Caption Source Order', 'wp-slimbox2'); ?></td>
    211181                <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); ?>
    223193                    </select>
    224194                </th>
     
    231201                <td class='name'><?php _e('Caption is URL', 'wp-slimbox2'); ?></td>
    232202                <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"';?> />
    234204                </th>
    235205                <td class='desc'>
     
    240210                <td class='name'><?php _e('Autoload Selector', 'wp-slimbox2'); ?></td>
    241211                <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']; ?>" />
    243213                </th>
    244214                <td class='desc'>
     
    250220                <td class='name'><?php _e('Counter Text', 'wp-slimbox2'); ?></td>
    251221                <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']; ?>" />
    253223                </th>
    254224                <td class='desc'>
     
    259229                <td class='name'><?php _e('Close Keys', 'wp-slimbox2'); ?></td>
    260230                <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']; ?>"/>
    262232                </th>
    263233                <td class='desc' rowspan=3>
     
    269239                <td class='name'><?php _e('Previous Keys', 'wp-slimbox2'); ?></td>
    270240                <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']; ?>"/>
    272242                </th>
    273243            </tr>
     
    275245                <td class='name'><?php _e('Next Keys', 'wp-slimbox2'); ?></td>
    276246                <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']; ?>"/>
    278248                </th>
    279249            </tr>
     
    281251                <td class='name'><?php _e('Enable on mobiles?', 'wp-slimbox2'); ?></td>
    282252                <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"';?> />
    284254                </th>
    285255                <td class='desc'>
     
    290260                <td class='name'><?php _e('Maintenance mode', 'wp-slimbox2'); ?></td>
    291261                <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"';?> />
    293263                </th>
    294264                <td class='desc'>
     
    296266                    </p>
    297267            </tr>
    298             <input type="hidden" name="wp_slimbox_cache" value="<?php echo time(); ?>" />
    299268        </tbody>
    300269        </table>
    301         <input type="hidden" name="action" value="update" />
    302270        <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>
    304274        <div style="clear:both;padding-top:20px;"></div>
    305275    </form>
  • wp-slimbox2/trunk/index.php

    r237599 r425147  
    33Plugin Name: WP-Slimbox2
    44Plugin 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+
     5Description: A Wordpress implementation of the Slimbox2 javascript, utilizing jQuery, originally written by Christophe Beyls. Requires WP 2.8+
    66Author: Greg Yingling (malcalevak)
    7 Version: 1.0.3.2
     7Version: 1.0.4b
    88Author URI: http://transientmonkey.com/
    99
     
    2424*/
    2525
    26 if ( !class_exists('WPlize') ) {
    27     require_once('WPlize/WPlize.php');
     26load_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
     30add_action('wp_print_scripts', 'wp_slimbox_scripts');
     31add_action('wp_print_styles', 'wp_slimbox_styles');
     32
     33function wp_slimbox_initialize() {
     34    require('initialize.php');
     35    return wp_slimbox_initialize_variables();
    2836}
    2937
    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 
    4638function wp_slimbox_styles() {
    47     $options = new WPlize('wp_slimbox');
    4839    wp_register_style('slimbox2', WP_PLUGIN_URL.'/wp-slimbox2/slimbox2.css','','1.1','screen');
    4940    wp_enqueue_style('slimbox2');
     
    5344    }
    5445    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 save
     46    wp_register_script('slimbox2_autoload', WP_PLUGIN_URL.'/wp-slimbox2/javascript/slimbox2_autoload.js',array('slimbox2'),'1.0.4b');
    5647    wp_register_script('jquery_easing', WP_PLUGIN_URL.'/wp-slimbox2/javascript/jquery.easing.1.3.js',array('jquery'), '1.3');
    5748}
     49
    5850function wp_slimbox_scripts() {
    59     $options = new WPlize('wp_slimbox');
    6051    if (!is_admin())
    6152    {
    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;
    6558        }
    66         if($options->get_option('resizeEasing') != 'swing') wp_enqueue_script('jquery_easing');
     59        if($options['resizeEasing'] != 'swing') wp_enqueue_script('jquery_easing');
    6760        wp_enqueue_script('slimbox2_autoload');
    68         $captions = $options->get_option('caption');
     61        $captions = $options['caption'];
    6962        $caption = '';
    7063        for ($i = 0; $i<4; $i++) {
     
    8982        $caption .= 'el.href';
    9083        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'],
    10295            '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'],
    109102            'prev' => WP_PLUGIN_URL.'/wp-slimbox2/images/'.__('default/prevlabel.gif', 'wp-slimbox2'),
    110103            'next' => WP_PLUGIN_URL.'/wp-slimbox2/images/'.__('default/nextlabel.gif', 'wp-slimbox2'),
    111104            '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)
    115108        ));
    116109    }
     
    121114
    122115function 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');
    124117    add_action( "admin_print_scripts-$page", 'slimbox_adminhead' );
    125118    add_action( "admin_print_styles-$page", 'slimbox_admin_styles' );
     
    127120
    128121function slimbox_options() {
    129     $options = new WPlize('wp_slimbox');
    130122    require('adminpage.php');
    131123}
     
    136128    wp_register_script('load_farbtastic', WP_PLUGIN_URL.'/wp-slimbox2/javascript/farbtastic/load_farbtastic.js',array('jquery_farbtastic'), '1.0');
    137129    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');
    138131}
    139132
     
    146139    wp_enqueue_script('load_keypress');
    147140}
     141
     142function 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
    148178?>
  • wp-slimbox2/trunk/initialize.php

    r237598 r425147  
    11<?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     ));
     2function 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;
    8168}
    8269?>
  • 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>']})}})};
     1jQuery(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});
     13function 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
     34function 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
     70function 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  
    44Tags: slimbox, slimbox2, lightbox, jQuery, picture, photo, image, overlay, display, lightbox2
    55Requires at least: 2.8
    6 Tested up to: 2.9.2
    7 Stable Tag: 1.0.3.2
     6Stable Tag: 1.0.4
    87
    9 A WordPress implementation of the Slimbox2 javascript.
     8An WordPress implementation of the Slimbox2 javascript.
    109
    1110== Description ==
     
    1716Support forums are generously hosted by Ryan Hellyer of PixoPoint, <a href="http://pixopoint.com/forum/index.php?board=6.0">here</a>.
    1817
    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/&#20013;&#25991; 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 
     18Recent Changes in v1.0.4:<br />
     191.  Several Minor Fixes to eliminate PHP notices.<br /><br />
     202.  Removal of encodeURI to eliminate issues with images having spaces.<br /><br />
     213.  Ability to use <code>rel="nolightbox"</code> to exclude an image.<br /><br />
     224.  Ability to customize image link URLs by simply placing '/*DESIRED URL*/' in front of the caption.<br /><br />
     23grouping of flickr, picasa and other images combined, autoload groups by selector, lightbox groups by rel.
     24removal of WPlize in favor of built in option arrays.
     25fix for settings initialization issues
    3626
    3727== Installation ==
     
    3929After you've downloaded and extracted the files:
    4030
    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.
     311. Upload the complete `WP-Slimbox2` folder to the `/wp-content/plugins/` directory<br />
     322. Activate the plugin through the 'Plugins' menu in WordPress<br />
     333. Visit the "WP-Slimbox2" page in your WordPress options menu to configure any advanced settings.<br />
     345. 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 />
    4535
    4636== Frequently Asked Questions ==
    4737
     38= Does Slimbox2 support the resizing of images? =
     39
     40No. As stated in the script creator's FAQ, Slimbox was designed to display images only, resizing images is the user's responsibility.. <br />
     41
    4842= Does Slimbox2 support the lightbox effect on pages and videos? =
    4943
    50 No. As stated in the script creators FAQ, Slimbox was designed to display images only, to be simple and to have the smallest code.
     44No. 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 />
    5145
    5246= What kind of grouping does autoload utilize? =
     
    5549= Why do I need WordPress 2.8+? =
    5650
    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.
     51The 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 />
    5852
    5953= Why can't the plugin do X, Y or Z? =
    6054
    61 Either the Javascript doesn't support it, or I haven't gotten around to adding it.
     55Either the Javascript doesn't support it, or I haven't gotten around to adding it.<br />
    6256
    6357= Why isn't the plugin in my language? Could I contribute a translation? =
    6458
    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>.
     59I only know English, but as of v.0.9.4 the plugin supports localization using PO and MO files, just like WordPress.<br />
     60A copy of the POT file to use in your translations can be found in the languages directory as wp-slimbox2.pot.<br />
     61If 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 />
     62If 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 />
    6963
    7064= Why should I use this plugin? =
    7165
    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.
     66You want Lightbox or Slimbox effects using the jQuery library, and don't want any sort of "ad".<br />
     67You want complete control over all the javascript settings from the admin page.<br />
    7468
    7569= What is Localization Tracking? =
    7670
    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.
     71To 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 />
    7872
    7973= What if I have other questions that haven't been answered? =
    8074
    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>.
     75Please 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 />
    8276
    8377== Screenshots ==
     
    86802. Overlay effect.
    8781
    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/&#1041;&#1077;&#1083;&#1072;&#1088;&#1091;&#1089;&#1082;&#1110; Translation.
    98     * Addition of Chinese/&#20013;&#25991; Translation.
    99     * Update of Spanish/Espa&#241;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&uuml;rk&ccedil;e Translation.
    107     * Update of French/Fran&ccedil;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&ccedil;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&#241;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&#241;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 ==
     83Recent 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 />
     88Version 1.0.3.2 - May-04-2010:<br />
     89    Fix for defaults in new installs.<br />
     90Version 1.0.3.1 - May-03-2010:<br />
     91    Forgot to commit one of the RTL specific changes.<br />
     92Version 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/&#1041;&#1077;&#1083;&#1072;&#1088;&#1091;&#1089;&#1082;&#1110; Translation.<br />
     97    Addition of Chinese/&#20013;&#25991; Translation.<br />
     98    Update of Spanish/Espa&#241;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 />
     102Version 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&uuml;rk&ccedil;e Translation.<br />
     106    Update of French/Fran&ccedil;ais Translation.<br /><br />
     107Version 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 />
     110Version 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 />
     115Version 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&ccedil;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 />
     122Version 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 />
     126Version 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&#241;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 />
     133Version 0.9.4.1 Beta: Removed caching of autload script, for real this time. - v0.9.4.1 - Jan-24-2009<br /><br />
     134Version 0.9.4 Beta: Localization support implemented. Currently only Espa&#241;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 />
     135Version 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 />
     136Version 0.9.2.3 Beta: Bug fix. Autoload wasn't loading options. - v0.9.2.3 - Jan-08-2009<br /><br />
     137Version 0.9.2.2 Beta: Emergency Admin for minor overlay opacity setting error - Jan-07-2009<br /><br />
     138Version 0.9.2.1 Beta: Emergency JS Fix - Jan-07-2009<br /><br />
     139Version 0.9.2 Beta: Addition of option to change the overlay color - Jan-07-2009<br /><br />
     140Version 0.9.1 Beta: Addition of option to enable automatically applying to all image links (png,jpg,gif) - Jan-06-2009<br /><br />
     141Version 0.9 Beta: Intial release - Jan-05-2008<br /><br />
    152142
    153143= Credits =
    154144
    155 Thanks to the following for help with the development of this plugin:
     145Thanks to the following for help with the development of this plugin:<br />
    156146
    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&#241;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&#241;ol and Dutch/Nederlandse translations.<br />
     153* Laws for German/Deutsch localization.<br />
     154* monodistortion  for CSS tweaks to prevent tiling of images.<br />
    165155* Jandry for the French/Fran&ccedil;ais translation.
    166156* <a href="http://www.serhatyolacan.com">Serhat Yola&ccedil;an</a> for the Turkish/T&uuml;rk&ccedil;e translation.
    167157* <a href="http://pc.de">Marcis G.</a> for the Belarusian/&#1041;&#1077;&#1083;&#1072;&#1088;&#1091;&#1089;&#1082;&#1110; translation.
    168158* <a href="http://www.easespot.com">easespot</a> for the Chinese/&#20013;&#25991; 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  
    3636    jQuery(function($) {
    3737        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        }
    5260        if(slimbox2_options['autoload']) {
    53             $("a[href]").filter(function() {
     61            $("a[href]").not("[rel^='nolightbox']").filter(function() {
    5462                    return /\.(jpeg|bmp|jpg|png|gif)(\?[\d\w=&]*)?$/i.test(this.href);
    5563                }).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'])];
    5765                    }, function(el) {
    5866                        return (this == el) || ($(this).closest(slimbox2_options['selector'])[0] && ($(this).closest(slimbox2_options['selector'])[0] == $(el).closest(slimbox2_options['selector'])[0]));
    5967                });
    6068        } 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'])];
    6371                    }, function(el) {
    6472                return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel));
  • wp-slimbox2/trunk/statTrack.php

    r237598 r425147  
    11<?php
    2 function statTrack() {
    3     $options = new WPlize('wp_slimbox');
    4     if($options->get_option('lang_track') != 'true') {
     2//error_reporting(0);
     3function statTrack(&$options) {
     4    if(!isset($options['lang_track']) OR $options['lang_track']=='false') {
    55        $data = array(
    66            'table' => 'wp_slimbox2',
     
    1212            $data
    1313        );
     14
    1415        if(strpos($content, 'true')=== false) $content = 'false';
    1516        else $content = 'true';
    16         $options->update_option(array(
    17             'lang_track' => $content
    18         ));
    1917
     18        $options['lang_track'] = $content;
    2019    }
    2120}
     
    4342    // open a socket connection on port 80
    4443    $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    }
    6666 
    6767    $header = isset($result[0]) ? $result[0] : '';
Note: See TracChangeset for help on using the changeset viewer.