Changeset 1501662
- Timestamp:
- 09/23/2016 11:49:11 PM (10 years ago)
- Location:
- easy-code-placement/trunk
- Files:
-
- 1 deleted
- 6 edited
-
easy-code-placement.php (modified) (2 diffs)
-
inc/classes (deleted)
-
inc/content.php (modified) (1 diff)
-
inc/functions.php (modified) (4 diffs)
-
inc/install.php (modified) (2 diffs)
-
inc/uninstall.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
easy-code-placement/trunk/easy-code-placement.php
r1420409 r1501662 4 4 * Text Domain: easy-code-placement 5 5 * Domain Path: /lang 6 * Version: 3.2 6 * Version: 3.2.1 7 7 * Plugin URI: http://www.randnotizen.org/easy-code-placement/ 8 8 * Author: Jens Herdy … … 15 15 ob_start(); 16 16 define('ECP_FILE',__FILE__); 17 define('ECP_VERSION','3.2 ');17 define('ECP_VERSION','3.2.1'); 18 18 19 19 // load functions, classes -
easy-code-placement/trunk/inc/content.php
r1420409 r1501662 9 9 $ecp_codes = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}ecp_data LIMIT $ecp_calc, $ecp_perpage" ); 10 10 $ecp_num_pages = ceil( $ecp_total_rows / $ecp_perpage ); 11 12 // generate var to get back on correct page after changing something 13 if ($ecp_pagenum != '1') { 14 $ecp_sendpage = '&pagenum='.$ecp_pagenum.''; 15 } else { 16 $ecp_sendpage = ''; 17 } 11 $ecp_sendpage = '&pagenum='.$ecp_pagenum.''; 18 12 19 13 $ecp_pagination = paginate_links( array( -
easy-code-placement/trunk/inc/functions.php
r1420409 r1501662 77 77 } 78 78 79 // update to 3.2 79 // update to 3.2.1 80 80 function ecp_update(){ 81 81 // multiside update … … 86 86 foreach ($blogids as $blogid) { 87 87 switch_to_blog($blogid); 88 $wpdb->query("ALTER TABLE ".$wpdb->prefix."ecp_data ADD COLUMN added TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER status"); 89 $wpdb->query("ALTER TABLE ".$wpdb->prefix."ecp_data ADD COLUMN changed TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER added"); 90 $wpdb->query("UPDATE ".$wpdb->prefix."ecp_data SET version='3.2'"); 91 $wpdb->update($wpdb->prefix.'ecp_options', array( 'option_value' => '3.2' ), array( 'option_name' => 'version' )); 88 ecp_install(); 89 $wpdb->query("UPDATE ".$wpdb->prefix."ecp_data SET version='3.2.1'"); 90 $wpdb->update($wpdb->prefix.'ecp_options', array( 'option_value' => '3.2.1' ), array( 'option_name' => 'version' )); 92 91 } 93 92 switch_to_blog($blog); 94 } else { 95 // single update 96 global $wpdb; 97 $wpdb->query("ALTER TABLE ".$wpdb->prefix."ecp_data ADD COLUMN added TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER status"); 98 $wpdb->query("ALTER TABLE ".$wpdb->prefix."ecp_data ADD COLUMN changed TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER added"); 99 $wpdb->query("UPDATE ".$wpdb->prefix."ecp_data SET version='3.2'"); 100 $wpdb->update($wpdb->prefix.'ecp_options', array( 'option_value' => '3.2' ), array( 'option_name' => 'version' )); 93 } else { 94 // single update 95 global $wpdb; 96 $wpdb->query("UPDATE ".$wpdb->prefix."ecp_data SET version='3.2.1'"); 97 $wpdb->update($wpdb->prefix.'ecp_options', array( 'option_value' => '3.2.1' ), array( 'option_name' => 'version' )); 101 98 } 102 99 } … … 108 105 if (! is_admin()) { 109 106 return; 110 } elseif ($ecp_options_version === '3.2 ') {107 } elseif ($ecp_options_version === '3.2.1') { 111 108 return; 112 109 } else { … … 116 113 } 117 114 118 // add tables and data in it when a new blog is created119 function ecp_new_blog($blog_id) {120 if ( is_plugin_active_for_network( 'easy-code-placement/easy-code-placement.php' ) ) {121 switch_to_blog($blog_id);122 ecp_install();123 restore_current_blog();124 }125 }126 127 // tell wordpress what to do when adding a new blog128 add_action ( 'wpmu_new_blog', 'ecp_new_blog', 99 );129 130 // delete tables and data when a blog is deleted131 function ecp_deleted_blog($tables) {132 global $wpdb;133 $tables[] = $wpdb->prefix.'ecp_options';134 $tables[] = $wpdb->prefix.'ecp_data';135 return $tables;136 }137 add_filter ( 'wpmu_drop_tables', 'ecp_deleted_blog', 99 );138 139 115 ?> -
easy-code-placement/trunk/inc/install.php
r1420409 r1501662 32 32 // multiside or single installation? 33 33 function ecp_net_inst($networkwide) { 34 // check if an installation already exist35 34 global $wpdb; 36 $ecp_find = $wpdb->prefix.'ecp_options'; 37 if($wpdb->get_var("SHOW TABLES LIKE '$ecp_find'") != $ecp_find) { 38 // multiside installation 39 if (is_multisite() && $networkwide) { 40 $blog = $wpdb->blogid; 41 $blogids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs"); 42 foreach ($blogids as $blogid) { 43 switch_to_blog($blogid); 44 ecp_install(); 45 } 46 switch_to_blog($blog); 47 } else { 35 // multiside installation 36 if (is_multisite() && $networkwide) { 37 $blog = $wpdb->blogid; 38 $blogids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs"); 39 foreach ($blogids as $blogid) { 40 switch_to_blog($blogid); 41 ecp_install(); 42 } 43 switch_to_blog($blog); 44 } else { 48 45 // single installation 49 46 ecp_install(); 50 }51 47 } 52 48 } … … 55 51 register_activation_hook ( ECP_FILE, 'ecp_net_inst' ); 56 52 53 // add tables and data in it when a new blog is created 54 function ecp_new_blog($blog_id) { 55 if ( is_plugin_active_for_network( 'easy-code-placement/easy-code-placement.php' ) ) { 56 switch_to_blog($blog_id); 57 ecp_install(); 58 restore_current_blog(); 59 } 60 } 61 62 // tell wordpress what to do when adding a new blog 63 add_action ( 'wpmu_new_blog', 'ecp_new_blog', 99 ); 64 57 65 ?> -
easy-code-placement/trunk/inc/uninstall.php
r1227126 r1501662 30 30 register_uninstall_hook ( ECP_FILE, 'ecp_net_uninstall' ); 31 31 32 // delete tables and data when a blog is deleted 33 function ecp_deleted_blog($tables) { 34 global $wpdb; 35 $tables[] = $wpdb->prefix.'ecp_options'; 36 $tables[] = $wpdb->prefix.'ecp_data'; 37 return $tables; 38 } 39 add_filter ( 'wpmu_drop_tables', 'ecp_deleted_blog', 99 ); 40 32 41 ?> -
easy-code-placement/trunk/readme.txt
r1420409 r1501662 4 4 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, multisite, network, offline, online, page, pages, php, place, placement, plugin, post, posts, shortcode, shortcodes, snippet, snippets, text, video, widget 5 5 Requires at least: 3.0.1 6 Tested up to: 4. 5.27 Stable tag: 3.2 6 Tested up to: 4.6.1 7 Stable tag: 3.2.1 8 8 License: GPLv3 9 9 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 83 83 == Changelog == 84 84 85 = 3.2.1 = 86 * 23.09.2016 87 * Compatibility check for WordPress Version 4.6.1 88 * Fixed a Problem where the Back Button didn´t work 89 * Fixed an Error which caused that the Plugin didn´t work on Network-Sites 90 85 91 = 3.2 = 86 92 * 19.05.2016
Note: See TracChangeset
for help on using the changeset viewer.