This repository has been archived by the owner on Sep 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
mobilepress.php
87 lines (71 loc) · 2.48 KB
/
mobilepress.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?php
/*
Plugin Name: MobilePress
Plugin URI: http://mobilepress.co.za
Description: Turn your WordPress blog into a mobile website/blog.
Version: 1.1.5
Author: Aduity
Author URI: http://aduity.com
Copyright 2009 Aduity (email: [email protected])
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
global $wpdb;
// Load the config
require_once(dirname(__FILE__) . '/system/config/config.php');
// Load the helpers
require_once(dirname(__FILE__) . '/system/helpers/functions.php');
// Load the versions (must be loaded after the function helpers)
require_once(dirname(__FILE__) . '/system/config/versions.php');
// Load the core class
require_once(dirname(__FILE__) . '/system/classes/core.php');
if (class_exists('MobilePress_core'))
{
// New MobilePress object
$mobilepress = new MobilePress_core;
// Setup the installer on activation of the plugin
register_activation_hook(__FILE__, array(&$mobilepress, 'load_activation'));
// Shut down the plugin on deactivation
register_deactivation_hook(__FILE__, array(&$mobilepress, 'load_deactivation'));
// Setup admin panel only if we are inside the admin area, otherwise run the normal render code
if (is_admin())
{
// Setup the admin area
$mobilepress->create_admin();
}
else
{
// Start a session if not started already
if ( ! session_id())
{
@session_start();
}
// Load the ad/analytics helpers
require_once(dirname(__FILE__) . '/system/helpers/ad_functions.php');
// Initialize the MobilePress check logic and rendering
$mobilepress->load_site();
}
}
// Are we uninstalling the plugin?
if (function_exists('register_uninstall_hook'))
{
register_uninstall_hook(__FILE__, 'mopr_load_uninstall');
}
if ( ! function_exists('mopr_load_uninstall'))
{
function mopr_load_uninstall()
{
require_once(dirname(__FILE__) . '/system/classes/uninstall.php');
$uninstall = new MobilePress_uninstall;
}
}
?>