Changeset 478789
- Timestamp:
- 12/21/2011 07:04:18 PM (14 years ago)
- Location:
- captionpix/trunk
- Files:
-
- 8 edited
-
captionpix-defaults.php (modified) (8 diffs)
-
captionpix-init.php (modified) (1 diff)
-
captionpix-licence.php (modified) (7 diffs)
-
captionpix-public.php (modified) (3 diffs)
-
captionpix-theme-factory.php (modified) (3 diffs)
-
captionpix-themes.php (modified) (7 diffs)
-
captionpix.php (modified) (1 diff)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
captionpix/trunk/captionpix-defaults.php
r443668 r478789 76 76 add_contextual_help( $current_screen, 77 77 '<h3>CaptionPix</h3><p>Here you can set the default plugin settings.</p>'. 78 '<p><a href="'.CAPTIONPIX_HOME.'tutorials" target="_blank">Getting Started with CaptionPix</a></p>');78 '<p><a href="'.CAPTIONPIX_HOME.'tutorials" rel="external">Getting Started with CaptionPix</a></p>'); 79 79 } 80 80 … … 131 131 for ($i=0; $i<count($themes); $i++) $s .= '<option value="'.$themes[$i] .'">'.ucwords($themes[$i]) . '</option>'; 132 132 $s .= '</select>'; 133 $theme_list = str_replace('value="'.$theme.'"', 'selected value="'.$theme.'"', $s);133 $theme_list = str_replace('value="'.$theme.'"', 'selected="selected" value="'.$theme.'"', $s); 134 134 135 $align_none = $options['align']=="none"? "selected":"";136 $align_center = $options['align']=="center"? "selected":"";137 $align_left = $options['align']=="left"? "selected":"";138 $align_right = $options['align']=="right"? "selected":"";135 $align_none = $options['align']=="none"?'selected="selected"':''; 136 $align_center = $options['align']=="center"?'selected="selected"':''; 137 $align_left = $options['align']=="left"?'selected="selected"':''; 138 $align_right = $options['align']=="right"?'selected="selected"':''; 139 139 print <<< GENERAL_PANEL 140 140 <h4>Default Theme</h4> … … 150 150 <p>Set this value if you typically want to center the image or float the image to the left or right of the text.</p> 151 151 <label for="align">Image Alignment: </label><select name="align" id="align"> 152 <option value="none" {$align_none}>None</option>153 <option value="center" {$align_center}>Center </option>154 <option value="left" {$align_left}>Left</option>155 <option value="right" {$align_right}>Right</option>152 <option {$align_none} value="none">None</option> 153 <option {$align_center} value="center">Center </option> 154 <option {$align_left} value="left">Left</option> 155 <option {$align_right} value="right">Right</option> 156 156 </select> 157 157 <h4>Default Side Margin</h4> … … 173 173 static function advanced_panel($post, $metabox) { 174 174 $options = captionpix_get_options($this->use_cache()); 175 $auto_none = $options['autocaption']=="none"? "selected":"";176 $auto_title = $options['autocaption']=="title"? "selected":"";177 $auto_alt = $options['autocaption']=="alt"? "selected":"";178 $auto_post = $options['autocaption']=="post"? "selected":"";175 $auto_none = $options['autocaption']=="none"?'selected="selected"':''; 176 $auto_title = $options['autocaption']=="title"?'selected="selected"':''; 177 $auto_alt = $options['autocaption']=="alt"?'selected="selected"':''; 178 $auto_post = $options['autocaption']=="post"?'selected="selected"':''; 179 179 print <<< ADVANCED_PANEL 180 180 <h4>Auto-captioning</h4> … … 182 182 <p>Captions will only applied on pages with single posts and on the home page.</p> 183 183 <label for="autocaption">Auto-captioning: </label><select name="autocaption" id="autocaption"> 184 <option value="none" {$auto_none}>None</option>185 <option value="title" {$auto_title}>Use Image Title as Caption</option>186 <option value="alt" {$auto_alt}>Use Image Alt as Caption</option>187 <option value="post" {$auto_post}>Use Post Title as Caption</option>184 <option {$auto_none} value="none">None</option> 185 <option {$auto_title} value="title">Use Image Title as Caption</option> 186 <option {$auto_alt} value="alt">Use Image Alt as Caption</option> 187 <option {$auto_post} value="post">Use Post Title as Caption</option> 188 188 </select> 189 189 ADVANCED_PANEL; 190 190 } 191 192 191 193 192 static function help_panel($post, $metabox) { … … 196 195 <p><img src="http://images.captionpix.com/layout/captionpix-logo.jpg" alt="CaptionPix Image Captioning Plugin" /></p> 197 196 <ul> 198 <li><a target="_blank" href="{$home}">CaptionPix Plugin Home Page</a></li> 199 <li><a target="_blank" href="{$home}instructions/">How To Use CaptionPix</a></li> 200 <li><a target="_blank" href="{$home}tutorials/">FREE CaptionPix Tutorials</a></li> 201 <li><a target="_blank" href="{$home}help/">CaptionPix Help</a></li> 202 </ul> 197 <li><a href="{$home}" rel="external">CaptionPix Plugin Home Page</a></li> 198 <li><a href="{$home}instructions/" rel="external">How To Use CaptionPix</a></li> 199 <li><a href="{$home}tutorials/" rel="external">FREE CaptionPix Tutorials</a></li> 200 <li><a href="{$home}help/" rel="external">CaptionPix Help</a></li> 203 201 </ul> 204 202 HELP_PANEL; … … 209 207 global $screen_layout_columns; 210 208 if (isset($_POST['options_update'])) echo self::save(); 209 $this_url = $_SERVER['REQUEST_URI']; 211 210 ?> 212 211 <div id="poststuff" class="metabox-holder has-right-sidebar"> … … 218 217 <div id="post-body" class="has-sidebar"> 219 218 <div id="post-body-content" class="has-sidebar-content"> 220 <form method="post" id="captionpix_options"> 221 <?php wp_nonce_field(CAPTIONPIX_DEFAULTS); ?> 222 <?php wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false ); ?> 223 <?php wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false ); ?> 219 <form id="captionpix_options" method="post" action="<?php echo $this_url; ?>" > 224 220 <?php do_meta_boxes(self::get_screen_id(), 'normal', null); ?> 225 221 <p class="submit"> 226 222 <input type="submit" class="button-primary" name="options_update" value="Save Changes" /> 227 223 <input type="hidden" name="page_options" value="defaults,theme,width,align,marginside,margintop,marginbottom" /> 224 <?php wp_nonce_field(CAPTIONPIX_DEFAULTS); ?> 225 <?php wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false ); ?> 226 <?php wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false ); ?> 228 227 </p> 229 228 </form> -
captionpix/trunk/captionpix-init.php
r443668 r478789 1 1 <?php 2 define('CAPTIONPIX_VERSION', '1. 1');2 define('CAPTIONPIX_VERSION', '1.2'); 3 3 define('CAPTIONPIX', 'captionpix'); 4 4 define('CAPTIONPIX_PATH', CAPTIONPIX.'/captionpix.php'); -
captionpix/trunk/captionpix-licence.php
r443668 r478789 59 59 60 60 static function load_style() { 61 echo ('<link rel="stylesheet" id="'.CAPTIONPIX_ ADMIN.'" href="'.CAPTIONPIX_PLUGIN_URL.'/captionpix-licence.css?ver='.CAPTIONPIX_PLUGIN_URL.'" type="text/css" media="all" />');61 echo ('<link rel="stylesheet" id="'.CAPTIONPIX_LICENCE.'" href="'.CAPTIONPIX_PLUGIN_URL.'/captionpix-licence.css?ver='.CAPTIONPIX_PLUGIN_URL.'" type="text/css" media="all" />'); 62 62 } 63 63 … … 75 75 add_contextual_help( $current_screen, 76 76 '<h3>CaptionPix</h3><p>Here you can get your FREE CaptionPix License Key.</p>'. 77 '<p><a href="'.CAPTIONPIX_HOME.'tutorials" target="_blank">Getting Started with CaptionPix</a></p>');77 '<p><a href="'.CAPTIONPIX_HOME.'tutorials" rel="external">Getting Started with CaptionPix</a></p>'); 78 78 } 79 79 … … 94 94 } 95 95 96 97 96 static function save() { 98 97 check_admin_referer(CAPTIONPIX_LICENCE); 99 if (CaptionPixUpdater::save_licence(trim(stripslashes($_POST['licence'])))) {98 if (CaptionPixUpdater::save_licence(trim(stripslashes($_POST['licence'])))) 100 99 $message = __("CaptionPix License saved.",CAPTIONPIX_ADMIN); 101 CaptionPixUpdater::get_updates(false); //update cache with new entitlements as a licensed user 102 } else 100 else 103 101 $message = __("CaptionPix License has not changed.",CAPTIONPIX_ADMIN); 102 CaptionPixUpdater::get_updates(false); //update cache with new entitlements as a licensed user 104 103 return '<div id="message" class="updated fade"><p>' . $message. '</p></div>'; 105 104 } … … 113 112 if (! empty($licence)) { 114 113 $is_valid = CaptionPixUpdater::check_validity(); 115 $key_status_indicator = "<img src='" . CAPTIONPIX_PLUGIN_URL ."/images/".($is_valid ? "tick" : "cross").".png'/>"; 114 $flag = $is_valid ? 'tick' : 'cross'; 115 $key_status_indicator = '<img src="' . CAPTIONPIX_PLUGIN_URL .'/images/'.$flag.'.png" alt="a '.$flag.'" />'; 116 116 $notice = CaptionPixUpdater::get_notice(); 117 117 } … … 141 141 print <<< REQUEST_PANEL 142 142 <p><img src="http://images.captionpix.com/layout/get-free-license-key.png" alt="CaptionPix Free Licence Request" /></p> 143 <form id="captionpix_signup" name="captionpix_signup" method="post" action="{$home}" 144 onSubmit="return captionpix_validate_form(this);"> 145 <input type="hidden" name="form_storm" value="submit"/> 146 <input type="hidden" name="destination" value="captionpix"/> 147 <input type="hidden" name="domain" value="{$domain}"/> 143 <form id="captionpix_signup" name="captionpix_signup" method="post" action="{$home}" onsubmit="return captionpix_validate_form(this);"> 144 <input type="hidden" name="form_storm" value="submit" /> 145 <input type="hidden" name="destination" value="captionpix" /> 146 <input type="hidden" name="domain" value="{$domain}" /> 148 147 <label for="firstname">First Name<input id="firstname" name="firstname" type="text" value="" /></label><br/> 149 148 <label for="email">Your Email<input id="email" name="email" type="text" /></label><br/> … … 157 156 global $screen_layout_columns; 158 157 if (isset($_POST['options_update'])) echo self::save(); 158 $this_url = $_SERVER['REQUEST_URI']; 159 159 $themes_url = captionpix_themes::get_url(); 160 160 ?> … … 169 169 <div id="post-body" class="has-sidebar"> 170 170 <div id="post-body-content" class="has-sidebar-content"> 171 <form method="post" id="slickr_flickr_options"> 171 <form id="slickr_flickr_options" method="post" action="<?php echo $this_url; ?>"> 172 <?php do_meta_boxes(self::get_screen_id(), 'normal', null); ?> 173 <p class="submit"> 174 <input type="submit" class="button-primary" name="options_update" value="Save Changes" /> 172 175 <?php wp_nonce_field(CAPTIONPIX_LICENCE); ?> 173 176 <?php wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false ); ?> 174 177 <?php wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false ); ?> 175 <?php do_meta_boxes(self::get_screen_id(), 'normal', null); ?>176 <p class="submit">177 <input type="submit" class="button-primary" name="options_update" value="Save Changes" />178 178 </p> 179 179 </form> -
captionpix/trunk/captionpix-public.php
r443668 r478789 72 72 return $content; 73 73 } 74 75 74 76 75 static function autocaption_image($img, $autocaption) { … … 110 109 extract($attr); 111 110 $e = array(); 112 //if (isset($theme)) self::validate_in_set($e, 'theme', $theme, CaptionPixThemeFactory::get_theme_names());113 111 if (isset($float)) self::validate_in_set($e, 'float', $float, array('left','right','center','none')); 114 112 if (isset($framecolor)) self::validate_color($e, 'framecolor', $framecolor); … … 204 202 205 203 static private function build_frame($frame_params,$img_params,$caption_params) { 204 $width = ''; $align='';$margintop='';$marginbottom='';$padding='';$framecolor='';$framebackground=''; 206 205 extract($frame_params); 207 206 if ($nostyle) -
captionpix/trunk/captionpix-theme-factory.php
r442973 r478789 1 1 <?php 2 3 2 class CaptionPixThemeFactory { 4 3 … … 22 21 } 23 22 24 public static function get_themes_in_set($myset ) {25 if ( count(self::$themesets) == 0) self::refresh_themesets();23 public static function get_themes_in_set($myset,$cache=true) { 24 if ((false == $cache) || count(self::$themesets) == 0) self::refresh_themesets($cache); 26 25 if (is_array(self::$themesets) && (count(self::$themesets) > 0)) 27 26 return array_keys(self::$themesets,$myset); … … 51 50 $more_themes = CaptionPixUpdater::get_updates($cache,'updates'); 52 51 if (is_array($more_themes) && (count($more_themes) > 0)) $themes = array_merge($more_themes,$themes); 53 foreach ($themes as $key => $theme) { //allow plugin to determine image file locations, local, amazon s3, cdn52 foreach ($themes as $key => $theme) { //allow local overrides of image file locations, local, amazon s3, cdn using constants placed in wp-config.php 54 53 if (array_key_exists('framebackground',$theme)) $themes[$key]['framebackground'] = str_replace('CAPTIONPIX_FRAMES_URL',CAPTIONPIX_FRAMES_URL,$theme['framebackground']); 55 54 if (array_key_exists('frameborder',$theme)) $themes[$key]['frameborder'] = str_replace('CAPTIONPIX_BORDERS_URL',CAPTIONPIX_FRAMES_URL,$theme['frameborder']); -
captionpix/trunk/captionpix-themes.php
r442973 r478789 59 59 60 60 static function load_style() { 61 echo ('<link rel="stylesheet" id="'.CAPTIONPIX_ ADMIN.'" href="'.CAPTIONPIX_PLUGIN_URL.'/captionpix-themes.css?ver='.CAPTIONPIX_PLUGIN_URL.'" type="text/css" media="all" />');61 echo ('<link rel="stylesheet" id="'.CAPTIONPIX_THEMES.'" href="'.CAPTIONPIX_PLUGIN_URL.'/captionpix-themes.css?ver='.CAPTIONPIX_PLUGIN_URL.'" type="text/css" media="all" />'); 62 62 } 63 63 … … 77 77 add_contextual_help( $current_screen, 78 78 '<h3>CaptionPix</h3><p>Here you can get your FREE CaptionPix License Key.</p>'. 79 '<p><a href="'.CAPTIONPIX_HOME.'tutorials" target="_blank">Getting Started with CaptionPix</a></p>');79 '<p><a href="'.CAPTIONPIX_HOME.'tutorials" rel="external">Getting Started with CaptionPix</a></p>'); 80 80 } 81 81 … … 126 126 127 127 static function bonus_panel($post, $metabox) { 128 129 $themes = CaptionPixThemeFactory::get_themes_in_set('licensed'); 128 $url= $_SERVER['REQUEST_URI']; 129 $refresh = array_key_exists('refresh',$_GET); 130 if ($refresh) { 131 $cache = false; 132 CaptionPixUpdater::get_updates($cache); //update cache with latest entitlements as a licensed user 133 } 134 else { 135 $cache = true; 136 $url .= "&refresh=true"; 137 } 138 $themes = CaptionPixThemeFactory::get_themes_in_set('licensed',$cache); 130 139 $themelist = ''; 131 140 foreach ($themes as $theme) $themelist .= '<li>'.self::captioned_screenshot($theme,'licensed').'</li>'; … … 136 145 {$themelist} 137 146 </ul> 147 <p>New themes will appear here automatically within 24 hours of being released. However, if you have been notified of a release of new 148 themes today then you should click to see the latest <a rel="nofollow" href="{$url}">CaptionPix themes.</a></p> 138 149 BONUS_PANEL; 139 150 } … … 151 162 } 152 163 153 154 155 164 static function help_panel($post, $metabox) { 156 165 $home = CAPTIONPIX_HOME; … … 158 167 <p><img src="http://images.captionpix.com/layout/captionpix-logo.jpg" alt="CaptionPix Image Captioning Plugin" /></p> 159 168 <ul> 160 <li><a target="_blank" href="{$home}">CaptionPix Plugin Home Page</a></li>161 <li><a target="_blank" href="{$home}instructions/">How To Use CaptionPix</a></li>162 <li><a target="_blank" href="{$home}tutorials/">FREE CaptionPix Tutorials</a></li>163 <li><a target="_blank" href="{$home}help/">CaptionPix Help</a></li>169 <li><a href="{$home}" rel="external">CaptionPix Plugin Home Page</a></li> 170 <li><a href="{$home}instructions/" rel="external">How To Use CaptionPix</a></li> 171 <li><a href="{$home}tutorials/" rel="external">FREE CaptionPix Tutorials</a></li> 172 <li><a href="{$home}help/" rel="external">CaptionPix Help</a></li> 164 173 </ul> 165 174 HELP_PANEL; 166 175 } 167 176 168 169 177 static function controller() { 178 $this_url = $_SERVER['REQUEST_URI']; 170 179 global $screen_layout_columns; 171 180 ?> … … 177 186 <div id="post-body" class="has-sidebar"> 178 187 <div id="post-body-content" class="has-sidebar-content"> 179 <form method="post" id="slickr_flickr_options"> 188 <form id="slickr_flickr_options" method="post" action="<?php echo $this_url; ?>"> 189 <?php do_meta_boxes(self::get_screen_id(), 'normal', null); ?> 190 <fieldset> 180 191 <?php wp_nonce_field(CAPTIONPIX_THEMES); ?> 181 192 <?php wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false ); ?> 182 193 <?php wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false ); ?> 183 < ?php do_meta_boxes(self::get_screen_id(), 'normal', null); ?>194 </fieldset> 184 195 </form> 185 196 </div> -
captionpix/trunk/captionpix.php
r443668 r478789 4 4 Plugin URI: http://www.captionpix.com 5 5 Description: Displays images with captions beautifully 6 Version: 1. 16 Version: 1.2 7 7 Author: Russell Jamieson 8 8 Author URI: http://www.russelljamieson.com -
captionpix/trunk/readme.txt
r443668 r478789 5 5 Requires at least: 2.8 6 6 Tested up to: 3.2.1 7 Stable tag: 1. 17 Stable tag: 1.2 8 8 9 9 A WordPress image captioning plugin that makes it easy to align a framed and captioned image to the left, right or center of the page. … … 33 33 == Changelog == 34 34 35 = 1.2 = Add link to allow refresh of themes 36 35 37 = 1.1 = Force max-width on image to be 100% 36 38 … … 39 41 == Upgrade Notice == 40 42 41 = 1. 1=42 * Optional - fix for WordPress themes that restrict the image width43 = 1.2 = 44 * Optional - add link to refresh list of available CaptinPix Themes 43 45 44 46
Note: See TracChangeset
for help on using the changeset viewer.