Viewing 2 replies - 1 through 2 (of 2 total)
  • The following patch fixes this:

    # HG changeset patch
    # User azps-l2
    # Date 1410849229 -3600
    #      Tue Sep 16 07:33:49 2014 +0100
    # Node ID c778dd03893286d9905fde0eda52eb2480c83a6a
    # Parent  8e866c96de36cf837a24deb44c766bf7dc19a54b
    fixes to get all the reports working
    
    diff -r 8e866c96de36 -r c778dd038932 external_links.php
    --- a/external_links.php	Tue Sep 16 07:32:31 2014 +0100
    +++ b/external_links.php	Tue Sep 16 07:33:49 2014 +0100
    @@ -38,10 +38,10 @@
     				$selection = 'ORDER BY ' . $s . ' ASC';
     			}
    
    -			$sql = "SELECT * FROM wp_mdp_gwt_external_links $selection";
    +			$sql = "SELECT * FROM {$wpdb->prefix}mdp_gwt_external_links $selection";
     		} else {
    
    -			$sql = "SELECT * FROM wp_mdp_gwt_external_links
    +			$sql = "SELECT * FROM {$wpdb->prefix}mdp_gwt_external_links
                                                 ORDER BY links + 0 DESC
                                             ";
     		}
    diff -r 8e866c96de36 -r c778dd038932 index.php
    --- a/index.php	Tue Sep 16 07:32:31 2014 +0100
    +++ b/index.php	Tue Sep 16 07:33:49 2014 +0100
    @@ -166,7 +166,7 @@
    
     			$sql_pages = "CREATE TABLE $table_name_pages (
     		                        id mediumint(9) NOT NULL AUTO_INCREMENT,
    -		                        query_id VARCHAR(1000) NOT NULL,
    +		                        query_id VARCHAR(255) NOT NULL,
     		                        query TEXT NOT NULL,
     		                        impressions VARCHAR(20) NOT NULL,
     		                        impressions_change VARCHAR(20) NOT NULL,
    @@ -184,7 +184,7 @@
    
     			$sql_queries = "CREATE TABLE $table_name_queries (
     		                        id mediumint(9) NOT NULL AUTO_INCREMENT,
    -		                        query_id VARCHAR(100) NOT NULL,
    +		                        query_id VARCHAR(255) NOT NULL,
     		                        query VARCHAR(255) NOT NULL,
     		                        impressions VARCHAR(20) NOT NULL,
     		                        impressions_change VARCHAR(20) NOT NULL,
    @@ -225,7 +225,7 @@
    
     			$sql_internal_links = "CREATE TABLE $table_name_internal_links (
     		                        id mediumint(9) NOT NULL AUTO_INCREMENT,
    -		                        target_pages VARCHAR(500) NOT NULL,
    +		                        target_pages VARCHAR(255) NOT NULL,
     		                        links VARCHAR(20) NOT NULL,
     		                        date datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
     		                        PRIMARY KEY id (id),
    diff -r 8e866c96de36 -r c778dd038932 internal_links.php
    --- a/internal_links.php	Tue Sep 16 07:32:31 2014 +0100
    +++ b/internal_links.php	Tue Sep 16 07:33:49 2014 +0100
    @@ -35,10 +35,10 @@
     				$selection = 'ORDER BY ' . $s . ' ASC';
     			}
    
    -			$sql = "SELECT * FROM wp_mdp_gwt_internal_links $selection";
    +			$sql = "SELECT * FROM {$wpdb->prefix}mdp_gwt_internal_links $selection";
     		} else {
    
    -			$sql = "SELECT * FROM wp_mdp_gwt_internal_links
    +			$sql = "SELECT * FROM {$wpdb->prefix}mdp_gwt_internal_links
                                                 ORDER BY links + 0 DESC
                                             ";
     		}
    diff -r 8e866c96de36 -r c778dd038932 keywords.php
    --- a/keywords.php	Tue Sep 16 07:32:31 2014 +0100
    +++ b/keywords.php	Tue Sep 16 07:33:49 2014 +0100
    @@ -41,10 +41,10 @@
     				$selection = 'ORDER BY ' . $s . ' ASC';
     			}
    
    -			$sql = "SELECT * FROM wp_mdp_gwt_keywords $selection";
    +			$sql = "SELECT * FROM {$wpdb->prefix}mdp_gwt_keywords $selection";
     		} else {
    
    -			$sql = "SELECT * FROM wp_mdp_gwt_keywords
    +			$sql = "SELECT * FROM {$wpdb->prefix}mdp_gwt_keywords
                                                 ORDER BY occurrences + 0 DESC
                                             ";
     		}
    diff -r 8e866c96de36 -r c778dd038932 pages.php
    --- a/pages.php	Tue Sep 16 07:32:31 2014 +0100
    +++ b/pages.php	Tue Sep 16 07:33:49 2014 +0100
    @@ -59,14 +59,14 @@
     				$selection = 'ORDER BY ' . $s . ' DESC';
     			}
    
    -			$sql = "SELECT * FROM wp_mdp_gwt_pages $selection";
    +			$sql = "SELECT * FROM {$wpdb->prefix}mdp_gwt_pages $selection";
     		} else {
    
    -			$sql = "SELECT * FROM wp_mdp_gwt_pages
    +			$sql = "SELECT * FROM {$wpdb->prefix}mdp_gwt_pages
                                                 ORDER BY impressions + 0 DESC
                                             ";
     		}
    -
    +		echo $sql;
     		if ($row_results = $wpdb->get_results($sql)):
     			foreach ($row_results as $row_result):?>
     				<tr>
    diff -r 8e866c96de36 -r c778dd038932 queries.php
    --- a/queries.php	Tue Sep 16 07:32:31 2014 +0100
    +++ b/queries.php	Tue Sep 16 07:33:49 2014 +0100
    @@ -63,10 +63,10 @@
     				$selection = 'ORDER BY ' . $s . ' DESC';
     			}
    
    -			$sql = "SELECT * FROM wp_mdp_gwt_query $selection";
    +			$sql = "SELECT * FROM {$wpdb->prefix}mdp_gwt_query $selection";
     		} else {
    
    -			$sql = "SELECT * FROM wp_mdp_gwt_query
    +			$sql = "SELECT * FROM {$wpdb->prefix}mdp_gwt_query
                                                 ORDER BY impressions + 0 DESC
                                             ";
     		}

    I’ve put my work on github: I’ve made quite a lot more changes. I’ve no idea if it will work for anywhere else, but it works on my WordPress 4.0 multisite installation

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Table names’ is closed to new replies.