Plugin Directory

Changeset 1506635


Ignore:
Timestamp:
10/01/2016 09:51:26 PM (10 years ago)
Author:
wassereimer
Message:

new version 4.0.1 for trunk

Location:
easy-code-placement/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • easy-code-placement/trunk/easy-code-placement.php

    r1506547 r1506635  
    44 * Text Domain: easy-code-placement
    55 * Domain Path: /lang
    6  * Version: 4.0
     6 * Version: 4.0.1
    77 * Plugin URI: http://www.randnotizen.org/easy-code-placement/
    88 * Author: Jens Herdy
     
    1414// standards
    1515define('ECP_FILE',__FILE__);
    16 define('ECP_VERSION','4.0');
     16define('ECP_VERSION','4.0.1');
    1717
    1818// load functions, classes
     
    2626add_filter( 'the_excerpt', 'do_shortcode', 99);
    2727add_filter( 'the_tags', 'do_shortcode', 99);
    28 
    29 // support for plugin All in One SEO Pack
    30 add_filter( 'aioseop_title', 'do_shortcode', 99);
    31 add_filter( 'aioseop_description', 'do_shortcode', 99);
    32 add_filter( 'aioseop_keywords', 'do_shortcode', 99);
    33 
    34 // support for plugin Yoast SEO
    35 add_filter( 'wpseo_title', 'do_shortcode', 99);
    36 add_filter( 'wpseo_metadesc', 'do_shortcode', 99);
    37 add_filter( 'wpseo_metakey', 'do_shortcode', 99);
    3828
    3929// load languages
  • easy-code-placement/trunk/inc/functions.php

    r1506547 r1506635  
    44//error_reporting(E_ALL);
    55//define( 'DIEONDBERROR', true ); // multisite
    6 //$wpdb->show_errors(); // single site
     6//wpdb->show_errors(); // single site
    77
    88// check if role >= option
     
    4949                    $code_load->code = ob_get_contents();
    5050                    ob_end_clean();
    51                 }               
     51                }             
    5252                // set alignment
    5353        if ($code_load->alignment === '0' OR $code_load->alignment === '') {
     
    8282        foreach ($blogids as $blogid) {
    8383            switch_to_blog($blogid);
    84             // if not updated to 3.2.1 still regenerate missing tables in multisite
     84            // if not updated yet to 3.2.1 still regenerate missing tables in multisite
    8585            ecp_install();
    86             $wpdb->query("UPDATE ".$wpdb->prefix."ecp_data SET version='4.0'");
    87             $wpdb->update($wpdb->prefix.'ecp_options', array( 'option_value' => '4.0' ), array( 'option_name' => 'version' ));
     86            $wpdb->query("UPDATE ".$wpdb->prefix."ecp_data SET version='4.0.1'");
     87            $wpdb->update($wpdb->prefix.'ecp_options', array( 'option_value' => '4.0.1' ), array( 'option_name' => 'version' ));
    8888        }
    8989    switch_to_blog($blog);
     
    9191        // single update
    9292        global $wpdb;
    93         $wpdb->query("UPDATE ".$wpdb->prefix."ecp_data SET version='4.0'");
    94         $wpdb->update($wpdb->prefix.'ecp_options', array( 'option_value' => '4.0' ), array( 'option_name' => 'version' ));
     93        $wpdb->query("UPDATE ".$wpdb->prefix."ecp_data SET version='4.0.1'");
     94        $wpdb->update($wpdb->prefix.'ecp_options', array( 'option_value' => '4.0.1' ), array( 'option_name' => 'version' ));
    9595    }
    9696}
     
    104104        return;
    105105    // check if we use the current version
    106     } elseif ($ecp_options_version === '4.0') {
     106    } elseif ($ecp_options_version === '4.0.1') {
    107107        return;
    108108    // if user is admin and we have an old version do the update
     
    124124    }
    125125    // front-end
    126     public function widget( $args, $instance ) {
     126    public function widget($args,$instance) {
    127127        // when no code selected output nothing
    128         if ( $instance['ecp_code'] === "nothing" ) {
     128        if ($instance['ecp_code'] === "nothing") {
    129129            echo '';
    130130        // otherwise output ecp code
    131131        } else {
    132             if ( array_key_exists('before_widget', $args) ) echo $args['before_widget'];
     132            // output border and design?
     133            if ($instance['ecp_display'] != "1") {
     134                if (array_key_exists('before_widget', $args)) echo $args['before_widget'];
     135            }
     136            // output
    133137            global $wpdb;
    134138            $ecp_output = ecp_replace($instance['ecp_code']);
    135139            echo $ecp_output;
    136             if ( array_key_exists('after_widget', $args) ) echo $args['after_widget'];
     140            // output border and design?
     141            if ($instance['ecp_display'] != "1") {
     142                if (array_key_exists('after_widget', $args)) echo $args['after_widget'];
     143            }
    137144        }
    138145    }
    139146    // back-end
    140     public function form( $instance ) {
    141         // load selected code er reset var
    142         if ( isset( $instance[ 'ecp_code' ] ) ) {
    143             $ecp_code = $instance[ 'ecp_code' ];
     147    public function form($instance) {
     148        // load selected options er reset all
     149        if (empty($instance['ecp_code'])) {
     150            $instance['ecp_code'] = 'nothing';
    144151        }
    145         else {
    146             $ecp_code = 0;
     152        if (empty($instance['ecp_display'])) {
     153            $instance['ecp_display'] = '0';
    147154        }
    148155        ?>
     
    150157            <label for="<?php echo $this->get_field_id( 'ecp_code' ); ?>"><?php _e( 'Code to Display:', 'easy-code-placement' ); ?></label><br>
    151158            <select id="<?php echo $this->get_field_id( 'ecp_code' ); ?>" name="<?php echo $this->get_field_name( 'ecp_code' ); ?>" style="width:100%;">
    152                 <option value="nothing"><?php _e( 'Please select a Code', 'easy-code-placement' ); ?></option>
     159                <option value="nothing" <?php selected( $instance['ecp_code'], 'nothing'); ?>><?php _e( 'Please select a Code', 'easy-code-placement' ); ?></option>
    153160                <?php
    154161                // get codes
     
    156163                $ecp_codes = $wpdb->get_results( "SELECT name FROM {$wpdb->prefix}ecp_data" );
    157164                // generate dropdown options
    158                 foreach( $ecp_codes as $ecp_codeitem ) {
    159                     $selected = ( $ecp_codeitem->name == $ecp_code ) ? 'selected' : '';
    160                     echo '<option value="' . $ecp_codeitem->name . '" ' . $selected . '>' . $ecp_codeitem->name . '</option>';
     165                foreach($ecp_codes as $ecp_codeitem) {
     166                    $selected = selected( $instance['ecp_code'], $ecp_codeitem->name);
     167                    echo '<option value="' . $ecp_codeitem->name . '"' . $selected . '>' . $ecp_codeitem->name . '</option>';
    161168                    }
    162169                ?>
    163170            </select>
    164171        </p>
     172        <p>
     173            <input class="checkbox" type="checkbox" value="1" <?php checked( '1', $instance['ecp_display'] ); ?> id="<?php echo $this->get_field_id('ecp_display'); ?>" name="<?php echo $this->get_field_name('ecp_display'); ?>">
     174            <label for="<?php echo $this->get_field_id('ecp_display'); ?>"><?php _e( 'Remove Borders and Design from Widget?', 'easy-code-placement' ); ?></label>
     175        </p>
    165176        <?php
    166177    }
     178
    167179    // save selected code in back-end
    168     public function update( $new_instance, $old_instance ) {
     180    public function update($new_instance, $old_instance) {
    169181        $instance = array();
    170         $instance['ecp_code'] = ( ! empty( $new_instance['ecp_code'] ) ) ? strip_tags( $new_instance['ecp_code'] ) : '';
     182        $instance['ecp_code'] = $new_instance['ecp_code'];
     183        $instance['ecp_display'] = $new_instance['ecp_display'];
    171184        return $instance;
    172185    }
  • easy-code-placement/trunk/lang/easy-code-placement-de_DE.po

    r1506547 r1506635  
    33"Project-Id-Version: Easy Code Placement\n"
    44"Report-Msgid-Bugs-To: \n"
    5 "POT-Creation-Date: 2016-10-01 17:37+0200\n"
    6 "PO-Revision-Date: 2016-10-01 17:40+0200\n"
     5"POT-Creation-Date: 2016-10-01 22:26+0200\n"
     6"PO-Revision-Date: 2016-10-01 22:27+0200\n"
    77"Last-Translator: Jens Herdy <[email protected]>\n"
    88"Language-Team: \n"
     
    239239msgstr "Füge einen Code ein wo immer du möchtest."
    240240
    241 #: ../inc/functions.php:150
     241#: ../inc/functions.php:157
    242242msgid "Code to Display:"
    243243msgstr "Code der angezeigt werden soll:"
    244244
    245 #: ../inc/functions.php:152
     245#: ../inc/functions.php:159
    246246msgid "Please select a Code"
    247247msgstr "Bitte wähle einen Code aus"
     248
     249#: ../inc/functions.php:174
     250msgid "Remove Borders and Design from Widget?"
     251msgstr "Rahmen und Design vom Widget entfernen?"
    248252
    249253#: ../inc/settings.php:15
  • easy-code-placement/trunk/lang/easy-code-placement.pot

    r1506547 r1506635  
    55"Project-Id-Version: Easy Code Placement\n"
    66"Report-Msgid-Bugs-To: \n"
    7 "POT-Creation-Date: 2016-10-01 17:37+0200\n"
     7"POT-Creation-Date: 2016-10-01 22:26+0200\n"
    88"POT-Revision-Date: Thu May 19 2016 17:08:44 GMT+0200 (Mitteleuropäische "
    99"Sommerzeit)\n"
     
    231231msgstr ""
    232232
    233 #: ../inc/functions.php:150
     233#: ../inc/functions.php:157
    234234msgid "Code to Display:"
    235235msgstr ""
    236236
    237 #: ../inc/functions.php:152
     237#: ../inc/functions.php:159
    238238msgid "Please select a Code"
     239msgstr ""
     240
     241#: ../inc/functions.php:174
     242msgid "Remove Borders and Design from Widget?"
    239243msgstr ""
    240244
  • easy-code-placement/trunk/readme.txt

    r1506547 r1506635  
    22Contributors: wassereimer
    33Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2X2EH5MYGPLL4
    4 Tags: ad, add, addthis, ads, adsense, adsense plugin, advertising, affilimatch, affilinet, align, alignment, all in one seo pack, amazon associates, any, audio, clicksor, code, codes, css, easy, flash, google, google adsense, html, infolinks, insert, java, javascript, multisite, network, offline, online, page, pages, php, place, placement, plugin, post, posts, seo, shortcode, shortcodes, snippet, snippets, text, video, widget, yoast, yoast seo
     4Tags: ad, add, addthis, ads, adsense, adsense plugin, advertising, affilimatch, affilinet, align, alignment, amazon associates, any, audio, clicksor, code, codes, css, easy, flash, google, google adsense, html, infolinks, insert, java, javascript, keyword, keywords, multisite, network, offline, online, page, pages, php, place, placement, plugin, post, posts, shortcode, shortcodes, snippet, snippets, tag, tags, text, title, video, widget
    55Requires at least: 4.0
    66Tested up to: 4.6.1
    7 Stable tag: 4.0
     7Stable tag: 4.0.1
    88License: GPLv3
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    2929
    3030* Widget Area
    31 * Title of Posts and Pages
     31* Title of Posts and Pages (only Text and without alignement)
    3232* Content of Posts and Pages
    3333* Menu (In Link-Text and Url must be "#")
    34 * All in One SEO Pack (Title, Description, Keywords)
    35 * Yoast SEO (Title, Description, Keywords)
    3634* Tags
    3735* Excerpts
     
    4442* Place a Code with a Shortcode
    4543* Place a Code with the own Widget
     44* Remove Borders and the Design from the Widget (for example to use a Tracking Code that does not Display anything)
    4645* Place a Code with the standard WordPress Text-Widget
    4746* Choose who can manage the Plugin (Admin/Editor/Author/Contributor)
     
    9291
    9392== Changelog ==
     93
     94= 4.0.1 =
     95* 01.10.2016
     96* Removed support for Yoast SEO Plugin fields
     97* Removed support for All in One SEO Pack Plugin fields
     98* Added the ability to disable the Design and Borders of the Widget (for example to use a Tracking Code that does not Display anything)
     99* Fixed a Problem with undefined Indexes when creating a Widget
    94100
    95101= 4.0 =
Note: See TracChangeset for help on using the changeset viewer.