Changeset 605758
- Timestamp:
- 09/29/2012 12:33:03 PM (13 years ago)
- Location:
- wpmu-linkmanager
- Files:
-
- 10 added
- 2 edited
-
tags/1.0.2 (added)
-
tags/1.0.2/delete.png (added)
-
tags/1.0.2/i18n (added)
-
tags/1.0.2/i18n/wplerlm-de_DE.mo (added)
-
tags/1.0.2/i18n/wplerlm-de_DE.po (added)
-
tags/1.0.2/i18n/wplerlm-de_DE.pot (added)
-
tags/1.0.2/pencil.png (added)
-
tags/1.0.2/readme.txt (added)
-
tags/1.0.2/uninstall.php (added)
-
tags/1.0.2/wpmu_linkmanager.php (added)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/wpmu_linkmanager.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wpmu-linkmanager/trunk/readme.txt
r605734 r605758 5 5 Requires at least: 3.4.2 6 6 Tested up to: 3.4.2 7 Stable tag: 1.0. 17 Stable tag: 1.0.2 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 56 56 == Changelog == 57 57 58 = 1.0.2 = 59 * Fix an error by saving new links into the table 60 * Fix an error by delete a link 61 * Fix an error for the conditional tags by printout the links 62 58 63 = 1.0.1 = 59 64 * Fix an error by activation & deactivation for creating the tables -
wpmu-linkmanager/trunk/wpmu_linkmanager.php
r605734 r605758 3 3 Plugin Name: WPMU LinkManager 4 4 Description: You works with a multisite and want manage your outgoing footer links into the themes of each blog? With this plugin you can manage into network admin your outgoing links for every registered blog into your multisite installation. 5 Version: 1.0. 15 Version: 1.0.2 6 6 Author: WPler 7 7 Author URI: http://www.wpler.com … … 191 191 $into[ 'linktext' ] = esc_attr( $_POST[ 'linktext' ] ); 192 192 $into[ 'linktitle' ] = esc_attr( $_POST[ 'linktitle' ] ); 193 $into[ 'wpcondition' ] = esc_attr( $_POST[ 'condition' ] );194 if ( isset ( $_GET[ 'linkid' ] ) && $wpdb->update( $wpdb->prefix . 'wplerlm', $into, array( 'link_id' => absint( $_GET[ 'linkid' ] ) ), array( '%d', '%s', '%s', '%s', '%s', '%s', '%s' ), array( '%d' ) ) ) {193 $into[ 'wpcondition' ] = $_POST[ 'condition' ]; 194 if ( !empty( $_POST[ 'linkid' ] ) && $wpdb->update( $wpdb->base_prefix . 'wplerlm', $into, array( 'link_id' => absint( $_POST[ 'linkid' ] ) ), array( '%d', '%s', '%s', '%s', '%s', '%s', '%s' ), array( '%d' ) ) ) { 195 195 printf( '<div class="updated">%s</div>', __( 'The Link are saved to the table', wplerlm::get_textdomain() ) ); 196 } elseif ( $wpdb->insert( $wpdb-> prefix . 'wplerlm', $into, array( '%d', '%s', '%s', '%s', '%s', '%s', '%s' ) ) !== FALSE ) {196 } elseif ( $wpdb->insert( $wpdb->base_prefix . 'wplerlm', $into, array( '%d', '%s', '%s', '%s', '%s', '%s', '%s' ) ) !== FALSE ) { 197 197 printf( '<div class="updated">%s</div>', __( 'The link are added to the table', wplerlm::get_textdomain() ) ); 198 198 } 199 } elseif ( !empty( $_GET[ 'linkid' ] ) && isset( $_GET[ 'delete' ] ) ) {200 $link = !$wpdb->get_col( $wpdb->prepare( "SELECT link_id FROM {$wpdb->prefix}wplerlm WHERE link_id = %d", $_GET[ 'linkid' ]), 0 );201 if ( !empty( $link ) && ( $link ->link_id== absint( $_GET[ 'linkid' ] ) ) ) {202 $wpdb->query( sprintf( "DELETE FROM {$wpdb-> prefix}wplerlm WHERE link_id = %d", $link->link_id) );203 $wpdb->query( "OPTIMIZE TABLE {$wpdb-> prefix}wplerlm" );199 } elseif ( !empty( $_GET[ 'linkid' ] ) && !empty( $_GET[ 'delete' ] ) ) { 200 $link = $wpdb->get_col( $wpdb->prepare( "SELECT link_id FROM {$wpdb->base_prefix}wplerlm WHERE link_id = %d", absint( $_GET[ 'linkid' ] ) ), 0 ); 201 if ( !empty( $link ) && ( $link[ 0 ] == absint( $_GET[ 'linkid' ] ) ) ) { 202 $wpdb->query( sprintf( "DELETE FROM {$wpdb->base_prefix}wplerlm WHERE link_id = %d", $link[ 0 ] ) ); 203 $wpdb->query( "OPTIMIZE TABLE {$wpdb->base_prefix}wplerlm" ); 204 204 printf( '<div class="updated">%s</div>', __( 'The Link was deleted', wplerlm::get_textdomain() ) ); 205 205 } 206 206 } elseif ( !empty( $_GET[ 'linkid' ] ) ) { 207 $link = $wpdb->get_row( $wpdb->prepare( "SELECT link_id, blog_id, tourl, rel, target, linktext, linktitle, wpcondition FROM {$wpdb-> prefix}wplerlm WHERE link_id = %d", absint( $_GET[ 'linkid' ] ) ) );207 $link = $wpdb->get_row( $wpdb->prepare( "SELECT link_id, blog_id, tourl, rel, target, linktext, linktitle, wpcondition FROM {$wpdb->base_prefix}wplerlm WHERE link_id = %d", absint( $_GET[ 'linkid' ] ) ) ); 208 208 $siteid = !empty( $link->blog_id ) ? absint( $link->blog_id ) : ''; 209 209 $target = !empty( $link->target ) ? $link->target : '_blank'; … … 213 213 <h2><span><?php _e( 'Add new link', wplerlm::get_textdomain()); ?></span></h2> 214 214 <form action="" method="post"> 215 <?php if ( !empty( $_GET[ 'linkid' ] ) ): ?> 216 <input type="hidden" name="linkid" value="<?php echo $_GET[ 'linkid' ]; ?>" /> 217 <?php endif; ?> 215 218 <table class="form-table"> 216 219 <tr> … … 275 278 if ( !empty( $links ) ) { 276 279 foreach( ( array ) $links as $link ) { 277 eval( '$show = ' . $link->wpcondition . ';' );280 eval( '$show = (' . $link->wpcondition . ');' ); 278 281 if ( !empty( $link->wpcondition ) && TRUE === $show ) { 279 282 printf( … … 282 285 !empty( $link->target ) ? esc_attr( $link->target ) : '_self', 283 286 !empty( $link->rel ) ? esc_attr( $link->rel ) : 'follow', 284 !empty( $link->linktitle ) ? esc_attr( $link->linkt tile ) : '',287 !empty( $link->linktitle ) ? esc_attr( $link->linktitle ) : '', 285 288 !empty( $link->linktext ) ? esc_attr( $link->linktext ) : 'Link' 286 289 );
Note: See TracChangeset
for help on using the changeset viewer.