Plugin Directory

Changeset 1007873


Ignore:
Timestamp:
10/15/2014 12:41:20 PM (11 years ago)
Author:
parelius
Message:

prettified code

Location:
ssp-director-tools/trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • ssp-director-tools/trunk/feed/feed.php

    r409240 r1007873  
    4141if(md5($decrypted_options) != $_GET['c']) die('Incorrect feed parameters.');
    4242
    43 $options = doubleExplode('&', '=', $decrypted_options);
    44 $feed = new PhotoFeed( $sspd_api_key, $sspd_api_path, $sspd_feed_preview, $sspd_feed_full);
     43$options    = doubleExplode('&', '=', $decrypted_options);
     44$feed       = new PhotoFeed( $sspd_api_key, $sspd_api_path, $sspd_feed_preview, $sspd_feed_full);
     45
    4546$feed->rss($options);
    4647
  • ssp-director-tools/trunk/feed/includes/Encryption.php

    r409240 r1007873  
    2828
    2929        if(!$value){return false;}
    30         $text = $value;
    31         $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
    32         $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
    33         $crypttext = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $this->skey, $text, MCRYPT_MODE_ECB, $iv);
     30       
     31        $text         = $value;
     32        $iv_size      = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
     33        $iv           = mcrypt_create_iv($iv_size, MCRYPT_RAND);
     34        $crypttext    = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $this->skey, $text, MCRYPT_MODE_ECB, $iv);
     35       
    3436        return trim($this->safe_b64encode($crypttext));
    3537    }
     
    3840
    3941        if(!$value){return false;}
    40         $crypttext = $this->safe_b64decode($value);
    41         $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
    42         $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
    43         $decrypttext = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $this->skey, $crypttext, MCRYPT_MODE_ECB, $iv);
     42       
     43        $crypttext    = $this->safe_b64decode($value);
     44        $iv_size      = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
     45        $iv           = mcrypt_create_iv($iv_size, MCRYPT_RAND);
     46        $decrypttext  = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $this->skey, $crypttext, MCRYPT_MODE_ECB, $iv);
     47       
    4448        return trim($decrypttext);
    4549    }
  • ssp-director-tools/trunk/feed/includes/PhotoFeed.php

    r409240 r1007873  
    6666            $bulk = $this->album->get($opts['model_id']);
    6767        }
    68         $title = $this->prep($bulk->name);
    69         $description = $this->prep($bulk->description);
    70         $created = date('r', (int) $bulk->created );
    71         $modified = date('r', (int) $bulk->modified );
    72         $protocol = $_SERVER['HTTPS'] != "" ? 'https://' : 'http://';
     68        $title        = $this->prep($bulk->name);
     69        $description  = $this->prep($bulk->description);
     70        $created      = date('r', (int) $bulk->created );
     71        $modified     = date('r', (int) $bulk->modified );
     72        $protocol     = $_SERVER['HTTPS'] != "" ? 'https://' : 'http://';
    7373
    7474        header('Content-type: application/rss+xml');
     
    9292               
    9393            $description = "<img src='".$content->preview->url."' /><p>". ( $content->caption ? $this->prep($content->caption) : $this->prep($content->iptc->caption) ) ."</p>";
    94             $url = $content->full->url;
    95             $filesize = $content->filesize;
    96             $guid = 'http://' . $this->api_path . '/content/' . $content->id;
     94            $url         = $content->full->url;
     95            $filesize    = $content->filesize;
     96            $guid        = 'http://' . $this->api_path . '/content/' . $content->id;
    9797               
    9898            printf("        <item>\n");
  • ssp-director-tools/trunk/feed/includes/config.php

    r409180 r1007873  
    66
    77$sspd_feed_preview = array(
    8     'name' => 'preview',
    9     'width' => 120,
    10     'height' => 120,
    11     'crop' => 1,
    12     'quality' => 75,
    13     'sharpening' => 1
     8    'name'         => 'preview',
     9    'width'        => 120,
     10    'height'       => 120,
     11    'crop'         => 1,
     12    'quality'      => 75,
     13    'sharpening'   => 1
    1414);
    1515
    1616$sspd_feed_full = array(
    17     'name' => 'full',
    18     'width' => 1920,
    19     'height' => 1920,
    20     'crop' => 0,
    21     'quality' => 90,
    22     'sharpening' => 1
     17    'name'         => 'full',
     18    'width'        => 1920,
     19    'height'       => 1920,
     20    'crop'         => 0,
     21    'quality'      => 90,
     22    'sharpening'   => 1
    2323);
    2424
  • ssp-director-tools/trunk/includes/Encryption.php

    r409240 r1007873  
    2828
    2929        if(!$value){return false;}
    30         $text = $value;
    31         $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
    32         $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
    33         $crypttext = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $this->skey, $text, MCRYPT_MODE_ECB, $iv);
     30       
     31        $text         = $value;
     32        $iv_size      = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
     33        $iv           = mcrypt_create_iv($iv_size, MCRYPT_RAND);
     34        $crypttext    = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $this->skey, $text, MCRYPT_MODE_ECB, $iv);
     35       
    3436        return trim($this->safe_b64encode($crypttext));
    3537    }
     
    3840
    3941        if(!$value){return false;}
    40         $crypttext = $this->safe_b64decode($value);
    41         $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
    42         $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
    43         $decrypttext = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $this->skey, $crypttext, MCRYPT_MODE_ECB, $iv);
     42       
     43        $crypttext    = $this->safe_b64decode($value);
     44        $iv_size      = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
     45        $iv           = mcrypt_create_iv($iv_size, MCRYPT_RAND);
     46        $decrypttext  = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $this->skey, $crypttext, MCRYPT_MODE_ECB, $iv);
     47       
    4448        return trim($decrypttext);
    4549    }
  • ssp-director-tools/trunk/includes/SSPDT.php

    r1004061 r1007873  
    3131
    3232        $grid = array(
    33              'name' => 'grid',
    34              'width' => $format_options['grid_width'],
    35              'height' => $format_options['grid_height'],
    36              'crop' => ($format_options['grid_crop'] == '1' ? 1 : 0),
    37              'quality' => $format_options['grid_quality'],
     33             'name'       => 'grid',
     34             'width'      => $format_options['grid_width'],
     35             'height'     => $format_options['grid_height'],
     36             'crop'       => ($format_options['grid_crop'] == '1' ? 1 : 0),
     37             'quality'    => $format_options['grid_quality'],
    3838             'sharpening' => ($format_options['grid_sharpen'] == '1' ? 1 : 0)
    3939        );
    4040
    4141        $thumb = array(
    42              'name' => 'thumb',
    43              'width' => $format_options['thumb_width'],
    44              'height' => $format_options['thumb_height'],
    45              'crop' => ($format_options['thumb_crop'] == '1' ? 1 : 0),
    46              'quality' => $format_options['thumb_quality'],
     42             'name'       => 'thumb',
     43             'width'      => $format_options['thumb_width'],
     44             'height'     => $format_options['thumb_height'],
     45             'crop'       => ($format_options['thumb_crop'] == '1' ? 1 : 0),
     46             'quality'    => $format_options['thumb_quality'],
    4747             'sharpening' => ($format_options['thumb_sharpen'] == '1' ? 1 : 0)
    4848        );
    4949
    5050        $large = array(
    51              'name' => 'large',
    52              'width' => $format_options['large_width'],
    53              'height' => $format_options['large_height'],
    54              'crop' => ($format_options['large_crop'] == '1' ? 1 : 0),
    55              'quality' => $format_options['large_quality'],
     51             'name'       => 'large',
     52             'width'      => $format_options['large_width'],
     53             'height'     => $format_options['large_height'],
     54             'crop'       => ($format_options['large_crop'] == '1' ? 1 : 0),
     55             'quality'    => $format_options['large_quality'],
    5656             'sharpening' => ($format_options['large_sharpen'] == '1' ? 1 : 0)
    5757        );
     
    8686
    8787        if($content_options['model'] == "gallery" || $content_options['model'] == "album") {
    88             $scope = array ($content_options['model'], (int) $content_options['model_id']);
    89             $options['scope'] = $scope;
    90             $params .= "&model=" . $content_options['model'];
    91             $params .= "&model_id=" . $content_options['model_id'];
     88            $scope               = array ($content_options['model'], (int) $content_options['model_id']);
     89            $options['scope']    = $scope;
     90            $params             .= "&model=" . $content_options['model'];
     91            $params             .= "&model_id=" . $content_options['model_id'];
    9292        }
    9393
    9494        if((int) $content_options['limit'] > 0) {
    95             $options['limit'] = $content_options['limit'];
    96             $params .= "&limit=" . $content_options['limit'];
     95            $options['limit']    = $content_options['limit'];
     96            $params             .= "&limit=" . $content_options['limit'];
    9797        }
    9898
    9999        if($content_options['tags'] != "") {
    100100            $options['tags'] = array($content_options['tags'], $content_options['tagmode']);
    101             $params .= "&tags=" . $content_options['tags'];
    102             $params .= "&tagmode=" . $content_options['tagmode'];
     101            $params         .= "&tags=" . $content_options['tags'];
     102            $params         .= "&tagmode=" . $content_options['tagmode'];
    103103        }
    104104
    105105        if($content_options['sort_on'] != "null") {
    106             $options['sort_on'] = $content_options['sort_on'];
    107             $options['sort_direction'] = $content_options['sort_direction'];
    108             $params .= "&sort_on=" . $content_options['sort_on'];
    109             $params .= "&sort_direction=" . $content_options['sort_direction'];
     106            $options['sort_on']          = $content_options['sort_on'];
     107            $options['sort_direction']   = $content_options['sort_direction'];
     108            $params                     .= "&sort_on=" . $content_options['sort_on'];
     109            $params                     .= "&sort_direction=" . $content_options['sort_direction'];
    110110        }
    111111
     
    120120        }
    121121
    122         $params = substr($params, 1);
     122        $params       = substr($params, 1);
    123123
    124124        $feed_options = get_option('sspdt_feed_options');
    125         $baseurl = $feed_options['feed_url'] . 'feed.php';
    126         $secret = $feed_options['secret'];
    127 
    128         $crypt = new Encryption($secret);
    129         $checksum = md5($params);
    130 
    131         $feedurl = $baseurl . '?p=' . $crypt->encode($params) . '&c=' . $checksum;
    132 
    133         $contents = $this->content->all($options);
    134 
    135         $out = ( "\n<div class='sspd_grid' style='display:block;margin-top:6px;'>\n" );
     125        $baseurl      = $feed_options['feed_url'] . 'feed.php';
     126        $secret       = $feed_options['secret'];
     127
     128        $crypt        = new Encryption($secret);
     129        $checksum     = md5($params);
     130
     131        $feedurl      = $baseurl . '?p=' . $crypt->encode($params) . '&c=' . $checksum;
     132
     133        $contents     = $this->content->all($options);
     134
     135        $out          = ( "\n<div class='sspd_grid' style='display:block;margin-top:6px;'>\n" );
    136136
    137137        foreach( $contents as $content ) {
    138             $width =  (int)$content->grid->width;
    139             $height = (int)$content->grid->height;
    140 
    141             $title = ($content->caption) ? $this->prep($content->caption) : $this->prep($content->iptc->caption);
    142             //$title = $this->get_meta($content);
    143             $alt = ($content->caption) ? $this->prep($content->caption) : $this->prep($content->iptc->caption);
    144             $out .= sprintf ("<a class='%s' rel='%s' href='%s' title='%s'>
    145     <img class='sspdt_grid' src='%s' alt='%s' width='%s' height='%s' type='image/jpeg'/>
     138       
     139            $width   = (int)$content->grid->width;
     140            $height  = (int)$content->grid->height;
     141            $title   = ($content->caption) ? $this->prep($content->caption) : $this->prep($content->iptc->caption);
     142            $alt     = ($content->caption) ? $this->prep($content->caption) : $this->prep($content->iptc->caption);
     143            $out    .= sprintf ("<a class='%s' rel='%s' href='%s' title='%s'>
     144    <img class = 'sspdt_grid' src='%s' alt='%s' width='%s' height='%s' type='image/jpeg'/>
    146145</a>\n", "sspdt-fancybox", $rel, $this->watermarked_url( $content, 'large' ), $title, $content->grid->url, $alt, $width, $height);
    147146           
    148             $out .= $this->meta_html($content, "large");
     147            $out    .= $this->meta_html($content, "large");
    149148
    150149            }
     
    172171    public function single($image, $align, $showcaption, $post_id) {
    173172
    174         $content = $this->content->get($image);
    175         $large = $this->watermarked_url( $content, 'large' );
    176         $thumb = $this->watermarked_url( $content, 'thumb' );
    177         $title = $content->caption ? $this->prep($content->caption) : "";
    178 
    179         $width = (int)$content->thumb->width;
    180         $height = (int)$content->thumb->height;
     173        $content      = $this->content->get($image);
     174        $large        = $this->watermarked_url( $content, 'large' );
     175        $thumb        = $this->watermarked_url( $content, 'thumb' );
     176        $title        = $content->caption ? $this->prep($content->caption) : "";
     177
     178        $width        = (int)$content->thumb->width;
     179        $height       = (int)$content->thumb->height;
    181180
    182181        $captionwidth = $width + 2 * 5;
    183182
    184         $rel = "post-" . $post_id;
    185         $alt = $content->caption ? $this->prep($content->caption) : "";
     183        $rel          = "post-" . $post_id;
     184        $alt          = $content->caption ? $this->prep($content->caption) : "";
    186185       
    187186        //debug_var($content->iptc);
     
    232231        }
    233232       
    234         $date_format = $this->format_options['date_format'];
     233        $date_format  = $this->format_options['date_format'];
    235234               
    236         $caption = ($content->caption) ? $this->prep($content->caption) : $this->prep($content->iptc->caption);
    237         $byline = $this->prep($content->iptc->byline);
    238         $date = date($date_format, $content->captured_on);
    239         $city = $this->prep($content->iptc->city);
    240         $country = $this->prep($content->iptc->country);
    241         $latitude =  $content->exif->latitude;
    242         $longitude =  $content->exif->longitude;
    243        
    244         $search = array("%caption%", "%byline%", "%date%", "%city%", "%country%");
    245         $replace = array($caption, $byline, $date, $city, $country);
    246        
    247         $html = "";
     235        $caption      = ($content->caption) ? $this->prep($content->caption) : $this->prep($content->iptc->caption);
     236        $byline       = $this->prep($content->iptc->byline);
     237        $date         = date($date_format, $content->captured_on);
     238        $city         = $this->prep($content->iptc->city);
     239        $country      = $this->prep($content->iptc->country);
     240        $latitude     = $content->exif->latitude;
     241        $longitude    = $content->exif->longitude;
     242       
     243        $search       = array("%caption%", "%byline%", "%date%", "%city%", "%country%");
     244        $replace      = array($caption, $byline, $date, $city, $country);
     245       
     246        $html         = "";
     247       
    248248        if($size == "large") {
    249249            $html .= "<div style='display:none;'>";
  • ssp-director-tools/trunk/includes/SSPDT_Widget.php

    r409240 r1007873  
    1313    function SSPDT_Widget() {
    1414        $widget_ops = array(
    15             'classname' => 'SSPDT_Widget',
    16             'description' => __('Displays a photogrid populated with SSP Director content.', 'sspdt')
     15            'classname'      => 'SSPDT_Widget',
     16            'description'    => __('Displays a photogrid populated with SSP Director content.', 'sspdt')
    1717        );
    1818        $control_ops = array (
    19             'width' => '300',
     19            'width'  => '300',
    2020            'height' => '200'
    2121            );
     
    3131    function form($instance) {
    3232        $defaults = array(
    33             'title' => __('Title', 'sspdt'),
    34             'model' => 'album',
    35             'model_id' => '0',
    36             'limit' => '8',
    37             'tags' => '',
    38             'tagmode' => 'all',
    39             'sort_on' => 'captured_on',
    40             'sort_direction' => 'DESC',
    41             'element' => 'h3'
     33            'title'            => __('Title', 'sspdt'),
     34            'model'            => 'album',
     35            'model_id'         => '0',
     36            'limit'            => '8',
     37            'tags'             => '',
     38            'tagmode'          => 'all',
     39            'sort_on'          => 'captured_on',
     40            'sort_direction'   => 'DESC',
     41            'element'          => 'h3'
    4242            );
    4343
    44             $instance = wp_parse_args( (array) $instance, $defaults );
    45             $title = $instance['title'];
    46             $model = $instance['model'];
    47             $model_id = $instance['model_id'];
    48             $limit = $instance['limit'];
    49             $tags = $instance['tags'];
    50             $tagmode = $instance['tagmode'];
    51             $sort_on = $instance['sort_on'];
    52             $sort_direction = $instance['sort_direction'];
    53             $element = $instance['element'];
     44            $instance          = wp_parse_args( (array) $instance, $defaults );
     45            $title             = $instance['title'];
     46            $model             = $instance['model'];
     47            $model_id          = $instance['model_id'];
     48            $limit             = $instance['limit'];
     49            $tags              = $instance['tags'];
     50            $tagmode           = $instance['tagmode'];
     51            $sort_on           = $instance['sort_on'];
     52            $sort_direction    = $instance['sort_direction'];
     53            $element           = $instance['element'];
    5454
    5555            ?>
     
    166166    function update($new_instance, $old_instance) {
    167167        $instance = $old_instance;
    168         $instance['title'] = strip_tags( $new_instance['title'] );
    169         $instance['model'] = strip_tags( $new_instance['model'] );
    170         $instance['model_id'] = strip_tags( $new_instance['model_id'] );
    171         $instance['limit'] = strip_tags( $new_instance['limit'] );
    172         $instance['tags'] = strip_tags( $new_instance['tags'] );
    173         $instance['tagmode'] = strip_tags( $new_instance['tagmode'] );
    174         $instance['sort_on'] = strip_tags( $new_instance['sort_on'] );
    175         $instance['sort_direction'] = strip_tags( $new_instance['sort_direction'] );
    176         $instance['element'] = strip_tags($new_instance['element'] );
     168        $instance['title']            = strip_tags( $new_instance['title'] );
     169        $instance['model']            = strip_tags( $new_instance['model'] );
     170        $instance['model_id']         = strip_tags( $new_instance['model_id'] );
     171        $instance['limit']            = strip_tags( $new_instance['limit'] );
     172        $instance['tags']             = strip_tags( $new_instance['tags'] );
     173        $instance['tagmode']          = strip_tags( $new_instance['tagmode'] );
     174        $instance['sort_on']          = strip_tags( $new_instance['sort_on'] );
     175        $instance['sort_direction']   = strip_tags( $new_instance['sort_direction'] );
     176        $instance['element']          = strip_tags( $new_instance['element'] );
    177177        return $instance;
    178178    }
     
    195195        }
    196196
    197         $title = apply_filters( 'widget_title', $instance['title'] );
    198         $elem = $instance['element'];
    199 
    200         $presentation_ops = get_option('sspdt_helpers');
    201         $presentation_helper = $presentation_ops['presentation_helper'];
    202         $helper = array('class' => $presentation_helper );
     197        $title                = apply_filters( 'widget_title', $instance['title'] );
     198        $elem                 = $instance['element'];
     199
     200        $presentation_ops     = get_option('sspdt_helpers');
     201        $presentation_helper  = $presentation_ops['presentation_helper'];
     202        $helper               = array('class' => $presentation_helper );
    203203
    204204        echo $before_widget;
  • ssp-director-tools/trunk/includes/api/cache/sspdt

    • Property svn:ignore
      •  

        old new  
        1717ee4423779cc7245868bd190da30882bd
        1818f5806743da0ce92abca69534426f9e79
         199771ccde9bb4d5b0575c411621ba9010
         20443863eb28b7098fa206f6bd85bf61b3
         2148179929176130ced94fa5b5c7cb0805
         22e3a3ab487cbb1f492ee10de55e5ddd4e
  • ssp-director-tools/trunk/includes/helpers.php

    r450207 r1007873  
    5252function sspdt_html_format($val) {
    5353    $allowed = array(
    54         "div" => array(
    55             "style" => array(),
    56             "align" => array()
     54        "div"     => array(
     55            "style"  => array(),
     56            "align"  => array()
    5757        ),
    58         "p" =>  array("style" => array()),
    59         "b" => array(),
    60         "i" => array(),
    61         "strong" => array(),
    62         "em" => array(),
    63         "br" =>array()
     58        "p"       => array("style" => array()),
     59        "b"       => array(),
     60        "i"       => array(),
     61        "strong"  => array(),
     62        "em"      => array(),
     63        "br"      => array()
    6464    );
    6565    return wp_kses($val, $allowed);
  • ssp-director-tools/trunk/includes/shortcodes.php

    r409240 r1007873  
    1111function sspdt_filter_content($atts) {
    1212    extract( shortcode_atts( array(
    13             'image' => '',
    14             'align' => '',
    15             'caption' => '',
    16             'gallery' => '',
    17             'album' => '',
    18             'limit' => '',
    19             'tags' => '',
    20             'tagmode' => '',
    21             'sort_on' => '',
     13            'image'          => '',
     14            'align'          => '',
     15            'caption'        => '',
     16            'gallery'        => '',
     17            'album'          => '',
     18            'limit'          => '',
     19            'tags'           => '',
     20            'tagmode'        => '',
     21            'sort_on'        => '',
    2222            'sort_direction' => '',
    23             'rss' => ''
     23            'rss'            => ''
    2424            ), $atts ) );
    2525
     
    3838                if($image == '') { //we make a photo grid with multiple images
    3939                       
    40                     $defaults = get_option('sspdt_defaults');
    41                     $options = array();
     40                    $defaults  = get_option('sspdt_defaults');
     41                    $options   = array();
    4242
    4343                    // Determine the scope of the request
     
    114114                } else { //we make a single image
    115115
    116                     $format_options = get_option('sspdt_format_options');
     116                    $format_options    = get_option('sspdt_format_options');
    117117
    118118                    // Get the plugin settings
    119                     $showcaption = isset($format_options['thumb_caption']) ? $format_options['thumb_caption'] : false;
    120                     $thumbalign = isset($format_options['thumb_align']) ? $format_options['thumb_align'] : 'alignnone';
     119                    $showcaption       = isset($format_options['thumb_caption']) ? $format_options['thumb_caption'] : false;
     120                    $thumbalign        = isset($format_options['thumb_align']) ? $format_options['thumb_align'] : 'alignnone';
    121121
    122122                    // Override alignment settings if align attribute provided
  • ssp-director-tools/trunk/includes/sspdt-options-page.php

    r1004061 r1007873  
    4545        update_option( 'sspdt_api_cache', $_POST['sspdt_api_cache'] );
    4646
    47         $format_options = array();
    48 
    49         $format_options['grid_width'] = sspdt_posint ( $_POST['grid_width'] );
    50         $format_options['grid_height'] = sspdt_posint ( $_POST['grid_height'] );
    51         $format_options['grid_crop'] = sspdt_bool( $_POST['grid_crop'] );
    52         $format_options['grid_quality'] = sspdt_posint ( $_POST['grid_quality'] );
    53         $format_options['grid_sharpen'] = sspdt_bool( $_POST['grid_sharpen'] );
    54 
    55         $format_options['thumb_width'] = sspdt_posint( $_POST['thumb_width'] );
    56         $format_options['thumb_height'] = sspdt_posint( $_POST['thumb_height'] );
    57         $format_options['thumb_crop'] = sspdt_bool( $_POST['thumb_crop'] );
    58         $format_options['thumb_quality'] = sspdt_posint( $_POST['thumb_quality'] );
    59         $format_options['thumb_sharpen'] = sspdt_bool( $_POST['thumb_sharpen'] );
    60         $format_options['thumb_align'] = sspdt_align( $_POST['thumb_align'] );
    61         $format_options['thumb_caption'] = sspdt_bool( $_POST['thumb_caption'] );
    62         $format_options['thumb_caption_format'] = htmlspecialchars( sspdt_html_format( $_POST['thumb_caption_format'] ), ENT_COMPAT, "UTF-8", false );
    63         $format_options['thumb_watermark'] = sspdt_bool( $_POST['thumb_watermark'] );
    64 
    65         $format_options['large_width'] = sspdt_posint( $_POST['large_width'] );
    66         $format_options['large_height'] = sspdt_posint( $_POST['large_height'] );
    67         $format_options['large_crop'] = sspdt_bool( $_POST['large_crop'] );
    68         $format_options['large_quality'] = sspdt_posint( $_POST['large_quality'] );
    69         $format_options['large_sharpen'] = sspdt_bool( $_POST['large_sharpen'] );
    70         $format_options['large_caption_format'] = htmlspecialchars( sspdt_html_format( $_POST['large_caption_format'] ), ENT_COMPAT, "UTF-8", false );
    71         $format_options['large_watermark'] = sspdt_bool( $_POST['large_watermark'] );
     47        $format_options                           = array();
     48
     49        $format_options['grid_width']             = sspdt_posint ( $_POST['grid_width'] );
     50        $format_options['grid_height']            = sspdt_posint ( $_POST['grid_height'] );
     51        $format_options['grid_crop']              = sspdt_bool( $_POST['grid_crop'] );
     52        $format_options['grid_quality']           = sspdt_posint ( $_POST['grid_quality'] );
     53        $format_options['grid_sharpen']           = sspdt_bool( $_POST['grid_sharpen'] );
     54
     55        $format_options['thumb_width']            = sspdt_posint( $_POST['thumb_width'] );
     56        $format_options['thumb_height']           = sspdt_posint( $_POST['thumb_height'] );
     57        $format_options['thumb_crop']             = sspdt_bool( $_POST['thumb_crop'] );
     58        $format_options['thumb_quality']          = sspdt_posint( $_POST['thumb_quality'] );
     59        $format_options['thumb_sharpen']          = sspdt_bool( $_POST['thumb_sharpen'] );
     60        $format_options['thumb_align']            = sspdt_align( $_POST['thumb_align'] );
     61        $format_options['thumb_caption']          = sspdt_bool( $_POST['thumb_caption'] );
     62        $format_options['thumb_caption_format']   = htmlspecialchars( sspdt_html_format( $_POST['thumb_caption_format'] ), ENT_COMPAT, "UTF-8", false );
     63        $format_options['thumb_watermark']        = sspdt_bool( $_POST['thumb_watermark'] );
     64
     65        $format_options['large_width']            = sspdt_posint( $_POST['large_width'] );
     66        $format_options['large_height']           = sspdt_posint( $_POST['large_height'] );
     67        $format_options['large_crop']             = sspdt_bool( $_POST['large_crop'] );
     68        $format_options['large_quality']          = sspdt_posint( $_POST['large_quality'] );
     69        $format_options['large_sharpen']          = sspdt_bool( $_POST['large_sharpen'] );
     70        $format_options['large_caption_format']   = htmlspecialchars( sspdt_html_format( $_POST['large_caption_format'] ), ENT_COMPAT, "UTF-8", false );
     71        $format_options['large_watermark']        = sspdt_bool( $_POST['large_watermark'] );
    7272       
    73         $format_options['date_format'] = sspdt_nohtml( $_POST['date_format'] );
     73        $format_options['date_format']            = sspdt_nohtml( $_POST['date_format'] );
    7474       
    7575        //var_dump($format_options);
     
    7777        $defaults = array();
    7878
    79         $defaults['model'] = sspdt_model( $_POST['model'] );
    80         $defaults['model_id'] = sspdt_posint( $_POST['model_id'] );
    81         $defaults['limit'] = sspdt_posint( $_POST['limit'] );
    82         $defaults['tags'] = sspdt_nohtml( $_POST['tags'] );
    83         $defaults['tagmode'] = sspdt_tagmode( $_POST['tagmode'] );
    84         $defaults['sort_on'] = sspdt_sort_on( $_POST['sort_on'] );
    85         $defaults['sort_direction'] = sspdt_sort_direction( $_POST['sort_direction'] );
    86         $defaults['rss'] = sspdt_bool( $_POST['rss'] );
     79        $defaults['model']            = sspdt_model( $_POST['model'] );
     80        $defaults['model_id']         = sspdt_posint( $_POST['model_id'] );
     81        $defaults['limit']            = sspdt_posint( $_POST['limit'] );
     82        $defaults['tags']             = sspdt_nohtml( $_POST['tags'] );
     83        $defaults['tagmode']          = sspdt_tagmode( $_POST['tagmode'] );
     84        $defaults['sort_on']          = sspdt_sort_on( $_POST['sort_on'] );
     85        $defaults['sort_direction']   = sspdt_sort_direction( $_POST['sort_direction'] );
     86        $defaults['rss']              = sspdt_bool( $_POST['rss'] );
    8787
    8888        $fb = array();
    8989
    90         $fb['padding'] = sspdt_posint( $_POST['padding'] );
    91         $fb['margin'] = sspdt_posint( $_POST['margin'] );
    92 
    93         $fb['titleShow'] = sspdt_bool( $_POST['titleShow'] );
    94         $fb['titlePosition'] = sspdt_fb_title_position( $_POST['titlePosition'] );
    95         $fb['counterShow'] = sspdt_bool( $_POST['counterShow'] );
    96 
    97         $fb['overlayShow'] = sspdt_bool( $_POST['overlayShow'] );
    98         $fb['overlayOpacity'] = sspdt_fb_opacity( $_POST['overlayOpacity'] );
    99         $fb['overlayColor'] = sspdt_color( $_POST['overlayColor'] );
    100 
    101         $fb['cyclic'] = sspdt_bool( $_POST['cyclic'] );
    102         $fb['showNavArrows'] = sspdt_bool( $_POST['showNavArrows'] );
    103         $fb['showCloseButton'] = sspdt_bool( $_POST['showCloseButton'] );
     90        $fb['padding']            = sspdt_posint( $_POST['padding'] );
     91        $fb['margin']             = sspdt_posint( $_POST['margin'] );
     92
     93        $fb['titleShow']          = sspdt_bool( $_POST['titleShow'] );
     94        $fb['titlePosition']      = sspdt_fb_title_position( $_POST['titlePosition'] );
     95        $fb['counterShow']        = sspdt_bool( $_POST['counterShow'] );
     96
     97        $fb['overlayShow']        = sspdt_bool( $_POST['overlayShow'] );
     98        $fb['overlayOpacity']     = sspdt_fb_opacity( $_POST['overlayOpacity'] );
     99        $fb['overlayColor']       = sspdt_color( $_POST['overlayColor'] );
     100
     101        $fb['cyclic']             = sspdt_bool( $_POST['cyclic'] );
     102        $fb['showNavArrows']      = sspdt_bool( $_POST['showNavArrows'] );
     103        $fb['showCloseButton']    = sspdt_bool( $_POST['showCloseButton'] );
    104104        $fb['enableEscapeButton'] = sspdt_bool( $_POST['enableEscapeButton'] );
    105105
    106         $fb['transitionIn'] = sspdt_fb_transition( $_POST['transitionIn'] );
    107         $fb['speedIn'] = sspdt_posint( $_POST['speedIn'] );
    108         $fb['easingIn'] = sspdt_fb_easing( $_POST['easingIn'] );
    109         $fb['transitionOut'] = sspdt_fb_transition( $_POST['transitionOut'] );
    110         $fb['speedOut'] = sspdt_posint( $_POST['speedOut'] );
    111         $fb['easingOut'] = sspdt_fb_easing( $_POST['easingOut'] );
    112         $fb['changeSpeed'] = sspdt_posint( $_POST['changeSpeed'] );
     106        $fb['transitionIn']       = sspdt_fb_transition( $_POST['transitionIn'] );
     107        $fb['speedIn']            = sspdt_posint( $_POST['speedIn'] );
     108        $fb['easingIn']           = sspdt_fb_easing( $_POST['easingIn'] );
     109        $fb['transitionOut']      = sspdt_fb_transition( $_POST['transitionOut'] );
     110        $fb['speedOut']           = sspdt_posint( $_POST['speedOut'] );
     111        $fb['easingOut']          = sspdt_fb_easing( $_POST['easingOut'] );
     112        $fb['changeSpeed']        = sspdt_posint( $_POST['changeSpeed'] );
    113113
    114114        $feed_options = array();
    115115
    116116        $feed_options['feed_url'] = rtrim( esc_url( $_POST['feed_url'] ), " /") . "/";
    117         $feed_options['secret'] = sspdt_nohtml( $_POST['secret'] );
     117        $feed_options['secret']   = sspdt_nohtml( $_POST['secret'] );
    118118
    119119
     
    137137
    138138
    139     $format_options = get_option('sspdt_format_options');
    140     $defaults = get_option('sspdt_defaults');
    141     $fb = get_option('sspdt_fancybox');
    142     $feed_options = get_option('sspdt_feed_options');
    143 
    144     $imdir = WP_PLUGIN_URL . "/ssp-director-tools/images/";
     139    $format_options    = get_option('sspdt_format_options');
     140    $defaults          = get_option('sspdt_defaults');
     141    $fb                = get_option('sspdt_fancybox');
     142    $feed_options      = get_option('sspdt_feed_options');
     143
     144    $imdir             = WP_PLUGIN_URL . "/ssp-director-tools/images/";
    145145
    146146    ?>
     
    803803function sspdt_default_options() {
    804804   
    805     $options = get_option('sspdt_format_options');
    806     $tmp = $options;
    807    
    808     if( !isset( $options['grid_width'] ) ) $tmp['grid_width'] = '60';
    809     if( !isset( $options['grid_height'] ) ) $tmp['grid_height'] = '60';
    810     if( !isset( $options['grid_crop'] ) ) $tmp['grid_crop'] = '1';
    811     if( !isset( $options['grid_quality'] ) ) $tmp['grid_quality'] = '75';
    812     if( !isset( $options['grid_sharpen'] ) ) $tmp['grid_sharpen'] = '1';
    813    
    814     if( !isset( $options['thumb_width'] ) ) $tmp['thumb_width'] = '240';
    815     if( !isset( $options['thumb_height'] ) ) $tmp['thumb_height'] = '240';
    816     if( !isset( $options['thumb_crop'] ) ) $tmp['thumb_crop'] = '0';
    817     if( !isset( $options['thumb_quality'] ) ) $tmp['thumb_quality'] = '80';
    818     if( !isset( $options['thumb_sharpen'] ) ) $tmp['thumb_sharpen'] = '1';
    819     if( !isset( $options['thumb_align'] ) ) $tmp['thumb_align'] = 'alignleft';
    820     if( !isset( $options['thumb_caption'] ) ) $tmp['thumb_caption'] = '1';
    821     if( !isset( $options['thumb_caption_format'] ) ) $tmp['thumb_caption_format'] = '%caption%';
    822     if( !isset( $options['thumb_watermark'] ) ) $tmp['thumb_watermark'] = '0';
    823    
    824     if( !isset( $options['large_width'] ) ) $tmp['large_width'] = '1000';
    825     if( !isset( $options['large_height'] ) ) $tmp['large_height'] = '720';
    826     if( !isset( $options['large_crop'] ) ) $tmp['large_crop'] = '0';
    827     if( !isset( $options['large_quality'] ) ) $tmp['large_quality'] = '85';
    828     if( !isset( $options['large_sharpen'] ) ) $tmp['large_sharpen'] = '1';
    829     if( !isset( $options['large_caption_format'] ) ) $tmp['large_caption_format'] = '<div style=&quot;text-align:left&quot;><b>%caption%</b><br />%byline% (%date% in %city%, %country%)</div>';
    830     if( !isset( $options['large_watermark'] ) ) $tmp['large_watermark'] = '0';
    831    
    832     if( !isset( $options['date_format'] ) ) $tmp['date_format'] = 'd.m.Y';
     805    $options   = get_option('sspdt_format_options');
     806    $tmp       = $options;
     807   
     808    if( !isset( $options['grid_width'] ) ) $tmp['grid_width']                      = '60';
     809    if( !isset( $options['grid_height'] ) ) $tmp['grid_height']                    = '60';
     810    if( !isset( $options['grid_crop'] ) ) $tmp['grid_crop']                        = '1';
     811    if( !isset( $options['grid_quality'] ) ) $tmp['grid_quality']                  = '75';
     812    if( !isset( $options['grid_sharpen'] ) ) $tmp['grid_sharpen']                  = '1';
     813   
     814    if( !isset( $options['thumb_width'] ) ) $tmp['thumb_width']                    = '240';
     815    if( !isset( $options['thumb_height'] ) ) $tmp['thumb_height']                  = '240';
     816    if( !isset( $options['thumb_crop'] ) ) $tmp['thumb_crop']                      = '0';
     817    if( !isset( $options['thumb_quality'] ) ) $tmp['thumb_quality']                = '80';
     818    if( !isset( $options['thumb_sharpen'] ) ) $tmp['thumb_sharpen']                = '1';
     819    if( !isset( $options['thumb_align'] ) ) $tmp['thumb_align']                    = 'alignleft';
     820    if( !isset( $options['thumb_caption'] ) ) $tmp['thumb_caption']                = '1';
     821    if( !isset( $options['thumb_caption_format'] ) ) $tmp['thumb_caption_format']  = '%caption%';
     822    if( !isset( $options['thumb_watermark'] ) ) $tmp['thumb_watermark']            = '0';
     823   
     824    if( !isset( $options['large_width'] ) ) $tmp['large_width']                    = '1000';
     825    if( !isset( $options['large_height'] ) ) $tmp['large_height']                  = '720';
     826    if( !isset( $options['large_crop'] ) ) $tmp['large_crop']                      = '0';
     827    if( !isset( $options['large_quality'] ) ) $tmp['large_quality']                = '85';
     828    if( !isset( $options['large_sharpen'] ) ) $tmp['large_sharpen']                = '1';
     829    if( !isset( $options['large_caption_format'] ) ) $tmp['large_caption_format']  = '<div style=&quot;text-align:left&quot;><b>%caption%</b><br />%byline% (%date% in %city%, %country%)</div>';
     830    if( !isset( $options['large_watermark'] ) ) $tmp['large_watermark']            = '0';
     831   
     832    if( !isset( $options['date_format'] ) ) $tmp['date_format']                    = 'd.m.Y';
    833833
    834834    update_option( 'sspdt_format_options', $tmp );
    835835   
    836     $options = get_option('sspdt_defaults');
    837     $tmp = $options;
    838    
    839     if( !isset( $options['model'] ) ) $tmp['model'] = 'gallery';
    840     if( !isset( $options['model_id'] ) ) $tmp['model_id'] = '1';
    841     if( !isset( $options['limit'] ) ) $tmp['limit'] = '24';
    842     if( !isset( $options['tags'] ) ) $tmp['tags'] = '';
    843     if( !isset( $options['tagmode'] ) ) $tmp['tagmode'] = 'one';
    844    
    845     if( !isset( $options['sort_on'] ) ) $tmp['sort_on'] = 'captured_on';
    846     if( !isset( $options['sort_direction'] ) ) $tmp['sort_direction'] = 'DESC';
    847     if( !isset( $options['rss'] ) ) $tmp['rss'] = '0';
     836    $options   = get_option('sspdt_defaults');
     837    $tmp       = $options;
     838   
     839    if( !isset( $options['model'] ) ) $tmp['model']                    = 'gallery';
     840    if( !isset( $options['model_id'] ) ) $tmp['model_id']              = '1';
     841    if( !isset( $options['limit'] ) ) $tmp['limit']                    = '24';
     842    if( !isset( $options['tags'] ) ) $tmp['tags']                      = '';
     843    if( !isset( $options['tagmode'] ) ) $tmp['tagmode']                = 'one';
     844   
     845    if( !isset( $options['sort_on'] ) ) $tmp['sort_on']                = 'captured_on';
     846    if( !isset( $options['sort_direction'] ) ) $tmp['sort_direction']  = 'DESC';
     847    if( !isset( $options['rss'] ) ) $tmp['rss']                        = '0';
    848848
    849849    update_option( 'sspdt_defaults', $tmp );
    850850   
    851     $options = get_option('sspdt_fancybox');
    852     $tmp = $options;
    853    
    854     if( !isset( $options['padding'] ) ) $tmp['padding'] = '10';
    855     if( !isset( $options['margin'] ) ) $tmp['margin'] = '20';
    856    
    857     if( !isset( $options['titleShow'] ) ) $tmp['titleShow'] = '1';
    858     if( !isset( $options['titlePosition'] ) ) $tmp['titlePosition'] = 'over';
    859     if( !isset( $options['counterShow'] ) ) $tmp['counterShow'] = '0';
    860    
    861     if( !isset( $options['overlayShow'] ) ) $tmp['overlayShow'] = '1';
    862     if( !isset( $options['overlayOpacity'] ) ) $tmp['overlayOpacity'] = '0.3';
    863     if( !isset( $options['overlayColor'] ) ) $tmp['overlayColor'] = '#666';
    864    
    865     if( !isset( $options['cyclic'] ) ) $tmp['cyclic'] = '0';
    866     if( !isset( $options['showNavArrows'] ) ) $tmp['showNavArrows'] = '1';
    867     if( !isset( $options['showCloseButton'] ) ) $tmp['showCloseButton'] = '1';
    868     if( !isset( $options['enableEscapeButton'] ) ) $tmp['enableEscapeButton'] = '1';
    869    
    870     if( !isset( $options['transitionIn'] ) ) $tmp['transitionIn'] = '1';
    871     if( !isset( $options['speedIn'] ) ) $tmp['speedIn'] = '300';
    872     if( !isset( $options['easingIn'] ) ) $tmp['easingIn'] = 'linear';
    873     if( !isset( $options['transitionOut'] ) ) $tmp['transitionOut'] = '1';
    874     if( !isset( $options['speedOut'] ) ) $tmp['speedOut'] = '400';
    875     if( !isset( $options['easingOut'] ) ) $tmp['easingOut'] = 'linear';
    876     if( !isset( $options['changeSpeed'] ) ) $tmp['changeSpeed'] = '400';
     851    $options   = get_option('sspdt_fancybox');
     852    $tmp       = $options;
     853   
     854    if( !isset( $options['padding'] ) ) $tmp['padding']                        = '10';
     855    if( !isset( $options['margin'] ) ) $tmp['margin']                          = '20';
     856   
     857    if( !isset( $options['titleShow'] ) ) $tmp['titleShow']                    = '1';
     858    if( !isset( $options['titlePosition'] ) ) $tmp['titlePosition']            = 'over';
     859    if( !isset( $options['counterShow'] ) ) $tmp['counterShow']                = '0';
     860   
     861    if( !isset( $options['overlayShow'] ) ) $tmp['overlayShow']                = '1';
     862    if( !isset( $options['overlayOpacity'] ) ) $tmp['overlayOpacity']          = '0.3';
     863    if( !isset( $options['overlayColor'] ) ) $tmp['overlayColor']              = '#666';
     864   
     865    if( !isset( $options['cyclic'] ) ) $tmp['cyclic']                          = '0';
     866    if( !isset( $options['showNavArrows'] ) ) $tmp['showNavArrows']            = '1';
     867    if( !isset( $options['showCloseButton'] ) ) $tmp['showCloseButton']        = '1';
     868    if( !isset( $options['enableEscapeButton'] ) ) $tmp['enableEscapeButton']  = '1';
     869   
     870    if( !isset( $options['transitionIn'] ) ) $tmp['transitionIn']              = '1';
     871    if( !isset( $options['speedIn'] ) ) $tmp['speedIn']                        = '300';
     872    if( !isset( $options['easingIn'] ) ) $tmp['easingIn']                      = 'linear';
     873    if( !isset( $options['transitionOut'] ) ) $tmp['transitionOut']            = '1';
     874    if( !isset( $options['speedOut'] ) ) $tmp['speedOut']                      = '400';
     875    if( !isset( $options['easingOut'] ) ) $tmp['easingOut']                    = 'linear';
     876    if( !isset( $options['changeSpeed'] ) ) $tmp['changeSpeed']                = '400';
    877877
    878878    update_option( 'sspdt_fancybox', $tmp );
Note: See TracChangeset for help on using the changeset viewer.