forked from cmb69/realblog_xh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompat.php
145 lines (136 loc) · 4.08 KB
/
compat.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
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
<?php
/**
* Copyright 2006-2010 Jan Kanters
* Copyright 2010-2014 Gert Ebersbach
* Copyright 2014-2023 Christoph M. Becker
*
* This file is part of Realblog_XH.
*
* Realblog_XH 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.
*
* Realblog_XH 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 Realblog_XH. If not, see <http://www.gnu.org/licenses/>.
*/
use Realblog\Dic;
use Realblog\Infra\Request;
use Realblog\Infra\Responder;
/**
* @param string $options
* @param string $category
* @return string
* @deprecated as of 3.0beta6
*/
function showrealblog($options = "", $category = 'all')
{
$function = __FUNCTION__;
trigger_error("$function() is deprecated; use Realblog_blog() instead", E_USER_DEPRECATED);
$includesearch = false;
$arguments = Realblog_getArguments($options);
if (isset($arguments['showsearch'])) {
switch (strtolower($arguments['showsearch'])) {
case '0':
case 'false':
$includesearch = false;
break;
case '1':
case 'true':
$includesearch = true;
break;
}
}
return Responder::respond(Dic::makeBlogController()(Request::current(), "blog", $includesearch, $category));
}
/**
* @param string $options
* @return string
* @deprecated as of 3.0beta6
*/
function showrealblogarchive($options = "")
{
$function = __FUNCTION__;
trigger_error("$function() is deprecated; use Realblog_archive() instead", E_USER_DEPRECATED);
$includesearch = false;
$arguments = Realblog_getArguments($options);
if (isset($arguments['showsearch'])) {
$argument = strtolower($arguments['showsearch']);
switch ($argument) {
case '0':
case 'false':
$includesearch = false;
break;
case '1':
case 'true':
$includesearch = true;
break;
}
}
return Responder::respond(Dic::makeBlogController()(Request::current(), "archive", $includesearch));
}
/**
* @param string $options
* @return string
* @deprecated as of 3.0beta6
*/
function realbloglink($options)
{
$function = __FUNCTION__;
trigger_error("$function() is deprecated; use Realblog_link() instead", E_USER_DEPRECATED);
$realblog_page = '';
$arguments = Realblog_getArguments($options);
if (isset($arguments['realblogpage'])) {
$realblog_page = $arguments['realblogpage'];
}
return Responder::respond(Dic::makeLinkController()(Request::current(), $realblog_page));
}
/**
* @param string $arguments
* @return array<string,string>
*/
function Realblog_getArguments($arguments)
{
$result = array();
$arguments = explode(',', $arguments);
foreach ($arguments as $argument) {
$pair = explode('=', $argument);
if (count($pair) == 2) {
$result[$pair[0]] = $pair[1];
}
}
return $result;
}
/**
* @return string
* @deprecated as of 3.0beta6
*/
function realblog_rss_adv()
{
$function = __FUNCTION__;
trigger_error("$function() is deprecated; use Realblog_feedLink() instead", E_USER_DEPRECATED);
return Responder::respond(Dic::makeFeedLinkController()(Request::current(), "_self"));
}
/**
* @return void
* @deprecated as of 3.0beta6
*/
function rbCat()
{
$function = __FUNCTION__;
trigger_error("$function() is deprecated; enter the categories in the respective field instead", E_USER_DEPRECATED);
}
/**
* @return void
* @deprecated as of 3.0beta4
*/
function commentsMembersOnly()
{
$function = __FUNCTION__;
trigger_error("$function() is deprecated; this functionality is not yet supported", E_USER_DEPRECATED);
}