No regular expressions were active.
1 |
|
<?php
|
|
1 |
|
<?php
|
2 |
|
/*********
**********
**********
**********
**********
**********
**********
******
|
|
2 |
|
/*********
**********
**********
**********
**********
**********
**********
******
|
3 |
|
*
O
rca Intera
ctive Foru
m Script
|
|
3 |
|
*
O
rca Intera
ctive Foru
m Script
|
4 |
|
*
----------
-----
|
|
4 |
|
*
----------
-----
--
|
5 |
|
*
Start
e
d
:
Fr
Nov
10
2006
|
|
5 |
|
*
b
e
gin
:
Fr
Nov
10
2006
|
6 |
|
*
C
opyright
:
(C)
200
7
BoonEx
Group
|
|
6 |
|
*
c
opyright
:
(C)
200
6
BoonEx
Group
|
7 |
|
*
W
ebsite
:
http://www
.boonex.co
m
|
|
7 |
|
*
w
ebsite
:
http://www
.boonex.co
m
/
|
8 |
|
* This fil
e is part
of Orca -
Interactiv
e Forum Sc
ript
|
|
8 |
|
* This fil
e is part
of Orca -
Interactiv
e Forum Sc
ript
|
9 |
|
*
|
|
9 |
|
*
|
10 |
|
*
Orca
is
free
software
;
y
o
u
c
a
n
r
ed
i
s
tribut
e
i
t
and/
o
r
modify
i
t
u
n
d
e
r
|
|
10 |
|
*
Orca
is
free
software
.
This
w
o
rk
is
li
c
e
n
s
ed
under
a
Creat
i
ve
Common
s
At
tribut
i
o
n
3.0
L
i
ce
n
s
e
.
|
11 |
|
* the term
s of the G
NU General
Public Li
cense as p
ublished b
y the
|
|
11 |
|
* http://c
reativecom
mons.org/l
icenses/by
/3.0/
|
12 |
|
* Free Sof
tware Foun
dation; ei
ther versi
on 2 of th
e
|
|
|
13 |
|
* License,
or any la
ter versio
n.
|
|
|
14 |
|
*
|
|
12 |
|
*
|
15 |
|
* Orca is
distribute
d in the h
ope that i
t will be
useful, bu
t WITHOUT
ANY WARRAN
TY;
|
|
13 |
|
* Orca is
distribute
d in the h
ope that i
t will be
useful, bu
t WITHOUT
ANY WARRAN
TY;
|
16 |
|
* without
even the i
mplied war
ranty of
MERCHANTAB
ILITY or F
ITNESS FOR
A PARTICU
LAR PURPOS
E.
|
|
14 |
|
* without
even the i
mplied war
ranty of
MERCHANTAB
ILITY or F
ITNESS FOR
A PARTICU
LAR PURPOS
E.
|
17 |
|
*
See
the
GNU
G
e
n
e
r
al
Pu
b
l
i
c
License
for
more
details.
|
|
15 |
|
*
See
the
Cr
e
ativ
e
Commons
Att
r
i
b
ut
i
on
3.0
License
for
more
details.
|
18 |
|
*
You
should
have
received
a
copy
of
the
GNU
G
e
n
e
r
al
Pu
b
l
i
c
License
along
with
Orca,
|
|
16 |
|
*
You
should
have
received
a
copy
of
the
Cr
e
ativ
e
Commons
Att
r
i
b
ut
i
on
3.0
License
along
with
Orca,
|
19 |
|
* see lice
nse.txt fi
le; if not
, write to
marketing
@boonex.co
m
|
|
17 |
|
* see lice
nse.txt fi
le; if not
, write to
marketing
@boonex.co
m
|
20 |
|
**********
**********
**********
**********
**********
**********
**********
*****/
|
|
18 |
|
**********
**********
**********
**********
**********
**********
**********
*****/
|
21 |
|
|
|
19 |
|
|
22 |
|
|
|
20 |
|
|
23 |
|
// admin f
unctions
|
|
21 |
|
// admin f
unctions
|
24 |
|
|
|
22 |
|
|
25 |
|
class Admi
n extends
ThingPage
|
|
23 |
|
class Admi
n extends
ThingPage
|
26 |
|
{
|
|
24 |
|
{
|
27 |
|
/**
|
|
25 |
|
/**
|
28 |
|
* con
structor
|
|
26 |
|
* con
structor
|
29 |
|
*/
|
|
27 |
|
*/
|
30 |
|
functi
on Admin (
)
|
|
28 |
|
functi
on Admin (
)
|
31 |
|
{
|
|
29 |
|
{
|
32 |
|
gl
obal $f;
|
|
30 |
|
gl
obal $f;
|
33 |
|
$t
his->_admi
n = $f->is
Admin ();
|
|
31 |
|
$t
his->_admi
n = $f->is
Admin ();
|
34 |
|
}
|
|
32 |
|
}
|
35 |
|
|
|
33 |
|
|
36 |
|
functi
on registe
r ($LN)
|
|
34 |
|
functi
on registe
r ($LN)
|
37 |
|
{
|
|
35 |
|
{
|
38 |
|
ev
al($GLOBAL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cha
nge catego
ry order
|
|
48 |
|
* cha
nge catego
ry order
|
51 |
|
* @p
aram $cat_
id catego
ry id
|
|
49 |
|
* @p
aram $cat_
id catego
ry id
|
52 |
|
* @p
aram $dir
direct
ion (up|do
wn)
|
|
50 |
|
* @p
aram $dir
direct
ion (up|do
wn)
|
53 |
|
* @p
aram retur
n xml (<
ret>0</ret
>|<ret>1</
ret>)
|
|
51 |
|
* @p
aram retur
n xml (<
ret>0</ret
>|<ret>1</
ret>)
|
54 |
|
*/
|
|
52 |
|
*/
|
55 |
|
functi
on moveCat
($cat_id,
$dir)
|
|
53 |
|
functi
on moveCat
($cat_id,
$dir)
|
56 |
|
{
|
|
54 |
|
{
|
57 |
|
if
(!$this->
_admin) re
turn '<ret
>0</ret>';
|
|
55 |
|
if
(!$this->
_admin) re
turn '<ret
>0</ret>';
|
58 |
|
|
|
56 |
|
|
59 |
|
$d
b = new Db
Admin ();
|
|
57 |
|
$d
b = new Db
Admin ();
|
60 |
|
$c
at_order =
$db->getC
atOrder ($
cat_id);
|
|
58 |
|
$c
at_order =
$db->getC
atOrder ($
cat_id);
|
61 |
|
|
|
59 |
|
|
62 |
|
$a
= $db->ge
tCatsInOrd
er ($cat_o
rder, $dir
, 2);
|
|
60 |
|
$a
= $db->ge
tCatsInOrd
er ($cat_o
rder, $dir
, 2);
|
63 |
|
|
|
61 |
|
|
64 |
|
$n
ew_order =
0;
|
|
62 |
|
$n
ew_order =
0;
|
65 |
|
|
|
63 |
|
|
66 |
|
if
(2 == cou
nt ($a))
|
|
64 |
|
if
(2 == cou
nt ($a))
|
67 |
|
{
|
|
65 |
|
{
|
68 |
|
$new_ord
er = $a[0]
['cat_orde
r'] > $a[1
]['cat_ord
er'] ? $a[
1]['cat_or
der'] + ($
a[0]['cat_
order'] -
$a[1]['cat
_order'])/
2 : $a[0][
'cat_order
'] + ($a[1
]['cat_ord
er'] - $a[
0]['cat_or
der'])/2;
|
|
66 |
|
$new_ord
er = $a[0]
['cat_orde
r'] > $a[1
]['cat_ord
er'] ? $a[
1]['cat_or
der'] + ($
a[0]['cat_
order'] -
$a[1]['cat
_order'])/
2 : $a[0][
'cat_order
'] + ($a[1
]['cat_ord
er'] - $a[
0]['cat_or
der'])/2;
|
69 |
|
}
|
|
67 |
|
}
|
70 |
|
el
se if (1 =
= count ($
a))
|
|
68 |
|
el
se if (1 =
= count ($
a))
|
71 |
|
{
|
|
69 |
|
{
|
72 |
|
$new_ord
er = $cat_
order > $a
[0]['cat_o
rder'] ? $
a[0]['cat_
order']/2
: $a[0]['c
at_order']
+ CAT_ORD
ER_STEP;
|
|
70 |
|
$new_ord
er = $cat_
order > $a
[0]['cat_o
rder'] ? $
a[0]['cat_
order']/2
: $a[0]['c
at_order']
+ CAT_ORD
ER_STEP;
|
73 |
|
}
|
|
71 |
|
}
|
74 |
|
|
|
72 |
|
|
75 |
|
if
($new_ord
er)
|
|
73 |
|
if
($new_ord
er)
|
76 |
|
{
|
|
74 |
|
{
|
77 |
|
$db->set
NewOrder (
$cat_id, $
new_order)
;
|
|
75 |
|
$db->set
NewOrder (
$cat_id, $
new_order)
;
|
78 |
|
return '
<ret>1</re
t>';
|
|
76 |
|
return '
<ret>1</re
t>';
|
79 |
|
}
|
|
77 |
|
}
|
80 |
|
|
|
78 |
|
|
81 |
|
re
turn '<ret
>0</ret>';
|
|
79 |
|
re
turn '<ret
>0</ret>';
|
82 |
|
}
|
|
80 |
|
}
|
83 |
|
|
|
81 |
|
|
84 |
|
/**
|
|
82 |
|
/**
|
85 |
|
* del
ete catego
ry
|
|
83 |
|
* del
ete catego
ry
|
86 |
|
* @p
aram $cat_
id catego
ry id
|
|
84 |
|
* @p
aram $cat_
id catego
ry id
|
87 |
|
* @p
aram retur
n xml (<
ret>0</ret
>|<ret>1</
ret>)
|
|
85 |
|
* @p
aram retur
n xml (<
ret>0</ret
>|<ret>1</
ret>)
|
88 |
|
*/
|
|
86 |
|
*/
|
89 |
|
functi
on deleteC
ategory ($
cat_id)
|
|
87 |
|
functi
on deleteC
ategory ($
cat_id)
|
90 |
|
{
|
|
88 |
|
{
|
91 |
|
if
(!$this->
_admin) re
turn '<ret
>0</ret>';
|
|
89 |
|
if
(!$this->
_admin) re
turn '<ret
>0</ret>';
|
92 |
|
|
|
90 |
|
|
93 |
|
$d
b = new Db
Admin ();
|
|
91 |
|
$d
b = new Db
Admin ();
|
94 |
|
re
turn $db->
deleteCate
goryAll ((
int)$cat_i
d) ? '<ret
>1</ret>'
: '<ret>0<
/ret>';
|
|
92 |
|
re
turn $db->
deleteCate
goryAll ((
int)$cat_i
d) ? '<ret
>1</ret>'
: '<ret>0<
/ret>';
|
95 |
|
}
|
|
93 |
|
}
|
96 |
|
|
|
94 |
|
|
97 |
|
/**
|
|
95 |
|
/**
|
98 |
|
* del
ete forum
|
|
96 |
|
* del
ete forum
|
99 |
|
* @p
aram $foru
m_id fo
rum id
|
|
97 |
|
* @p
aram $foru
m_id fo
rum id
|
100 |
|
* @p
aram retur
n xm
l (<ret>0<
/ret>|<ret
>1</ret>)
|
|
98 |
|
* @p
aram retur
n xm
l (<ret>0<
/ret>|<ret
>1</ret>)
|
101 |
|
*/
|
|
99 |
|
*/
|
102 |
|
functi
on deleteF
orum ($for
um_id)
|
|
100 |
|
functi
on deleteF
orum ($for
um_id)
|
103 |
|
{
|
|
101 |
|
{
|
104 |
|
if
(!$this->
_admin) re
turn '<ret
>0</ret>';
|
|
102 |
|
if
(!$this->
_admin) re
turn '<ret
>0</ret>';
|
105 |
|
|
|
103 |
|
|
106 |
|
$d
b = new Db
Admin ();
|
|
104 |
|
$d
b = new Db
Admin ();
|
107 |
|
|
|
105 |
|
|
108 |
|
$cat
_id
=
$db->getCa
t
Id
ByForumId(
$forum_id)
;
|
|
106 |
|
$cat
=
$db->getCa
t
ByForumId(
$forum_id)
;
|
109 |
|
|
|
107 |
|
|
110 |
|
if
($db->del
eteForumAl
l ((int)$f
orum_id))
|
|
108 |
|
if
($db->del
eteForumAl
l ((int)$f
orum_id))
|
111 |
|
return '
<ret>'.$ca
t_id.'</re
t>';
|
|
109 |
|
return '
<root><cat
_uri>' . $
cat['cat_u
ri'] . '</
cat_uri><c
at_id>' .
$cat['cat_
id'] . '</
cat_id></r
oot>';
|
112 |
|
el
se
|
|
110 |
|
el
se
|
113 |
|
return
'<r
e
t
>0</
r
e
t>';
|
|
111 |
|
return
'<r
oot><ca
t
_id
>0</
cat_id></
r
oo
t>';
|
114 |
|
}
|
|
112 |
|
}
|
115 |
|
|
|
113 |
|
|
116 |
|
/**
|
|
114 |
|
/**
|
117 |
|
* sho
w edit cat
egory page
|
|
115 |
|
* sho
w edit cat
egory page
|
118 |
|
* @p
aram $cat_
id ca
tegory id
|
|
116 |
|
* @p
aram $cat_
id ca
tegory id
|
119 |
|
* @p
aram retur
n ca
tegory win
dow xml
|
|
117 |
|
* @p
aram retur
n ca
tegory win
dow xml
|
120 |
|
*/
|
|
118 |
|
*/
|
121 |
|
functi
on editCat
egory ($ca
t_id)
|
|
119 |
|
functi
on editCat
egory ($ca
t_id)
|
122 |
|
{
|
|
120 |
|
{
|
123 |
|
$d
b = new Db
Admin ();
|
|
121 |
|
$d
b = new Db
Admin ();
|
124 |
|
$c
at_name =
$db->getCa
tname ((in
t)$cat_id)
;
|
|
122 |
|
$c
at_name =
$db->getCa
tname ((in
t)$cat_id)
;
|
125 |
|
|
|
123 |
|
|
126 |
|
$c
u = $this-
>getUrlsXm
l ();
|
|
124 |
|
$c
u = $this-
>getUrlsXm
l ();
|
127 |
|
|
|
125 |
|
|
128 |
|
en
code_post_
text ($cat
_name, 0);
|
|
126 |
|
en
code_post_
text ($cat
_name, 0);
|
129 |
|
|
|
127 |
|
|
130 |
|
re
turn <<<EO
S
|
|
128 |
|
re
turn <<<EO
S
|
131 |
|
<root>
|
|
129 |
|
<root>
|
132 |
|
$cu
|
|
130 |
|
$cu
|
133 |
|
<cat cat_i
d="$cat_id
">
|
|
131 |
|
<cat cat_i
d="$cat_id
">
|
134 |
|
<cat_n
ame>$cat_n
ame</cat_n
ame>
|
|
132 |
|
<cat_n
ame>$cat_n
ame</cat_n
ame>
|
135 |
|
</cat>
|
|
133 |
|
</cat>
|
136 |
|
</root>
|
|
134 |
|
</root>
|
137 |
|
EOS;
|
|
135 |
|
EOS;
|
138 |
|
}
|
|
136 |
|
}
|
139 |
|
|
|
137 |
|
|
140 |
|
/**
|
|
138 |
|
/**
|
141 |
|
* sav
e category
informati
on
|
|
139 |
|
* sav
e category
informati
on
|
142 |
|
* @p
aram $cat_
id ca
tegory id
|
|
140 |
|
* @p
aram $cat_
id ca
tegory id
|
143 |
|
* @p
aram $cat_
name ca
tegory nam
e
|
|
141 |
|
* @p
aram $cat_
name ca
tegory nam
e
|
144 |
|
* @p
aram retur
n xm
l (<ret>0<
/ret>|<ret
>1</ret>)
|
|
142 |
|
* @p
aram retur
n xm
l (<ret>0<
/ret>|<ret
>1</ret>)
|
145 |
|
*/
|
|
143 |
|
*/
|
146 |
|
functi
on editCat
egorySubmi
t ($cat_id
, $cat_nam
e)
|
|
144 |
|
functi
on editCat
egorySubmi
t ($cat_id
, $cat_nam
e)
|
147 |
|
{
|
|
145 |
|
{
|
148 |
|
if
(!$this->
_admin) re
turn '<ret
>0</ret>';
|
|
146 |
|
if
(!$this->
_admin) re
turn '<ret
>0</ret>';
|
149 |
|
|
|
147 |
|
|
150 |
|
$c
at_name =
unicode_ur
ldecode($c
at_name);
|
|
148 |
|
$c
at_name =
unicode_ur
ldecode($c
at_name);
|
151 |
|
pr
epare_to_d
b($cat_nam
e, 0);
|
|
149 |
|
pr
epare_to_d
b($cat_nam
e, 0);
|
152 |
|
|
|
150 |
|
|
153 |
|
//
cat_name
check
|
|
151 |
|
//
cat_name
check
|
154 |
|
|
|
152 |
|
|
155 |
|
$d
b = new Db
Admin ();
|
|
153 |
|
$d
b = new Db
Admin ();
|
156 |
|
if
($cat_id)
|
|
154 |
|
if
($cat_id)
|
|
|
155 |
|
{
|
157 |
|
return $
db->editCa
tegory ((i
nt)$cat_id
, $cat_nam
e) ? '<ret
>1</ret>'
: '<ret>0<
/ret>';
|
|
156 |
|
return $
db->editCa
tegory ((i
nt)$cat_id
, $cat_nam
e) ? '<ret
>1</ret>'
: '<ret>0<
/ret>';
|
|
|
157 |
|
}
|
158 |
|
el
se
|
|
158 |
|
el
se
|
159 |
|
return
$db->inser
tCategory
($cat_name
)
?
'<ret>1</r
et>'
:
'<ret>0</r
et>';
|
|
159 |
|
{
|
|
|
160 |
|
global $
f;
|
|
|
161 |
|
$cat_uri
= $f->uri
Generate (
$cat_name,
TF_FORUM_
CAT, 'cat_
uri');
|
|
|
162 |
|
return
$db->inser
tCategory
($cat_name
,
$cat_uri
)
?
'<ret>1</r
et>'
:
'<ret>0</r
et>';
|
|
|
163 |
|
}
|
160 |
|
}
|
|
164 |
|
}
|
161 |
|
|
|
165 |
|
|
162 |
|
/**
|
|
166 |
|
/**
|
163 |
|
* sho
w edit for
um page
|
|
167 |
|
* sho
w edit for
um page
|
164 |
|
* @p
aram $foru
m_id fo
rum id
|
|
168 |
|
* @p
aram $foru
m_id fo
rum id
|
165 |
|
* @p
aram $cat_
id ca
tegory id
|
|
169 |
|
* @p
aram $cat_
id ca
tegory id
|
166 |
|
* @p
aram retur
n fo
rum edit w
indow xml
|
|
170 |
|
* @p
aram retur
n fo
rum edit w
indow xml
|
167 |
|
*/
|
|
171 |
|
*/
|
168 |
|
functi
on editFor
um ($forum
_id, $cat_
id)
|
|
172 |
|
functi
on editFor
um ($forum
_id, $cat_
id)
|
169 |
|
{
|
|
173 |
|
{
|
170 |
|
$d
b = new Db
Admin ();
|
|
174 |
|
$d
b = new Db
Admin ();
|
|
|
175 |
|
$f
db = new D
bForum ();
|
171 |
|
|
|
176 |
|
|
172 |
|
if
($forum_i
d)
|
|
177 |
|
if
($forum_i
d)
|
173 |
|
$a
= $db->ge
tForum ((i
nt)$forum_
id);
|
|
178 |
|
$a = $db
->getForum
((int)$fo
rum_id);
|
174 |
|
el
se
|
|
179 |
|
el
se
|
175 |
|
$a['cat_
id'] = $ca
t_id;
|
|
180 |
|
$a['cat_
id'] = $ca
t_id;
|
176 |
|
|
|
181 |
|
|
|
|
182 |
|
$c
= $fdb->g
etCat ($a[
'cat_id'])
;
|
|
|
183 |
|
$a
['cat_uri'
] = $c['ca
t_uri'];
|
|
|
184 |
|
|
177 |
|
$c
u = $this-
>getUrlsXm
l ();
|
|
185 |
|
$c
u = $this-
>getUrlsXm
l ();
|
178 |
|
|
|
186 |
|
|
179 |
|
en
code_post_
text ($a['
forum_titl
e'], 0);
|
|
187 |
|
en
code_post_
text ($a['
forum_titl
e'], 0);
|
180 |
|
en
code_post_
text ($a['
forum_desc
'], 0);
|
|
188 |
|
en
code_post_
text ($a['
forum_desc
'], 0);
|
181 |
|
|
|
189 |
|
|
182 |
|
re
turn <<<OE
S
|
|
190 |
|
re
turn <<<OE
S
|
183 |
|
<root>
|
|
191 |
|
<root>
|
184 |
|
$cu
|
|
192 |
|
$cu
|
185 |
|
<forum for
um_id="$fo
rum_id">
|
|
193 |
|
<forum for
um_id="$fo
rum_id">
|
186 |
|
<cat_i
d>{$a['cat
_id']}</ca
t_id>
|
|
194 |
|
<cat_i
d>{$a['cat
_id']}</ca
t_id>
|
|
|
195 |
|
<cat_u
ri>{$a['ca
t_uri']}</
cat_uri>
|
187 |
|
<title
>{$a['foru
m_title']}
</title>
|
|
196 |
|
<title
>{$a['foru
m_title']}
</title>
|
188 |
|
<desc>
{$a['forum
_desc']}</
desc>
|
|
197 |
|
<desc>
{$a['forum
_desc']}</
desc>
|
189 |
|
<type>
{$a['forum
_type']}</
type>
|
|
198 |
|
<type>
{$a['forum
_type']}</
type>
|
190 |
|
</forum>
|
|
199 |
|
</forum>
|
191 |
|
</root>
|
|
200 |
|
</root>
|
192 |
|
OES;
|
|
201 |
|
OES;
|
193 |
|
}
|
|
202 |
|
}
|
194 |
|
|
|
203 |
|
|
195 |
|
/**
|
|
204 |
|
/**
|
196 |
|
* sav
e forum in
formation
|
|
205 |
|
* sav
e forum in
formation
|
197 |
|
* @p
aram $cat_
id ca
tegory id
|
|
206 |
|
* @p
aram $cat_
id ca
tegory id
|
198 |
|
* @p
aram $foru
m_id fo
rum id
|
|
207 |
|
* @p
aram $foru
m_id fo
rum id
|
199 |
|
* @p
aram $titl
e fo
rum title
|
|
208 |
|
* @p
aram $titl
e fo
rum title
|
200 |
|
* @p
aram $desc
fo
rum descri
ption
|
|
209 |
|
* @p
aram $desc
fo
rum descri
ption
|
201 |
|
* @p
aram $type
fo
rum type (
public|pri
vate)
|
|
210 |
|
* @p
aram $type
fo
rum type (
public|pri
vate)
|
202 |
|
* @p
aram retur
n xm
l (<ret>0<
/ret>|<ret
>1</ret>)
|
|
211 |
|
* @p
aram retur
n xm
l (<ret>0<
/ret>|<ret
>1</ret>)
|
203 |
|
*/
|
|
212 |
|
*/
|
204 |
|
functi
on editFor
mSubmit ($
cat_id, $f
orum_id, $
title, $de
sc, $type)
|
|
213 |
|
functi
on editFor
mSubmit ($
cat_id, $f
orum_id, $
title, $de
sc, $type)
|
205 |
|
{
|
|
214 |
|
{
|
206 |
|
if
(!$this->
_admin) re
turn '<ret
>0</ret>';
|
|
215 |
|
if
(!$this->
_admin) re
turn '<ret
>0</ret>';
|
207 |
|
|
|
216 |
|
|
208 |
|
$t
itle = uni
code_urlde
code ($tit
le);
|
|
217 |
|
$t
itle = uni
code_urlde
code ($tit
le);
|
209 |
|
$d
esc = unic
ode_urldec
ode ($desc
);
|
|
218 |
|
$d
esc = unic
ode_urldec
ode ($desc
);
|
210 |
|
|
|
219 |
|
|
211 |
|
pr
epare_to_d
b($title,
0);
|
|
220 |
|
pr
epare_to_d
b($title,
0);
|
212 |
|
pr
epare_to_d
b($desc, 0
);
|
|
221 |
|
pr
epare_to_d
b($desc, 0
);
|
213 |
|
|
|
222 |
|
|
214 |
|
$d
b = new Db
Admin ();
|
|
223 |
|
$d
b = new Db
Admin ();
|
|
|
224 |
|
|
215 |
|
if
($forum_i
d > 0)
|
|
225 |
|
if
($forum_i
d > 0)
|
|
|
226 |
|
{
|
216 |
|
return $
db->editFo
rum ((int)
$forum_id,
$title, $
desc, $typ
e) ? '<ret
>1</ret>'
: '<ret>0<
/ret>';
|
|
227 |
|
return $
db->editFo
rum ((int)
$forum_id,
$title, $
desc, $typ
e) ? '<ret
>1</ret>'
: '<ret>0<
/ret>';
|
|
|
228 |
|
}
|
217 |
|
el
se
|
|
229 |
|
el
se
|
218 |
|
return
$db->inser
tForum
((int)$cat
_id,
$title,
$desc,
$type
)
?
'<ret>1</r
et>'
:
'<ret>0</r
et>';
|
|
230 |
|
{
|
|
|
231 |
|
global $
f;
|
|
|
232 |
|
$forum_u
ri = $f->u
riGenerate
($title,
TF_FORUM,
'forum_uri
');
|
|
|
233 |
|
return
$db->inser
tForum
((int)$cat
_id,
$title,
$desc,
$type
,
$forum_uri
)
?
'<ret>1</r
et>'
:
'<ret>0</r
et>';
|
|
|
234 |
|
}
|
219 |
|
|
|
235 |
|
|
220 |
|
}
|
|
236 |
|
}
|
221 |
|
|
|
237 |
|
|
222 |
|
|
|
238 |
|
|
223 |
|
/**
|
|
239 |
|
/**
|
224 |
|
* ret
urns repor
ted posts
XML
|
|
240 |
|
* ret
urns repor
ted posts
XML
|
225 |
|
*/
|
|
241 |
|
*/
|
226 |
|
functi
on getRepo
rtedPostsX
ML ()
|
|
242 |
|
functi
on getRepo
rtedPostsX
ML ()
|
227 |
|
{
|
|
243 |
|
{
|
228 |
|
gl
obal $gCon
f;
|
|
244 |
|
gl
obal $gCon
f;
|
229 |
|
gl
obal $f;
|
|
245 |
|
gl
obal $f;
|
230 |
|
|
|
246 |
|
|
231 |
|
$u
i = array
();
|
|
247 |
|
$u
i = array
();
|
232 |
|
|
|
248 |
|
|
233 |
|
$f
db = new D
bForum ();
|
|
249 |
|
$f
db = new D
bForum ();
|
234 |
|
$a
db = new D
bAdmin ();
|
|
250 |
|
$a
db = new D
bAdmin ();
|
235 |
|
|
|
251 |
|
|
236 |
|
if
(!$this->
_admin) re
turn "<roo
t><posts><
/posts></r
oot>";
|
|
252 |
|
if
(!$this->
_admin) re
turn "<roo
t><posts><
/posts></r
oot>";
|
237 |
|
|
|
253 |
|
|
238 |
|
//
check use
r permissi
ons to del
ete or edi
t posts
|
|
254 |
|
//
check use
r permissi
ons to del
ete or edi
t posts
|
239 |
|
$g
l_allow_ed
it = 1;
|
|
255 |
|
$g
l_allow_ed
it = 1;
|
240 |
|
$g
l_allow_de
l = 1;
|
|
256 |
|
$g
l_allow_de
l = 1;
|
241 |
|
|
|
257 |
|
|
242 |
|
$u
= $f->_ge
tLoginUser
();
|
|
258 |
|
$u
= $f->_ge
tLoginUser
();
|
243 |
|
|
|
259 |
|
|
244 |
|
$a
= $adb->g
etReported
Posts($u);
|
|
260 |
|
$a
= $adb->g
etReported
Posts($u);
|
245 |
|
re
set ($a);
|
|
261 |
|
re
set ($a);
|
246 |
|
$p
= '';
|
|
262 |
|
$p
= '';
|
247 |
|
wh
ile ( list
(,$r) = e
ach ($a) )
|
|
263 |
|
wh
ile ( list
(,$r) = e
ach ($a) )
|
248 |
|
{
|
|
264 |
|
{
|
249 |
|
// acqui
re user in
fo
|
|
265 |
|
// acqui
re user in
fo
|
250 |
|
if (!$ui
[$r['user'
]])
|
|
266 |
|
if (!$ui
[$r['user'
]])
|
251 |
|
{
|
|
267 |
|
{
|
252 |
|
$aa
= $f->_get
UserInfo (
$r['user']
);
|
|
268 |
|
$aa
= $f->_get
UserInfo (
$r['user']
);
|
253 |
|
$ui[
$r['user']
] = array
('posts' =
> $fdb->ge
tUserPosts
($r['user'
]), 'avata
r' => $aa[
'avatar'])
;
|
|
269 |
|
$ui[
$r['user']
] = array
('posts' =
> $fdb->ge
tUserPosts
($r['user'
]), 'avata
r' => $aa[
'avatar'])
;
|
254 |
|
}
|
|
270 |
|
}
|
255 |
|
|
|
271 |
|
|
256 |
|
$allow_e
dit = $gl_
allow_edit
;
|
|
272 |
|
$allow_e
dit = $gl_
allow_edit
;
|
257 |
|
$allow_d
el = $gl_a
llow_del;
|
|
273 |
|
$allow_d
el = $gl_a
llow_del;
|
258 |
|
|
|
274 |
|
|
259 |
|
encode_p
ost_text (
$r['post_t
ext']);
|
|
275 |
|
encode_p
ost_text (
$r['post_t
ext']);
|
260 |
|
|
|
276 |
|
|
261 |
|
$p .= <<
<EOF
|
|
277 |
|
$p .= <<
<EOF
|
262 |
|
<post id="
{$r['post_
id']}" fo
rce_show="
1">
|
|
278 |
|
<post id="
{$r['post_
id']}" fo
rce_show="
1">
|
263 |
|
<text>
{$r['post_
text']}</t
ext>
|
|
279 |
|
<text>
{$r['post_
text']}</t
ext>
|
264 |
|
<when>
{$r['when'
]}</when>
|
|
280 |
|
<when>
{$r['when'
]}</when>
|
265 |
|
<allow
_edit>$all
ow_edit</a
llow_edit>
|
|
281 |
|
<allow
_edit>$all
ow_edit</a
llow_edit>
|
266 |
|
<allow
_del>$allo
w_del</all
ow_del>
|
|
282 |
|
<allow
_del>$allo
w_del</all
ow_del>
|
267 |
|
<point
s>{$r['vot
es']}</poi
nts>
|
|
283 |
|
<point
s>{$r['vot
es']}</poi
nts>
|
268 |
|
<vote_
user_point
>{$r['vote
_user_poin
t']}</vote
_user_poin
t>
|
|
284 |
|
<vote_
user_point
>{$r['vote
_user_poin
t']}</vote
_user_poin
t>
|
269 |
|
<user
posts="{$u
i[$r['user
']]['posts
']}" name=
"{$r['user
']}">
|
|
285 |
|
<user
posts="{$u
i[$r['user
']]['posts
']}" name=
"{$r['user
']}">
|
270 |
|
<a
vatar>{$ui
[$r['user'
]]['avatar
']}</avata
r>
|
|
286 |
|
<a
vatar>{$ui
[$r['user'
]]['avatar
']}</avata
r>
|
271 |
|
</user
>
|
|
287 |
|
</user
>
|
272 |
|
<min_p
oint>{$gCo
nf['min_po
int']}</mi
n_point>
|
|
288 |
|
<min_p
oint>{$gCo
nf['min_po
int']}</mi
n_point>
|
273 |
|
</post>
|
|
289 |
|
</post>
|
274 |
|
EOF;
|
|
290 |
|
EOF;
|
275 |
|
$rr = $r
;
|
|
291 |
|
$rr = $r
;
|
276 |
|
|
|
292 |
|
|
277 |
|
}
|
|
293 |
|
}
|
278 |
|
|
|
294 |
|
|
279 |
|
$c
u = $this-
>getUrlsXm
l ();
|
|
295 |
|
$c
u = $this-
>getUrlsXm
l ();
|
280 |
|
re
turn "<roo
t>$cu<post
s><topic><
title>Repo
rted Posts
</title><i
d>0</id></
topic><for
um><id>0</
id></forum
>{$p}</pos
ts></root>
";
|
|
296 |
|
re
turn "<roo
t>$cu<post
s><topic><
title>Repo
rted Posts
</title><i
d>0</id></
topic><for
um><id>0</
id></forum
>{$p}</pos
ts></root>
";
|
281 |
|
|
|
297 |
|
|
282 |
|
}
|
|
298 |
|
}
|
283 |
|
|
|
299 |
|
|
284 |
|
/**
|
|
300 |
|
/**
|
285 |
|
* loc
k/unlcok t
opic
|
|
301 |
|
* loc
k/unlcok t
opic
|
286 |
|
* @p
aram $topi
c_id to
pic id
|
|
302 |
|
* @p
aram $topi
c_id to
pic id
|
287 |
|
*/
|
|
303 |
|
*/
|
288 |
|
functi
on lock ($
topic_id)
|
|
304 |
|
functi
on lock ($
topic_id)
|
289 |
|
{
|
|
305 |
|
{
|
290 |
|
if
(!$topic_
id || !$th
is->_admin
) return '
<ret>0</re
t>';
|
|
306 |
|
if
(!$topic_
id || !$th
is->_admin
) return '
<ret>0</re
t>';
|
291 |
|
|
|
307 |
|
|
292 |
|
$d
b = new Db
Admin ();
|
|
308 |
|
$d
b = new Db
Admin ();
|
293 |
|
|
|
309 |
|
|
294 |
|
if
($db->isL
ocked ((in
t)$topic_i
d))
|
|
310 |
|
if
($db->isL
ocked ((in
t)$topic_i
d))
|
295 |
|
{
|
|
311 |
|
{
|
296 |
|
if (!$db
->lock ((i
nt)$topic_
id))
|
|
312 |
|
if (!$db
->lock ((i
nt)$topic_
id))
|
297 |
|
retu
rn '<ret>0
</ret>';
|
|
313 |
|
retu
rn '<ret>0
</ret>';
|
298 |
|
return '
<ret>-1</r
et>';
|
|
314 |
|
return '
<ret>-1</r
et>';
|
299 |
|
}
|
|
315 |
|
}
|
300 |
|
|
|
316 |
|
|
301 |
|
if
(!$db->lo
ck ((int)$
topic_id))
|
|
317 |
|
if
(!$db->lo
ck ((int)$
topic_id))
|
302 |
|
return '
<ret>0</re
t>';
|
|
318 |
|
return '
<ret>0</re
t>';
|
303 |
|
|
|
319 |
|
|
304 |
|
re
turn '<ret
>1</ret>';
|
|
320 |
|
re
turn '<ret
>1</ret>';
|
305 |
|
}
|
|
321 |
|
}
|
306 |
|
|
|
322 |
|
|
|
|
323 |
|
functi
on compile
Langs ()
|
|
|
324 |
|
{
|
|
|
325 |
|
gl
obal $gCon
f;
|
|
|
326 |
|
|
|
|
327 |
|
if
(!$this->
_admin)
|
|
|
328 |
|
{
|
|
|
329 |
|
return '
<ret>0</re
t>';
|
|
|
330 |
|
}
|
|
|
331 |
|
|
|
|
332 |
|
re
quire_once
( './class
es/BxLang.
php' );
|
|
|
333 |
|
re
quire_once
( $gConf['
dir']['xml
'].'lang.p
hp' );
|
|
|
334 |
|
|
|
|
335 |
|
$s
Lang = iss
et($_GET['
lang']) &&
preg_matc
h("/^[a-z]
{2}$/", $_
GET['lang'
]) ? $_GET
['lang'] :
$gConf['l
ang'];
|
|
|
336 |
|
$l
= new BxL
ang ($sLan
g, $gConf[
'skin']);
|
|
|
337 |
|
$l
->setVisua
lProcessin
g(0);
|
|
|
338 |
|
if
($l->comp
ile ())
|
|
|
339 |
|
return '
<ret>1</re
t>';
|
|
|
340 |
|
re
turn '<ret
>0</ret>';
|
|
|
341 |
|
}
|
|
|
342 |
|
|
307 |
|
}
|
|
343 |
|
}
|
308 |
|
|
|
344 |
|
|
309 |
|
|
|
345 |
|
|
310 |
|
?>
|
|
346 |
|
?>
|