-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbbclone.php
More file actions
227 lines (210 loc) · 4.34 KB
/
bbclone.php
File metadata and controls
227 lines (210 loc) · 4.34 KB
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
<?php
/* utf8-marker = äöüß */
/**
* @file bbclone.php
* @brief Containing class BBClone.
*
* @author David Stutz
* @license GPLv3
* @package bbclone
* @see http://sourceforge.net/projects/cmsimplebbclone/
*
* This file is part of the bbclone plugin for CMSimple.
*
* The plugin 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 3 of the License, or
* (at your option) any later version.
*
* The plugin 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.
*
* @see <http://www.gnu.org/licenses/>.
*/
/*! \mainpage CMSimple BBClone
*
* This plugin integrated BBClone with CMSimple.
*
* This is a generated documentation of the plugin.
*
* \mainpage
*/
if (!function_exists('page_url'))
{
/**
* Detect root.
*
* @return <string> root
*/
function page_url()
{
$url = 'http';
if (isset($_SERVER["HTTPS"])
AND $_SERVER["HTTPS"] == "on")
{
$url .= "s";
}
$url .= "://";
if ($_SERVER["SERVER_PORT"] != "80")
{
$url .= $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
}
else
{
$url .= $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
}
return $url;
}
}
/**
* @class BBClone
*
* BBClone class for genheral plugin information and trakcing initialization.
*
* @author David Stutz
* @since 1.0.0
* @package bbclone
*/
class BBClone {
/**
* Version.
*/
const VERSION = '1.0.2';
/**
* @static
* @public
* Get plugin's name.
*
* @return <string> name
*/
public static function name()
{
return "BBClone Plugin";
}
/**
* @static
* @public
* Get plugin's release date.
*
* @return <string> release date.
*/
public static function release_date()
{
return "February 16th 2018";
}
/**
* @static
* @public
* Get plugin's author.
*
* @return <string> author.
*/
public static function author()
{
return "David Stutz";
}
/**
* @static
* @public
* Get plugin's website.
*
* @return <string> website link
*/
public static function website()
{
return '<a href="http://davidstutz.de/projects/cmsimple/" target="_blank">Project\'s Website</a>';
}
/**
* @static
* @public
* Get plugin's website.
*
* @return <string> website link
*/
public static function github()
{
return '<a href="https://github.com/davidstutz/cmsimple-bbclone" target="_blank">GitHub Repository</a>';
}
/**
* @public
* @static
* Donate link.
*
* @return <string> donate string
*/
public static function donate()
{
return '<b>Consider <a href="http://davidstutz.de/donate/">donating</a>.</b>';
}
/**
* @static
* @public
* Get plugin's description.
*
* @return <string> description
*/
public static function description()
{
return 'This plugin integrate BBClonse with CMSimple.';
}
/**
* @static
* @public
* Get plugin's legal.
*
* @return <string> legal
*/
public static function legal()
{
return 'This plugin is published under the GNU Public License version 3. See <a href="http://www.gnu.org/licenses/">Licenses</a> for more information.';
}
/**
* @static
* @public
* Get bbclone's legal.
*
* @return <string> legal
*/
public static function bbclone_legal()
{
return 'BBClone is published under the GNU Public License. See <a href="http://www.gnu.org/licenses/">Licenses</a>.';
}
/**
* @public
* @static
* Main tracking initialization.
*/
public static function init()
{
global $pth, $txc, $adm, $plugin_cf, $h, $s;
static $bbclone_initialized = FALSE;
if (!$bbclone_initialized
AND !defined('_BBCLONE_DIR')
AND (!$adm
OR $plugin_cf['bbclone']['track_backend'] == 'true'))
{
if ($s >= 0)
{
define("_BBC_PAGE_NAME", $h[$s]);
}
elseif (isset($h[0]))
{
define("_BBC_PAGE_NAME", $h[0]);
}
else
{
define("_BBC_PAGE_NAME", $txc['site']['title']);
}
define('_BBCLONE_DIR', $pth['folder']['base'] . 'bbclone/');
define('COUNTER', _BBCLONE_DIR . 'mark_page.php');
if (is_readable(COUNTER))
{
include_once(COUNTER);
}
$bbclone_initialized = TRUE;
}
}
}
?>