Plugin Directory

Changeset 873981


Ignore:
Timestamp:
03/12/2014 11:52:05 AM (12 years ago)
Author:
lightsystem
Message:

version 0.5.3

Location:
rss-synchronization
Files:
25 added
6 edited

Legend:

Unmodified
Added
Removed
  • rss-synchronization/trunk/README.txt

    r871375 r873981  
    1 === RSS Synchronization ===
     1=== RSS Synchronisation ===
    22Contributors: LightSystem
    33Tags: RSS, plugin, wordpress
    44Requires at least: 3.8
    55Tested up to: 3.8.1
    6 Stable tag: 0.5.2
     6Stable tag: 0.5.3
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4646== Changelog ==
    4747
     48= 0.5.3 =
     49* Added option for toggling using thumbnails.
     50
    4851= 0.5.2 =
    4952* Added support to thumbnail/featured images in posts when 'Link to media gallery' is selected in the settings.
  • rss-synchronization/trunk/admin/class-rss-sync-admin.php

    r871328 r873981  
    3535     * Initialize the plugin by loading admin scripts & styles and adding a
    3636     * settings page and menu.
    37      *
    38      * @since     0.3.0
    3937     */
    4038    private function __construct() {
     
    6058        add_filter( 'plugin_action_links_' . $plugin_basename, array( $this, 'add_action_links' ) );
    6159
    62         /*
    63          * Define custom functionality.
    64          *
    65          * Read more about actions and filters:
    66          * http://codex.wordpress.org/Plugin_API#Hooks.2C_Actions_and_Filters
    67          */
    68         add_action( '@TODO', array( $this, 'action_method_name' ) );
    69         add_filter( '@TODO', array( $this, 'filter_method_name' ) );
    70 
    7160    }
    7261
    7362    /**
    7463     * Return an instance of this class.
    75      *
    76      * @since     1.0.0
    7764     *
    7865     * @return    object    A single instance of this class.
     
    9885     * Register and enqueue admin-specific style sheet.
    9986     *
    100      *
    101      * @since     0.3.0
    102      *
    10387     * @return    null    Return early if no settings page is registered.
    10488     */
     
    118102    /**
    119103     * Register and enqueue admin-specific JavaScript.
    120      *
    121      * @since     0.3.0
    122104     *
    123105     * @return    null    Return early if no settings page is registered.
     
    139121     * Register settings for use with this plugin.
    140122     *
    141      * @since    0.3.0
    142123     */
    143124    public function register_settings_admin_init() {
     
    150131     * Register the administration menu for this plugin into the WordPress Dashboard menu.
    151132     *
    152      * @since    0.3.0
    153133     */
    154134    public function add_plugin_admin_menu() {
     
    159139         * NOTE:  Alternative menu locations are available via WordPress administration menu functions.
    160140         *
    161          *        Administration Menus: http://codex.wordpress.org/Administration_Menus
     141         * Administration Menus: http://codex.wordpress.org/Administration_Menus
    162142         *
    163          *   For reference: http://codex.wordpress.org/Roles_and_Capabilities
     143         * For reference: http://codex.wordpress.org/Roles_and_Capabilities
    164144         */
    165145        $this->plugin_screen_hook_suffix = add_options_page(
     
    169149            $this->plugin_slug,
    170150            array( $this, 'display_plugin_admin_page' )
    171         );     
     151        );
    172152
    173153    }
     
    176156     * Render the settings page for this plugin.
    177157     *
    178      * @since    0.3.0
    179158     */
    180159    public function display_plugin_admin_page() {
    181160        include_once( 'views/admin.php' );
    182        
     161
    183162        RSS_Sync_AdminSettings::rss_sync_app_page();
    184163    }
     
    187166     * Add settings action link to the plugins page.
    188167     *
    189      * @since    1.0.0
    190168     */
    191169    public function add_action_links( $links ) {
  • rss-synchronization/trunk/admin/views/admin.php

    r871375 r873981  
    1818
    1919        register_setting( 'rss_sync', 'rss_sync', array( 'RSS_Sync_AdminSettings', 'options_validator' ) );
    20        
     20
    2121        add_settings_section( 'rss_sync_options',
    2222            __( 'General', 'rss-sync' ),
    2323            array( 'RSS_Sync_AdminSettings', 'rss_options' ),
    2424            'rss_sync' );
    25            
     25
    2626        add_settings_field( 'rss_sync_rss_feeds',
    2727            __( 'RSS Feeds', 'rss-sync' ),
     
    2929            'rss_sync',
    3030            'rss_sync_options' );
    31        
     31
    3232        add_settings_field( 'rss-sync-refresh',
    3333            __('Refresh Feed', 'rss-sync'),
     
    3636            'rss_sync_options' );
    3737
    38         add_settings_field( 'rss_sync_img_storage', 
    39             __('Image Storage', 'rss-sync'), 
    40             array('RSS_Sync_AdminSettings', 'image_storage_options'), 
    41             'rss_sync', 
     38        add_settings_field( 'rss_sync_img_storage',
     39            __('Image Storage', 'rss-sync'),
     40            array('RSS_Sync_AdminSettings', 'image_storage_options'),
     41            'rss_sync',
    4242            'rss_sync_options' );
    4343    }
    4444
    45     /* BEGIN APP SETTINGS FORM CALLBACKS */   
     45    /* BEGIN APP SETTINGS FORM CALLBACKS */
    4646    static function rss_sync_app_page () {
    4747        ?>
     
    6464        echo '<p>'; _e( 'General settings for the RSS Sync Plugin.', 'rss-sync' ); echo '</p>';
    6565    }
    66    
     66
    6767    function rss_feeds ()
    6868    {
    6969        $options = get_option( 'rss_sync' );
    70        
     70
    7171        ?><fieldset>
    7272            <legend class="screen-reader-text"><span><?php _e( 'RSS Feeds', 'rss-sync' ); ?></span></legend>
     
    102102    {
    103103        $options = get_option( 'rss_sync' );
    104         $stored_option = $options['img_storage'];
     104        $storage_option = $options['img_storage'];
     105        $thumb_option = $options['img_thumbnail'];
    105106
    106107        ?><fieldset>
    107108            <legend class="screen-reader-text"><span><?php _e( 'Image Storage', 'rss-sync' ); ?></span></legend>
    108109            <select id="image_storage_options" name="rss_sync[img_storage]">
    109                 <option value="hotlinking" <?php if($stored_option == 'hotlinking') echo 'selected' ?> > <?php _e('Use hotlinking', 'rss-sync') ?> </option>
    110                 <option value="local_storage" <?php if($stored_option == 'local_storage') echo 'selected' ?> > <?php _e('Link to media gallery', 'rss-sync') ?> </option>
     110                <option value="hotlinking" <?php if($storage_option == 'hotlinking') echo 'selected' ?> > <?php _e('Use hotlinking', 'rss-sync') ?> </option>
     111                <option value="local_storage" <?php if($storage_option == 'local_storage') echo 'selected' ?> > <?php _e('Link to media gallery', 'rss-sync') ?> </option>
    111112            </select>
    112113            <br/>
     
    114115                <?php _e("Note: For featured/thumbnail images to work in posts, choose 'Link to media gallery'"); ?>
    115116            </label>
     117            <br/>
     118            <p>
     119                <div id="thumb_options_set">
     120                <label>
     121                    <?php _e( 'Use thumbnails?', 'rss-sync' ); ?>&nbsp;
     122                    <input id="image_thumbnail_option" name="rss_sync[img_thumbnail]" type="checkbox" value="1" <?php checked( '1', $thumb_option ); ?> >
     123                </label>
     124                </div>
     125            </p>
    116126        </fieldset>
    117127        <?php
    118128    }
    119    
     129
    120130    static function options_validator ( $options )
    121131    {
     
    139149        }
    140150
     151        //checkbox
     152        if( 1 != $options['img_thumbnail'] )
     153            unset($existing['img_thumbnail']);
     154
    141155        return array_merge( $existing, $options );
    142156    }
    143    
     157
    144158    /* END APP SETTINGS FORM CALLBACKS */
    145159}
  • rss-synchronization/trunk/includes/class-rss-sync-tools.php

    r871375 r873981  
    1313
    1414/**
    15  * Utility class for alot of this plugin's useful methods used throughout the plugin code. 
     15 * Utility class for alot of this plugin's useful methods used throughout the plugin code.
    1616 *
    1717 * @package   RSS-Sync-Tools
     
    1919 */
    2020class RSS_Sync_Tools {
    21    
     21
    2222    /**
    2323     * Instance of this class.
     
    177177
    178178    /**
    179     * Handles creation and/or resolution of a category ID. 
    180     *   
     179    * Handles creation and/or resolution of a category ID.
     180    *
    181181    * @since    0.4.0
    182182    */
     
    193193
    194194    /**
    195     * Handles extraction of post tags from a list of RSS item categories. 
     195    * Handles extraction of post tags from a list of RSS item categories.
    196196    *
    197197    */
     
    335335            $this->url_remap[$headers['x-final-location']] = $upload['url'];
    336336                }
    337                        
     337
    338338        //add to media library
    339339        //Attachment options
     
    346346        $attach_data = wp_generate_attachment_metadata( $attach_id, $url );
    347347        wp_update_attachment_metadata( $attach_id, $attach_data );
    348         //Set as featured image
    349         set_post_thumbnail( $post_id, $attach_id );
     348        //Set as featured image?
     349        $options = get_option( 'rss_sync' );
     350        if($options['img_thumbnail'] == 'yes'){
     351            set_post_thumbnail( $post_id, $attach_id );
     352        }
    350353
    351354        return $upload;
  • rss-synchronization/trunk/public/class-rss-sync.php

    r871375 r873981  
    2929     * @var     string
    3030     */
    31     const VERSION = '0.5.2';
     31    const VERSION = '0.5.3';
    3232
    3333    const RSS_ID_CUSTOM_FIELD = 'rss_id';
     
    216216     * Fired for each blog when the plugin is activated.
    217217     *
    218      * @since    0.2.0
    219218     */
    220219    private static function single_activate() {
    221        
     220
    222221        $options = get_option( 'rss_sync' );
    223222
     
    236235     * Fired for each blog when the plugin is deactivated.
    237236     *
    238      * @since    0.2.0
    239237     */
    240238    private static function single_deactivate() {
    241        
     239
    242240        wp_clear_scheduled_hook( 'rss_sync_event' );
    243 
    244241    }
    245242
     
    247244     * Load the plugin text domain for translation.
    248245     *
    249      * @since    1.0.0
    250246     */
    251247    public function load_plugin_textdomain() {
     
    262258     * Register and enqueue public-facing style sheet.
    263259     *
    264      * @since    1.0.0
    265260     */
    266261    public function enqueue_styles() {
     
    271266     * Register and enqueues public-facing JavaScript files.
    272267     *
    273      * @since    1.0.0
    274268     */
    275269    public function enqueue_scripts() {
    276         wp_enqueue_script( $this->plugin_slug . '-plugin-script', plugins_url( 'assets/js/public.js', __FILE__ ), array( 'jquery' ), self::VERSION );
     270        //wp_enqueue_script( $this->plugin_slug . '-plugin-script', plugins_url( 'assets/js/public.js', __FILE__ ), array( 'jquery' ), self::VERSION );
    277271    }
    278272
  • rss-synchronization/trunk/rss-sync.php

    r871375 r873981  
    1313 * Plugin Name:       RSS Sync
    1414 * Description:       Synchronize posts with external RSS feed.
    15  * Version:           0.5.2
    16  * Author:            Horta
     15 * Version:           0.5.3
     16 * Author:            lightsystem, log_oscon
    1717 * Text Domain:       rss-sync
    1818 * License:           GPL-2.0+
Note: See TracChangeset for help on using the changeset viewer.