1 | <?php
|
---|
2 |
|
---|
3 | /*
|
---|
4 | * odl_admin_utilities.php
|
---|
5 | *
|
---|
6 | * This file handles the Administration of the Categories
|
---|
7 | *
|
---|
8 | * @author Mohammad Forgani
|
---|
9 | * @copyright Copyright 2008, Oh Jung-Su
|
---|
10 | * @version 1.0
|
---|
11 | * @link http://www.forgani.com
|
---|
12 | */
|
---|
13 |
|
---|
14 |
|
---|
15 | function process_odlinksutilities(){
|
---|
16 | global $_GET, $_POST, $wpdb;
|
---|
17 | $exit = FALSE;
|
---|
18 | $msg = '<div class="wrap"><h2>ODLinks Utilities</h2><p>';
|
---|
19 | switch ($_GET["odlinks_admin_action"]){
|
---|
20 | default:
|
---|
21 | case "list":
|
---|
22 | ?>
|
---|
23 | <?php
|
---|
24 | break;
|
---|
25 | case "uninstall":
|
---|
26 | odlinksuninstall_db();
|
---|
27 | $deactivate_url = 'plugins.php?action=deactivate&plugin=odlinks/odl_control.php';
|
---|
28 | if(function_exists('wp_nonce_url')) {
|
---|
29 | $deactivate_url = wp_nonce_url($deactivate_url, 'deactivate-plugin_odlinks/odl_control.php');
|
---|
30 | }
|
---|
31 | $msg .= '<h3><strong><a href='.$deactivate_url.'>Click Here</a> to finish the uninstallation and "ODLinks" will be deactivated automatically.</strong></h3></div>';
|
---|
32 | $exit = TRUE;
|
---|
33 | break;
|
---|
34 | }
|
---|
35 | if ($msg!=''){
|
---|
36 | ?>
|
---|
37 | <p>
|
---|
38 | <b><?php echo $msg; ?></b>
|
---|
39 | </p>
|
---|
40 | <?php
|
---|
41 | }
|
---|
42 | ?>
|
---|
43 |
|
---|
44 | <script language=javascript>
|
---|
45 | <!--
|
---|
46 | function uninstallodlinks(y){
|
---|
47 | if (confirm("Are you sure you want to Uninstall the ODLinks?\n")){
|
---|
48 | document.location.href = y;
|
---|
49 | }
|
---|
50 | }
|
---|
51 | //-->
|
---|
52 | </script>
|
---|
53 | <?php
|
---|
54 | if (!$exit) {
|
---|
55 | ?>
|
---|
56 | <p>
|
---|
57 | <h3>Uninstall</h3>
|
---|
58 | Just make sure you create backups before you drops the Open Directory Links Database tables.
|
---|
59 | <br />
|
---|
60 | <br />
|
---|
61 | PLEASE NOTE: To remove ODLinks you must deactivate it via the Plugins page BEFORE removing the odlinks folder.
|
---|
62 | <br />
|
---|
63 | <br />
|
---|
64 | <a href="javascript:uninstallodlinks('<?php echo $PHP_SELF;?>?page=odlinksutilities&odlinks_admin_page_arg=<?php echo $_GET['odlinks_admin_page_arg'];?>&odlinks_admin_action=uninstall')">Uninstall ODLinks from the Database?</a>
|
---|
65 | </p></div>
|
---|
66 | <?php
|
---|
67 | }
|
---|
68 | }
|
---|
69 |
|
---|
70 | function odlinksuninstall_db(){
|
---|
71 | global $wpdb, $table_prefix;
|
---|
72 | $wpdb->query("DROP TABLE {$table_prefix}odcategories, {$table_prefix}odlinks, {$table_prefix}odnew_links, {$table_prefix}odpages, {$table_prefix}odbanned");
|
---|
73 | $wpdb->query("DELETE FROM {$table_prefix}posts WHERE post_title = '[[ODLINKS]]'");
|
---|
74 | $wpdb->query("DELETE FROM {$table_prefix}options WHERE option_name = 'odlinksdata'");
|
---|
75 | echo '<div id="message" class="updated fade">Uninstall Successful!</div>';
|
---|
76 | }
|
---|
77 |
|
---|
78 |
|
---|
79 | ?>
|
---|