Changeset 372130
- Timestamp:
- 04/12/2011 08:27:59 PM (15 years ago)
- Location:
- reflect/trunk
- Files:
-
- 2 edited
-
php/models.php (modified) (5 diffs)
-
reflect.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
reflect/trunk/php/models.php
r372069 r372130 2 2 3 3 function reflect_bullets_current() { 4 global $wpdb; 4 5 $table_name = $wpdb->prefix . "reflect_bullet_current"; 5 6 … … 21 22 22 23 function reflect_bullets_revision() { 24 global $wpdb; 23 25 $table_name = $wpdb->prefix . "reflect_bullet_revision"; 24 26 … … 46 48 47 49 function reflect_highlights() { 50 global $wpdb; 48 51 $table_name = $wpdb->prefix . "reflect_highlight"; 49 52 … … 64 67 65 68 function reflect_response_current() { 69 global $wpdb; 66 70 $table_name = $wpdb->prefix . "reflect_response_current"; 67 71 … … 84 88 85 89 function reflect_response_revision() { 90 global $wpdb; 86 91 $table_name = $wpdb->prefix . "reflect_response_revision"; 87 92 -
reflect/trunk/reflect.php
r372098 r372130 65 65 $reflect_db_version = "1.3"; 66 66 //include 'php/filters/reflect_comment_text.php'; 67 include 'php/filters/reflect_comment_author.php';68 include 'php/models.php';69 include 'php/options.php';67 require 'php/filters/reflect_comment_author.php'; 68 require 'php/models.php'; 69 require 'php/options.php'; 70 70 71 71 function update_or_activate() { … … 73 73 $installed_ver = get_option( "reflect_db_version" ); 74 74 75 $tables = array( 0 => "reflect_bullets_current ()",76 1 => "reflect_bullets_revision ()",77 2 => "reflect_highlights ()",78 3 => "reflect_response_current ()",79 4 => "reflect_response_revision ()" );75 $tables = array( 0 => "reflect_bullets_current", 76 1 => "reflect_bullets_revision", 77 2 => "reflect_highlights", 78 3 => "reflect_response_current", 79 4 => "reflect_response_revision" ); 80 80 81 foreach ($tables as $table_ def) {82 $table_def = eval( $table_def);81 foreach ($tables as $table_name) { 82 $table_def = eval("return $table_name();"); 83 83 _create_table($table_def["table_name"], $table_def["sql"], $installed_ver, $reflect_db_version); 84 84 } … … 117 117 function _create_table($table_name, $sql, $installed_ver, $latest_ver) { 118 118 global $wpdb; 119 119 120 error_log($table_name); 121 error_log($sql); 122 120 123 if ( $wpdb->get_var("SHOW TABLES LIKE '$table_name'") != $table_name) { 121 124 require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
Note: See TracChangeset
for help on using the changeset viewer.