Changeset 6053
- Timestamp:
- 05/24/06 11:14:07 (2 years ago)
- Files:
-
- wp-dbmanager/trunk/dbmanager/database-backup.php (modified) (2 diffs)
- wp-dbmanager/trunk/dbmanager/database-config.php (modified) (1 diff)
- wp-dbmanager/trunk/dbmanager/database-empty.php (modified) (5 diffs)
- wp-dbmanager/trunk/dbmanager/database-manage.php (modified) (3 diffs)
- wp-dbmanager/trunk/dbmanager/database-manager.php (modified) (2 diffs)
- wp-dbmanager/trunk/dbmanager/database-optimize.php (modified) (5 diffs)
- wp-dbmanager/trunk/dbmanager/database-run.php (modified) (2 diffs)
- wp-dbmanager/trunk/dbmanager/dbmanager.php (modified) (3 diffs)
- wp-dbmanager/trunk/readme-install.txt (deleted)
- wp-dbmanager/trunk/readme-upgrade.txt (deleted)
- wp-dbmanager/trunk/readme.html (added)
- wp-dbmanager/trunk/readme.txt (deleted)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
wp-dbmanager/trunk/dbmanager/database-backup.php
r6018 r6053 3 3 +----------------------------------------------------------------+ 4 4 | | 5 | WordPress 2.0 Plugin: WP-DBManager 2.0 4|5 | WordPress 2.0 Plugin: WP-DBManager 2.05 | 6 6 | Copyright (c) 2005 Lester "GaMerZ" Chan | 7 7 | | … … 189 189 </tr> 190 190 <tr> 191 <td colspan="2" align="center"><input type="submit" name="do" value="Backup" class="button" /> <input type="button" name="cancel" Value="<?php _e('Cancel'); ?>" class="button" onclick="javascript:history.go(-1)" /></td>191 <td colspan="2" align="center"><input type="submit" name="do" value="Backup" class="button" /> <input type="button" name="cancel" value="<?php _e('Cancel'); ?>" class="button" onclick="javascript:history.go(-1)" /></td> 192 192 </tr> 193 193 </table> wp-dbmanager/trunk/dbmanager/database-config.php
r6018 r6053 3 3 +----------------------------------------------------------------+ 4 4 | | 5 | WordPress 2.0 Plugin: WP-DBManager 2.0 4|5 | WordPress 2.0 Plugin: WP-DBManager 2.05 | 6 6 | Copyright (c) 2005 Lester "GaMerZ" Chan | 7 7 | | wp-dbmanager/trunk/dbmanager/database-empty.php
r6018 r6053 3 3 +----------------------------------------------------------------+ 4 4 | | 5 | WordPress 2.0 Plugin: WP-DBManager 2.0 4|5 | WordPress 2.0 Plugin: WP-DBManager 2.05 | 6 6 | Copyright (c) 2005 Lester "GaMerZ" Chan | 7 7 | | … … 59 59 60 60 ### Show Tables 61 $tables = $wpdb->get_ results("SHOW TABLES");61 $tables = $wpdb->get_col("SHOW TABLES"); 62 62 ?> 63 63 <?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?> … … 73 73 </tr> 74 74 <?php 75 foreach($tables as $ dbtable) {75 foreach($tables as $table_name) { 76 76 if($no%2 == 0) { 77 77 $style = 'style=\'background-color: #eee\''; … … 80 80 } 81 81 $no++; 82 $table_name = '$dbtable->Tables_in_'.DB_NAME;83 eval("\$table_name = \"$table_name\";");84 82 echo "<tr $style><th align=\"left\" scope=\"row\">$table_name</th>\n"; 85 83 echo "<td><input type=\"radio\" name=\"emptydrop[$table_name]\" value=\"empty\" /> Empty</td>"; … … 91 89 </tr> 92 90 <tr> 93 <td colspan="3" align="center"><input type="submit" name="do" value="Empty/Drop" class="button" onclick="return confirm('You Are About To Empty Or Drop The Selected Databases.\nThis Action Is Not Reversible.\n\n Choose \'Cancel\' to stop, \'OK\' to delete.')" /> <input type="button" name="cancel" Value="<?php _e('Cancel'); ?>" class="button" onclick="javascript:history.go(-1)" /></td>91 <td colspan="3" align="center"><input type="submit" name="do" value="Empty/Drop" class="button" onclick="return confirm('You Are About To Empty Or Drop The Selected Databases.\nThis Action Is Not Reversible.\n\n Choose \'Cancel\' to stop, \'OK\' to delete.')" /> <input type="button" name="cancel" value="<?php _e('Cancel'); ?>" class="button" onclick="javascript:history.go(-1)" /></td> 94 92 </tr> 95 93 </table> wp-dbmanager/trunk/dbmanager/database-manage.php
r6018 r6053 3 3 +----------------------------------------------------------------+ 4 4 | | 5 | WordPress 2.0 Plugin: WP-DBManager 2.0 4|5 | WordPress 2.0 Plugin: WP-DBManager 2.05 | 6 6 | Copyright (c) 2005 Lester "GaMerZ" Chan | 7 7 | | … … 16 16 +----------------------------------------------------------------+ 17 17 */ 18 19 20 ### Download Database21 if(!empty($_GET['file'])) {22 require_once('../../../wp-config.php');23 auth_redirect();24 if(strpos($_SERVER['HTTP_REFERER'], get_settings('siteurl').'/wp-admin/admin.php?page=dbmanager/database-manage.php') !== false) {25 $backup_options = get_settings('dbmanager_options');26 $file_path = $backup_options['path'].'/'.$_GET['file'];27 header("Pragma: public");28 header("Expires: 0");29 header("Cache-Control: must-revalidate, post-check=0, pre-check=0");30 header("Content-Type: application/force-download");31 header("Content-Type: application/octet-stream");32 header("Content-Type: application/download");33 header("Content-Disposition: attachment; filename=".basename($file_path).";");34 header("Content-Transfer-Encoding: binary");35 header("Content-Length: ".filesize($file_path));36 @readfile($file_path);37 }38 exit();39 }40 18 41 19 … … 198 176 </tr> 199 177 <tr> 200 <td colspan="5" align="center"><input type="submit" name="do" value="Download" class="button" /> <input type="submit" name="do" value="Restore" onclick="return confirm('You Are About To Restore A Database.\nThis Action Is Not Reversible.\nAny Data Inserted After The Backup Date Will Be Gone.\n\n Choose \'Cancel\' to stop, \'OK\' to restore.')" class="button" /> <input type="submit" class="button" name="do" value="Delete" onclick="return confirm('You Are About To Delete The Selected Database Backup Files.\nThis Action Is Not Reversible.\n\n Choose \'Cancel\' to stop, \'OK\' to delete.')" /> <input type="button" name="cancel" Value="<?php _e('Cancel'); ?>" class="button" onclick="javascript:history.go(-1)" /></td>178 <td colspan="5" align="center"><input type="submit" name="do" value="Download" class="button" /> <input type="submit" name="do" value="Restore" onclick="return confirm('You Are About To Restore A Database.\nThis Action Is Not Reversible.\nAny Data Inserted After The Backup Date Will Be Gone.\n\n Choose \'Cancel\' to stop, \'OK\' to restore.')" class="button" /> <input type="submit" class="button" name="do" value="Delete" onclick="return confirm('You Are About To Delete The Selected Database Backup Files.\nThis Action Is Not Reversible.\n\n Choose \'Cancel\' to stop, \'OK\' to delete.')" /> <input type="button" name="cancel" value="<?php _e('Cancel'); ?>" class="button" onclick="javascript:history.go(-1)" /></td> 201 179 </tr> 202 180 </table> wp-dbmanager/trunk/dbmanager/database-manager.php
r6018 r6053 78 78 } 79 79 $no++; 80 echo "<tr $style>\n<td>$no</td>\n"; 80 echo "<tr $style>\n"; 81 echo "<td>$no</td>\n"; 81 82 echo "<td>$tablestatus->Name</td>\n"; 82 83 echo "<td>".number_format($tablestatus->Rows)."</td>\n"; … … 88 89 $index_usage += $tablestatus->Index_length; 89 90 $overhead_usage += $tablestatus->Data_free; 90 } 91 echo "<tr><th align=\"left\" scope=\"row\">Total:</th>\n"; 91 echo "</tr>\n"; 92 } 93 echo "<tr>\n"; 94 echo "<th align=\"left\" scope=\"row\">Total:</th>\n"; 92 95 echo "<th align=\"left\" scope=\"row\">$no Tables</th>\n"; 93 96 echo "<th align=\"left\" scope=\"row\">".number_format($row_usage)."</th>\n"; 94 97 echo "<th align=\"left\" scope=\"row\">".format_size($data_usage)."</th>\n"; 95 98 echo "<th align=\"left\" scope=\"row\">".format_size($index_usage)."</th>"; 96 echo "<th align=\"left\" scope=\"row\">".format_size($overhead_usage)."</th></tr>"; 99 echo "<th align=\"left\" scope=\"row\">".format_size($overhead_usage)."</th>"; 100 echo "</tr>"; 97 101 } else { 98 102 echo '<tr><td colspan="6" align="center"><b>Could Not Show Table Status Due To Your MYSQL Version Is Lower Than 3.23.</b></td></tr>'; wp-dbmanager/trunk/dbmanager/database-optimize.php
r6018 r6053 3 3 +----------------------------------------------------------------+ 4 4 | | 5 | WordPress 2.0 Plugin: WP-DBManager 2.0 4|5 | WordPress 2.0 Plugin: WP-DBManager 2.05 | 6 6 | Copyright (c) 2005 Lester "GaMerZ" Chan | 7 7 | | … … 54 54 55 55 ### Show Tables 56 $tables = $wpdb->get_ results("SHOW TABLES");56 $tables = $wpdb->get_col("SHOW TABLES"); 57 57 ?> 58 58 <?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?> … … 67 67 </tr> 68 68 <?php 69 foreach($tables as $ dbtable) {69 foreach($tables as $table_name) { 70 70 if($no%2 == 0) { 71 71 $style = 'style=\'background-color: #eee\''; … … 74 74 } 75 75 $no++; 76 $table_name = '$dbtable->Tables_in_'.DB_NAME;77 eval("\$table_name = \"$table_name\";");78 76 echo "<tr $style><th align=\"left\" scope=\"row\">$table_name</th>\n"; 79 77 echo "<td><input type=\"radio\" name=\"optimize[$table_name]\" value=\"no\" />No <input type=\"radio\" name=\"optimize[$table_name]\" value=\"yes\" checked=\"checked\" />Yes</td></tr>"; … … 84 82 </tr> 85 83 <tr> 86 <td colspan="2" align="center"><input type="submit" name="do" value="Optimize" class="button" /> <input type="button" name="cancel" Value="<?php _e('Cancel'); ?>" class="button" onclick="javascript:history.go(-1)" /></td>84 <td colspan="2" align="center"><input type="submit" name="do" value="Optimize" class="button" /> <input type="button" name="cancel" value="<?php _e('Cancel'); ?>" class="button" onclick="javascript:history.go(-1)" /></td> 87 85 </tr> 88 86 </table> wp-dbmanager/trunk/dbmanager/database-run.php
r6018 r6053 3 3 +----------------------------------------------------------------+ 4 4 | | 5 | WordPress 2.0 Plugin: WP-DBManager 2.0 4|5 | WordPress 2.0 Plugin: WP-DBManager 2.05 | 6 6 | Copyright (c) 2005 Lester "GaMerZ" Chan | 7 7 | | … … 74 74 <p><b>Seperate Multiple Queries With A New Line</b><br /><font color="green">Use Only INSERT, UPDATE, REPLACE, DELETE, CREATE and ALTER statements.</font></p> 75 75 <p align="center"><textarea cols="120" rows="30" name="sql_query"></textarea></p> 76 <p align="center"><input type="submit" name="do" Value="Run" class="button" /> <input type="button" name="cancel" Value="<?php _e('Cancel'); ?>" class="button" onclick="javascript:history.go(-1)" /></p>76 <p align="center"><input type="submit" name="do" value="Run" class="button" /> <input type="button" name="cancel" value="<?php _e('Cancel'); ?>" class="button" onclick="javascript:history.go(-1)" /></p> 77 77 <p>1. CREATE statement will return an error, which is perfectly normal due to the database class. To confirm that your table has been created check the Manage Database page.<br />2. UPDATE statement may return an error sometimes due to the newly updated value being the same as the previous value.<br />3. ALTER statement will return an error because there is no value returned.</p> 78 78 </form> wp-dbmanager/trunk/dbmanager/dbmanager.php
r6018 r6053 4 4 Plugin URI: http://www.lesterchan.net/portfolio/programming.php 5 5 Description: Manages your Wordpress database. Allows you to optimizee, backup, restore, delete backup database and run selected queries. 6 Version: 2.0 46 Version: 2.05 7 7 Author: GaMerZ 8 8 Author URI: http://www.lesterchan.net … … 10 10 11 11 12 /* Copyright 200 5Lester Chan (email : gamerz84@hotmail.com)12 /* Copyright 2006 Lester Chan (email : gamerz84@hotmail.com) 13 13 14 14 This program is free software; you can redistribute it and/or modify … … 136 136 </tr> 137 137 <tr> 138 <td width="100%" colspan="2"> 139 <p class="submit"><input type="submit" name="Submit" value="<?php _e('Update Options'); ?> »" /></p> 140 </td> 138 <td width="100%" colspan="2" align="center"><input type="submit" name="Submit" class="button" value="<?php _e('Update Options'); ?>" /> <input type="button" name="cancel" value="Cancel" class="button" onclick="javascript:history.go(-1)" /></td> 141 139 </tr> 142 140 </table>
