Changeset 1007873
- Timestamp:
- 10/15/2014 12:41:20 PM (11 years ago)
- Location:
- ssp-director-tools/trunk
- Files:
-
- 11 edited
-
feed/feed.php (modified) (1 diff)
-
feed/includes/Encryption.php (modified) (2 diffs)
-
feed/includes/PhotoFeed.php (modified) (2 diffs)
-
feed/includes/config.php (modified) (1 diff)
-
includes/Encryption.php (modified) (2 diffs)
-
includes/SSPDT.php (modified) (5 diffs)
-
includes/SSPDT_Widget.php (modified) (4 diffs)
-
includes/api/cache/sspdt (modified) (1 prop)
-
includes/helpers.php (modified) (1 diff)
-
includes/shortcodes.php (modified) (3 diffs)
-
includes/sspdt-options-page.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ssp-director-tools/trunk/feed/feed.php
r409240 r1007873 41 41 if(md5($decrypted_options) != $_GET['c']) die('Incorrect feed parameters.'); 42 42 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 45 46 $feed->rss($options); 46 47 -
ssp-director-tools/trunk/feed/includes/Encryption.php
r409240 r1007873 28 28 29 29 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 34 36 return trim($this->safe_b64encode($crypttext)); 35 37 } … … 38 40 39 41 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 44 48 return trim($decrypttext); 45 49 } -
ssp-director-tools/trunk/feed/includes/PhotoFeed.php
r409240 r1007873 66 66 $bulk = $this->album->get($opts['model_id']); 67 67 } 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://'; 73 73 74 74 header('Content-type: application/rss+xml'); … … 92 92 93 93 $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; 97 97 98 98 printf(" <item>\n"); -
ssp-director-tools/trunk/feed/includes/config.php
r409180 r1007873 6 6 7 7 $sspd_feed_preview = array( 8 'name' => 'preview',9 'width' => 120,10 'height' => 120,11 'crop' => 1,12 'quality' => 75,13 'sharpening' => 18 'name' => 'preview', 9 'width' => 120, 10 'height' => 120, 11 'crop' => 1, 12 'quality' => 75, 13 'sharpening' => 1 14 14 ); 15 15 16 16 $sspd_feed_full = array( 17 'name' => 'full',18 'width' => 1920,19 'height' => 1920,20 'crop' => 0,21 'quality' => 90,22 'sharpening' => 117 'name' => 'full', 18 'width' => 1920, 19 'height' => 1920, 20 'crop' => 0, 21 'quality' => 90, 22 'sharpening' => 1 23 23 ); 24 24 -
ssp-director-tools/trunk/includes/Encryption.php
r409240 r1007873 28 28 29 29 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 34 36 return trim($this->safe_b64encode($crypttext)); 35 37 } … … 38 40 39 41 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 44 48 return trim($decrypttext); 45 49 } -
ssp-director-tools/trunk/includes/SSPDT.php
r1004061 r1007873 31 31 32 32 $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'], 38 38 'sharpening' => ($format_options['grid_sharpen'] == '1' ? 1 : 0) 39 39 ); 40 40 41 41 $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'], 47 47 'sharpening' => ($format_options['thumb_sharpen'] == '1' ? 1 : 0) 48 48 ); 49 49 50 50 $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'], 56 56 'sharpening' => ($format_options['large_sharpen'] == '1' ? 1 : 0) 57 57 ); … … 86 86 87 87 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']; 92 92 } 93 93 94 94 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']; 97 97 } 98 98 99 99 if($content_options['tags'] != "") { 100 100 $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']; 103 103 } 104 104 105 105 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']; 110 110 } 111 111 … … 120 120 } 121 121 122 $params = substr($params, 1);122 $params = substr($params, 1); 123 123 124 124 $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" ); 136 136 137 137 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'/> 146 145 </a>\n", "sspdt-fancybox", $rel, $this->watermarked_url( $content, 'large' ), $title, $content->grid->url, $alt, $width, $height); 147 146 148 $out .= $this->meta_html($content, "large");147 $out .= $this->meta_html($content, "large"); 149 148 150 149 } … … 172 171 public function single($image, $align, $showcaption, $post_id) { 173 172 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; 181 180 182 181 $captionwidth = $width + 2 * 5; 183 182 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) : ""; 186 185 187 186 //debug_var($content->iptc); … … 232 231 } 233 232 234 $date_format = $this->format_options['date_format'];233 $date_format = $this->format_options['date_format']; 235 234 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 248 248 if($size == "large") { 249 249 $html .= "<div style='display:none;'>"; -
ssp-director-tools/trunk/includes/SSPDT_Widget.php
r409240 r1007873 13 13 function SSPDT_Widget() { 14 14 $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') 17 17 ); 18 18 $control_ops = array ( 19 'width' => '300',19 'width' => '300', 20 20 'height' => '200' 21 21 ); … … 31 31 function form($instance) { 32 32 $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' 42 42 ); 43 43 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']; 54 54 55 55 ?> … … 166 166 function update($new_instance, $old_instance) { 167 167 $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'] ); 177 177 return $instance; 178 178 } … … 195 195 } 196 196 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 ); 203 203 204 204 echo $before_widget; -
ssp-director-tools/trunk/includes/api/cache/sspdt
- Property svn:ignore
-
old new 17 17 ee4423779cc7245868bd190da30882bd 18 18 f5806743da0ce92abca69534426f9e79 19 9771ccde9bb4d5b0575c411621ba9010 20 443863eb28b7098fa206f6bd85bf61b3 21 48179929176130ced94fa5b5c7cb0805 22 e3a3ab487cbb1f492ee10de55e5ddd4e
-
- Property svn:ignore
-
ssp-director-tools/trunk/includes/helpers.php
r450207 r1007873 52 52 function sspdt_html_format($val) { 53 53 $allowed = array( 54 "div" => array(55 "style" => array(),56 "align" => array()54 "div" => array( 55 "style" => array(), 56 "align" => array() 57 57 ), 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() 64 64 ); 65 65 return wp_kses($val, $allowed); -
ssp-director-tools/trunk/includes/shortcodes.php
r409240 r1007873 11 11 function sspdt_filter_content($atts) { 12 12 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' => '', 22 22 'sort_direction' => '', 23 'rss' => ''23 'rss' => '' 24 24 ), $atts ) ); 25 25 … … 38 38 if($image == '') { //we make a photo grid with multiple images 39 39 40 $defaults = get_option('sspdt_defaults');41 $options = array();40 $defaults = get_option('sspdt_defaults'); 41 $options = array(); 42 42 43 43 // Determine the scope of the request … … 114 114 } else { //we make a single image 115 115 116 $format_options = get_option('sspdt_format_options');116 $format_options = get_option('sspdt_format_options'); 117 117 118 118 // 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'; 121 121 122 122 // Override alignment settings if align attribute provided -
ssp-director-tools/trunk/includes/sspdt-options-page.php
r1004061 r1007873 45 45 update_option( 'sspdt_api_cache', $_POST['sspdt_api_cache'] ); 46 46 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'] ); 72 72 73 $format_options['date_format'] = sspdt_nohtml( $_POST['date_format'] );73 $format_options['date_format'] = sspdt_nohtml( $_POST['date_format'] ); 74 74 75 75 //var_dump($format_options); … … 77 77 $defaults = array(); 78 78 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'] ); 87 87 88 88 $fb = array(); 89 89 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'] ); 104 104 $fb['enableEscapeButton'] = sspdt_bool( $_POST['enableEscapeButton'] ); 105 105 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'] ); 113 113 114 114 $feed_options = array(); 115 115 116 116 $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'] ); 118 118 119 119 … … 137 137 138 138 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/"; 145 145 146 146 ?> … … 803 803 function sspdt_default_options() { 804 804 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="text-align:left"><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="text-align:left"><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'; 833 833 834 834 update_option( 'sspdt_format_options', $tmp ); 835 835 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'; 848 848 849 849 update_option( 'sspdt_defaults', $tmp ); 850 850 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'; 877 877 878 878 update_option( 'sspdt_fancybox', $tmp );
Note: See TracChangeset
for help on using the changeset viewer.