Changeset 1506635
- Timestamp:
- 10/01/2016 09:51:26 PM (10 years ago)
- Location:
- easy-code-placement/trunk
- Files:
-
- 6 edited
-
easy-code-placement.php (modified) (3 diffs)
-
inc/functions.php (modified) (8 diffs)
-
lang/easy-code-placement-de_DE.mo (modified) (previous)
-
lang/easy-code-placement-de_DE.po (modified) (2 diffs)
-
lang/easy-code-placement.pot (modified) (2 diffs)
-
readme.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
easy-code-placement/trunk/easy-code-placement.php
r1506547 r1506635 4 4 * Text Domain: easy-code-placement 5 5 * Domain Path: /lang 6 * Version: 4.0 6 * Version: 4.0.1 7 7 * Plugin URI: http://www.randnotizen.org/easy-code-placement/ 8 8 * Author: Jens Herdy … … 14 14 // standards 15 15 define('ECP_FILE',__FILE__); 16 define('ECP_VERSION','4.0 ');16 define('ECP_VERSION','4.0.1'); 17 17 18 18 // load functions, classes … … 26 26 add_filter( 'the_excerpt', 'do_shortcode', 99); 27 27 add_filter( 'the_tags', 'do_shortcode', 99); 28 29 // support for plugin All in One SEO Pack30 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 SEO35 add_filter( 'wpseo_title', 'do_shortcode', 99);36 add_filter( 'wpseo_metadesc', 'do_shortcode', 99);37 add_filter( 'wpseo_metakey', 'do_shortcode', 99);38 28 39 29 // load languages -
easy-code-placement/trunk/inc/functions.php
r1506547 r1506635 4 4 //error_reporting(E_ALL); 5 5 //define( 'DIEONDBERROR', true ); // multisite 6 // $wpdb->show_errors(); // single site6 //wpdb->show_errors(); // single site 7 7 8 8 // check if role >= option … … 49 49 $code_load->code = ob_get_contents(); 50 50 ob_end_clean(); 51 } 51 } 52 52 // set alignment 53 53 if ($code_load->alignment === '0' OR $code_load->alignment === '') { … … 82 82 foreach ($blogids as $blogid) { 83 83 switch_to_blog($blogid); 84 // if not updated to 3.2.1 still regenerate missing tables in multisite84 // if not updated yet to 3.2.1 still regenerate missing tables in multisite 85 85 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' )); 88 88 } 89 89 switch_to_blog($blog); … … 91 91 // single update 92 92 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' )); 95 95 } 96 96 } … … 104 104 return; 105 105 // check if we use the current version 106 } elseif ($ecp_options_version === '4.0 ') {106 } elseif ($ecp_options_version === '4.0.1') { 107 107 return; 108 108 // if user is admin and we have an old version do the update … … 124 124 } 125 125 // front-end 126 public function widget( $args, $instance) {126 public function widget($args,$instance) { 127 127 // when no code selected output nothing 128 if ( $instance['ecp_code'] === "nothing") {128 if ($instance['ecp_code'] === "nothing") { 129 129 echo ''; 130 130 // otherwise output ecp code 131 131 } 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 133 137 global $wpdb; 134 138 $ecp_output = ecp_replace($instance['ecp_code']); 135 139 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 } 137 144 } 138 145 } 139 146 // back-end 140 public function form( $instance) {141 // load selected code er reset var142 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'; 144 151 } 145 else{146 $ ecp_code = 0;152 if (empty($instance['ecp_display'])) { 153 $instance['ecp_display'] = '0'; 147 154 } 148 155 ?> … … 150 157 <label for="<?php echo $this->get_field_id( 'ecp_code' ); ?>"><?php _e( 'Code to Display:', 'easy-code-placement' ); ?></label><br> 151 158 <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> 153 160 <?php 154 161 // get codes … … 156 163 $ecp_codes = $wpdb->get_results( "SELECT name FROM {$wpdb->prefix}ecp_data" ); 157 164 // 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>'; 161 168 } 162 169 ?> 163 170 </select> 164 171 </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> 165 176 <?php 166 177 } 178 167 179 // save selected code in back-end 168 public function update( $new_instance, $old_instance) {180 public function update($new_instance, $old_instance) { 169 181 $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']; 171 184 return $instance; 172 185 } -
easy-code-placement/trunk/lang/easy-code-placement-de_DE.po
r1506547 r1506635 3 3 "Project-Id-Version: Easy Code Placement\n" 4 4 "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" 7 7 "Last-Translator: Jens Herdy <[email protected]>\n" 8 8 "Language-Team: \n" … … 239 239 msgstr "Füge einen Code ein wo immer du möchtest." 240 240 241 #: ../inc/functions.php:15 0241 #: ../inc/functions.php:157 242 242 msgid "Code to Display:" 243 243 msgstr "Code der angezeigt werden soll:" 244 244 245 #: ../inc/functions.php:15 2245 #: ../inc/functions.php:159 246 246 msgid "Please select a Code" 247 247 msgstr "Bitte wähle einen Code aus" 248 249 #: ../inc/functions.php:174 250 msgid "Remove Borders and Design from Widget?" 251 msgstr "Rahmen und Design vom Widget entfernen?" 248 252 249 253 #: ../inc/settings.php:15 -
easy-code-placement/trunk/lang/easy-code-placement.pot
r1506547 r1506635 5 5 "Project-Id-Version: Easy Code Placement\n" 6 6 "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" 8 8 "POT-Revision-Date: Thu May 19 2016 17:08:44 GMT+0200 (Mitteleuropäische " 9 9 "Sommerzeit)\n" … … 231 231 msgstr "" 232 232 233 #: ../inc/functions.php:15 0233 #: ../inc/functions.php:157 234 234 msgid "Code to Display:" 235 235 msgstr "" 236 236 237 #: ../inc/functions.php:15 2237 #: ../inc/functions.php:159 238 238 msgid "Please select a Code" 239 msgstr "" 240 241 #: ../inc/functions.php:174 242 msgid "Remove Borders and Design from Widget?" 239 243 msgstr "" 240 244 -
easy-code-placement/trunk/readme.txt
r1506547 r1506635 2 2 Contributors: wassereimer 3 3 Donate 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, a ll 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 seo4 Tags: 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 5 5 Requires at least: 4.0 6 6 Tested up to: 4.6.1 7 Stable tag: 4.0 7 Stable tag: 4.0.1 8 8 License: GPLv3 9 9 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 29 29 30 30 * Widget Area 31 * Title of Posts and Pages 31 * Title of Posts and Pages (only Text and without alignement) 32 32 * Content of Posts and Pages 33 33 * Menu (In Link-Text and Url must be "#") 34 * All in One SEO Pack (Title, Description, Keywords)35 * Yoast SEO (Title, Description, Keywords)36 34 * Tags 37 35 * Excerpts … … 44 42 * Place a Code with a Shortcode 45 43 * 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) 46 45 * Place a Code with the standard WordPress Text-Widget 47 46 * Choose who can manage the Plugin (Admin/Editor/Author/Contributor) … … 92 91 93 92 == 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 94 100 95 101 = 4.0 =
Note: See TracChangeset
for help on using the changeset viewer.