Plugin Directory

Changeset 478789


Ignore:
Timestamp:
12/21/2011 07:04:18 PM (14 years ago)
Author:
powerblogservice
Message:

CaptionPix Version 1.2

Location:
captionpix/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • captionpix/trunk/captionpix-defaults.php

    r443668 r478789  
    7676        add_contextual_help( $current_screen,
    7777            '<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>');   
    7979    }
    8080
     
    131131        for ($i=0; $i<count($themes); $i++) $s .= '<option value="'.$themes[$i] .'">'.ucwords($themes[$i]) . '</option>';
    132132        $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);
    134134       
    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"':'';
    139139        print <<< GENERAL_PANEL
    140140<h4>Default Theme</h4>
     
    150150<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>
    151151<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>
    156156</select>
    157157<h4>Default Side Margin</h4>
     
    173173    static function advanced_panel($post, $metabox) {       
    174174        $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"':'';
    179179        print <<< ADVANCED_PANEL
    180180<h4>Auto-captioning</h4>
     
    182182<p>Captions will only applied on pages with single posts and on the home page.</p>
    183183<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>
    188188</select>
    189189ADVANCED_PANEL;
    190190    }
    191 
    192191
    193192    static function help_panel($post, $metabox) {
     
    196195<p><img src="http://images.captionpix.com/layout/captionpix-logo.jpg" alt="CaptionPix Image Captioning Plugin" /></p>
    197196<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>
    203201</ul>
    204202HELP_PANEL;
     
    209207        global $screen_layout_columns;     
    210208        if (isset($_POST['options_update'])) echo self::save();
     209        $this_url = $_SERVER['REQUEST_URI'];       
    211210?>
    212211    <div id="poststuff" class="metabox-holder has-right-sidebar">
     
    218217        <div id="post-body" class="has-sidebar">
    219218            <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; ?>" >
    224220            <?php do_meta_boxes(self::get_screen_id(), 'normal', null); ?>
    225221            <p class="submit">
    226222            <input type="submit"  class="button-primary" name="options_update" value="Save Changes" />
    227223            <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 ); ?>
    228227            </p>
    229228            </form>
  • captionpix/trunk/captionpix-init.php

    r443668 r478789  
    11<?php
    2 define('CAPTIONPIX_VERSION', '1.1');
     2define('CAPTIONPIX_VERSION', '1.2');
    33define('CAPTIONPIX', 'captionpix');
    44define('CAPTIONPIX_PATH', CAPTIONPIX.'/captionpix.php');
  • captionpix/trunk/captionpix-licence.php

    r443668 r478789  
    5959
    6060    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" />');
    6262    }
    6363
     
    7575        add_contextual_help( $current_screen,
    7676            '<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>');   
    7878    }
    7979
     
    9494    }
    9595
    96 
    9796    static function save() {
    9897        check_admin_referer(CAPTIONPIX_LICENCE);
    99         if (CaptionPixUpdater::save_licence(trim(stripslashes($_POST['licence'])))) {
     98        if (CaptionPixUpdater::save_licence(trim(stripslashes($_POST['licence']))))
    10099            $message = __("CaptionPix License saved.",CAPTIONPIX_ADMIN);
    101             CaptionPixUpdater::get_updates(false); //update cache with new entitlements as a licensed user
    102         } else
     100        else
    103101            $message = __("CaptionPix License has not changed.",CAPTIONPIX_ADMIN);
     102        CaptionPixUpdater::get_updates(false); //update cache with new entitlements as a licensed user
    104103        return '<div id="message" class="updated fade"><p>' . $message. '</p></div>';
    105104    }
     
    113112        if (! empty($licence)) {
    114113            $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.'" />';
    116116            $notice = CaptionPixUpdater::get_notice();
    117117        }
     
    141141        print <<< REQUEST_PANEL
    142142<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}" />
    148147<label for="firstname">First Name<input id="firstname" name="firstname" type="text" value="" /></label><br/>
    149148<label for="email">Your Email<input id="email" name="email" type="text" /></label><br/>
     
    157156        global $screen_layout_columns;     
    158157        if (isset($_POST['options_update'])) echo self::save();
     158        $this_url = $_SERVER['REQUEST_URI'];       
    159159        $themes_url = captionpix_themes::get_url();
    160160?>
     
    169169        <div id="post-body" class="has-sidebar">
    170170            <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" />
    172175            <?php wp_nonce_field(CAPTIONPIX_LICENCE); ?>
    173176            <?php wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false ); ?>
    174177            <?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" />
    178178            </p>
    179179            </form>
  • captionpix/trunk/captionpix-public.php

    r443668 r478789  
    7272        return $content;
    7373    }
    74 
    7574
    7675    static function autocaption_image($img, $autocaption) {
     
    110109        extract($attr);
    111110        $e = array();
    112         //if (isset($theme)) self::validate_in_set($e, 'theme', $theme, CaptionPixThemeFactory::get_theme_names());
    113111        if (isset($float)) self::validate_in_set($e, 'float', $float, array('left','right','center','none'));
    114112        if (isset($framecolor)) self::validate_color($e, 'framecolor', $framecolor);
     
    204202
    205203    static private function build_frame($frame_params,$img_params,$caption_params) {
     204        $width = ''; $align='';$margintop='';$marginbottom='';$padding='';$framecolor='';$framebackground='';
    206205        extract($frame_params);
    207206        if ($nostyle)   
  • captionpix/trunk/captionpix-theme-factory.php

    r442973 r478789  
    11<?php
    2 
    32class CaptionPixThemeFactory {
    43
     
    2221    }
    2322
    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);
    2625        if (is_array(self::$themesets) && (count(self::$themesets) > 0))
    2726            return array_keys(self::$themesets,$myset);
     
    5150        $more_themes = CaptionPixUpdater::get_updates($cache,'updates');
    5251        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, cdn
     52        foreach ($themes as $key => $theme) { //allow local overrides of image file locations, local, amazon s3, cdn using constants placed in wp-config.php
    5453            if (array_key_exists('framebackground',$theme)) $themes[$key]['framebackground'] = str_replace('CAPTIONPIX_FRAMES_URL',CAPTIONPIX_FRAMES_URL,$theme['framebackground']);
    5554            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  
    5959
    6060    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" />');
    6262    }
    6363
     
    7777        add_contextual_help( $current_screen,
    7878            '<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>');   
    8080    }
    8181
     
    126126
    127127    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);
    130139        $themelist = '';
    131140        foreach ($themes as $theme) $themelist .= '<li>'.self::captioned_screenshot($theme,'licensed').'</li>';
     
    136145{$themelist}
    137146</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
     148themes today then you should click to see the latest <a rel="nofollow" href="{$url}">CaptionPix themes.</a></p>
    138149BONUS_PANEL;
    139150    }   
     
    151162    }   
    152163
    153 
    154 
    155164    static function help_panel($post, $metabox) {
    156165        $home = CAPTIONPIX_HOME;
     
    158167<p><img src="http://images.captionpix.com/layout/captionpix-logo.jpg" alt="CaptionPix Image Captioning Plugin" /></p>
    159168<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>
    164173</ul>
    165174HELP_PANEL;
    166175    }   
    167176
    168 
    169177    static function controller() {
     178        $this_url = $_SERVER['REQUEST_URI'];   
    170179        global $screen_layout_columns;     
    171180?>
     
    177186        <div id="post-body" class="has-sidebar">
    178187            <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>
    180191            <?php wp_nonce_field(CAPTIONPIX_THEMES); ?>
    181192            <?php wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false ); ?>
    182193            <?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>         
    184195            </form>
    185196            </div>
  • captionpix/trunk/captionpix.php

    r443668 r478789  
    44Plugin URI: http://www.captionpix.com
    55Description: Displays images with captions beautifully
    6 Version: 1.1
     6Version: 1.2
    77Author: Russell Jamieson
    88Author URI: http://www.russelljamieson.com
  • captionpix/trunk/readme.txt

    r443668 r478789  
    55Requires at least: 2.8
    66Tested up to: 3.2.1
    7 Stable tag: 1.1
     7Stable tag: 1.2
    88
    99A WordPress image captioning plugin that makes it easy to align a framed and captioned image to the left, right or center of the page.
     
    3333== Changelog ==
    3434
     35= 1.2 = Add link to allow refresh of themes
     36
    3537= 1.1 = Force max-width on image to be 100%
    3638
     
    3941== Upgrade Notice ==
    4042
    41 = 1.1 =
    42 * Optional - fix for WordPress themes that restrict the image width
     43= 1.2 =
     44* Optional - add link to refresh list of available CaptinPix Themes
    4345
    4446
Note: See TracChangeset for help on using the changeset viewer.