No regular expressions were active.
1 |
|
<?
|
|
1 |
|
<?
|
2 |
|
|
|
2 |
|
|
3 |
|
/*********
**********
**********
**********
**********
**********
**********
******
|
|
3 |
|
/*********
**********
**********
**********
**********
**********
**********
******
|
4 |
|
*
D
olphin Sma
rt Communi
ty Builder
|
|
4 |
|
*
D
olphin Sma
rt Communi
ty Builder
|
5 |
|
*
---------
--------
|
|
5 |
|
*
---------
--------
|
6 |
|
* begi
n
: M
on Mar 23
2006
|
|
6 |
|
* begi
n
: M
on Mar 23
2006
|
7 |
|
* copy
right
: (
C) 2006 Bo
onEx Group
|
|
7 |
|
* copy
right
: (
C) 2006 Bo
onEx Group
|
8 |
|
* webs
ite
: h
ttp://www.
boonex.com
/
|
|
8 |
|
* webs
ite
: h
ttp://www.
boonex.com
/
|
9 |
|
* This fil
e is part
of Dolphin
- Smart C
ommunity B
uilder
|
|
9 |
|
* This fil
e is part
of Dolphin
- Smart C
ommunity B
uilder
|
10 |
|
*
|
|
10 |
|
*
|
11 |
|
* Dolphin
is free so
ftware. Th
is work is
licensed
under a Cr
eative Com
mons Attri
bution 3.0
License.
|
|
11 |
|
* Dolphin
is free so
ftware. Th
is work is
licensed
under a Cr
eative Com
mons Attri
bution 3.0
License.
|
12 |
|
* http://c
reativecom
mons.org/l
icenses/by
/3.0/
|
|
12 |
|
* http://c
reativecom
mons.org/l
icenses/by
/3.0/
|
13 |
|
*
|
|
13 |
|
*
|
14 |
|
* Dolphin
is distrib
uted in th
e hope tha
t it will
be useful,
but WITHO
UT ANY WAR
RANTY;
|
|
14 |
|
* Dolphin
is distrib
uted in th
e hope tha
t it will
be useful,
but WITHO
UT ANY WAR
RANTY;
|
15 |
|
* without
even the i
mplied war
ranty of
MERCHANTAB
ILITY or F
ITNESS FOR
A PARTICU
LAR PURPOS
E.
|
|
15 |
|
* without
even the i
mplied war
ranty of
MERCHANTAB
ILITY or F
ITNESS FOR
A PARTICU
LAR PURPOS
E.
|
16 |
|
* See the
Creative C
ommons Att
ribution 3
.0 License
for more
details.
|
|
16 |
|
* See the
Creative C
ommons Att
ribution 3
.0 License
for more
details.
|
17 |
|
* You shou
ld have re
ceived a c
opy of the
Creative
Commons At
tribution
3.0 Licens
e along wi
th Dolphin
,
|
|
17 |
|
* You shou
ld have re
ceived a c
opy of the
Creative
Commons At
tribution
3.0 Licens
e along wi
th Dolphin
,
|
18 |
|
* see lice
nse.txt fi
le; if not
, write to
marketing
@boonex.co
m
|
|
18 |
|
* see lice
nse.txt fi
le; if not
, write to
marketing
@boonex.co
m
|
19 |
|
**********
**********
**********
**********
**********
**********
**********
*****/
|
|
19 |
|
**********
**********
**********
**********
**********
**********
**********
*****/
|
20 |
|
|
|
20 |
|
|
21 |
|
require_on
ce( 'inc/h
eader.inc.
php' );
|
|
21 |
|
require_on
ce( 'inc/h
eader.inc.
php' );
|
22 |
|
require_on
ce( BX_DIR
ECTORY_PAT
H_INC . 'd
esign.inc.
php' );
|
|
22 |
|
require_on
ce( BX_DIR
ECTORY_PAT
H_INC . 'd
esign.inc.
php' );
|
23 |
|
require_on
ce( BX_DIR
ECTORY_PAT
H_INC . 'p
rofiles.in
c.php' );
|
|
23 |
|
require_on
ce( BX_DIR
ECTORY_PAT
H_INC . 'p
rofiles.in
c.php' );
|
24 |
|
require_on
ce( BX_DIR
ECTORY_PAT
H_INC . 'u
tils.inc.p
hp' );
|
|
24 |
|
require_on
ce( BX_DIR
ECTORY_PAT
H_INC . 'u
tils.inc.p
hp' );
|
25 |
|
|
|
25 |
|
|
26 |
|
// -------
-------- p
age variab
les and lo
gin
|
|
26 |
|
// -------
-------- p
age variab
les and lo
gin
|
27 |
|
|
|
27 |
|
|
28 |
|
$_page['na
me_index']
= 20;
|
|
28 |
|
$_page['na
me_index']
= 20;
|
29 |
|
$_page['cs
s_name']
= 'sto
ry.css';
|
|
29 |
|
$_page['cs
s_name']
= 'sto
ry.css';
|
30 |
|
$_page['ex
tra_js'] =
$oTemplCo
nfig -> sT
inyMceEdit
orCompactJ
S;
|
|
30 |
|
$_page['ex
tra_js'] =
$oTemplCo
nfig -> sT
inyMceEdit
orCompactJ
S;
|
31 |
|
|
|
31 |
|
|
32 |
|
$ADMIN = m
ember_auth
( 1, false
);
|
|
32 |
|
$ADMIN = m
ember_auth
( 1, false
);
|
33 |
|
$logged['a
dmin'] = $
ADMIN;
|
|
33 |
|
$logged['a
dmin'] = $
ADMIN;
|
34 |
|
if ( !$ADM
IN )
|
|
34 |
|
if ( !$ADM
IN )
|
35 |
|
$logge
d['member'
] = member
_auth();
|
|
35 |
|
$logge
d['member'
] = member
_auth();
|
36 |
|
|
|
36 |
|
|
37 |
|
$member['I
D'] = (int
)$_COOKIE[
'memberID'
];
|
|
37 |
|
$member['I
D'] = (int
)$_COOKIE[
'memberID'
];
|
38 |
|
$member['P
assword']
= $_COOKIE
['memberPa
ssword'];
|
|
38 |
|
$member['P
assword']
= $_COOKIE
['memberPa
ssword'];
|
39 |
|
|
|
39 |
|
|
40 |
|
$_page['he
ader'] = _
t( "_COMPO
SE_STORY_H
" );
|
|
40 |
|
$_page['he
ader'] = _
t( "_COMPO
SE_STORY_H
" );
|
41 |
|
$_page['he
ader_text'
] = _t( "_
COMPOSE_ST
ORY_H1" );
|
|
41 |
|
$_page['he
ader_text'
] = _t( "_
COMPOSE_ST
ORY_H1" );
|
42 |
|
//$_page['
header_tex
t'] = ('g4
' != $tmpl
) ? _t( "_
COMPOSE_ST
ORY_H1" )
: "<img sr
c=\"{$site
['images']
}feedback.
gif\">";
|
|
42 |
|
//$_page['
header_tex
t'] = ('g4
' != $tmpl
) ? _t( "_
COMPOSE_ST
ORY_H1" )
: "<img sr
c=\"{$site
['images']
}feedback.
gif\">";
|
43 |
|
|
|
43 |
|
|
44 |
|
|
|
44 |
|
|
45 |
|
// this is
dynamic p
age - sen
d headers
to do not
cache this
page
|
|
45 |
|
// this is
dynamic p
age - sen
d headers
to do not
cache this
page
|
46 |
|
send_heade
rs_page_ch
anged();
|
|
46 |
|
send_heade
rs_page_ch
anged();
|
47 |
|
|
|
47 |
|
|
48 |
|
// -------
-------- p
age compon
ents
|
|
48 |
|
// -------
-------- p
age compon
ents
|
49 |
|
|
|
49 |
|
|
50 |
|
$_ni = $_p
age['name_
index'];
|
|
50 |
|
$_ni = $_p
age['name_
index'];
|
51 |
|
$_page_con
t[$_ni]['p
age_main_c
ode'] = Pa
geCompPage
MainCode()
;
|
|
51 |
|
$_page_con
t[$_ni]['p
age_main_c
ode'] = Pa
geCompPage
MainCode()
;
|
52 |
|
|
|
52 |
|
|
53 |
|
// -------
-------- [
END] page
components
|
|
53 |
|
// -------
-------- [
END] page
components
|
54 |
|
|
|
54 |
|
|
55 |
|
PageCode()
;
|
|
55 |
|
PageCode()
;
|
56 |
|
|
|
56 |
|
|
57 |
|
// -------
-------- p
age compon
ents funct
ions
|
|
57 |
|
// -------
-------- p
age compon
ents funct
ions
|
58 |
|
|
|
58 |
|
|
59 |
|
/**
|
|
59 |
|
/**
|
60 |
|
* page co
de functio
n
|
|
60 |
|
* page co
de functio
n
|
61 |
|
*/
|
|
61 |
|
*/
|
62 |
|
function P
ageCompPag
eMainCode(
)
|
|
62 |
|
function P
ageCompPag
eMainCode(
)
|
63 |
|
{
|
|
63 |
|
{
|
64 |
|
global
$site;
|
|
64 |
|
global
$site;
|
65 |
|
global
$dir;
|
|
|
66 |
|
global
$tmpl;
|
|
65 |
|
global
$tmpl;
|
67 |
|
global
$ADMIN;
|
|
66 |
|
global
$ADMIN;
|
68 |
|
global
$max_l;
|
|
67 |
|
global
$max_l;
|
69 |
|
global
$max_h;
|
|
68 |
|
global
$max_h;
|
70 |
|
global
$short_da
te_format;
|
|
69 |
|
global
$short_da
te_format;
|
71 |
|
|
|
70 |
|
|
72 |
|
$max_l
= getPar
am( "max_s
tory_text"
);
|
|
71 |
|
$max_l
= getPar
am( "max_s
tory_text"
);
|
73 |
|
$max_h
= getPar
am( "max_s
tory_heade
r" );
|
|
72 |
|
$max_h
= getPar
am( "max_s
tory_heade
r" );
|
74 |
|
|
|
73 |
|
|
75 |
|
ob_sta
rt();
|
|
74 |
|
ob_sta
rt();
|
76 |
|
|
|
75 |
|
|
77 |
|
if ( !
$max_l ) $
max_l = 40
96;
|
|
76 |
|
if ( !
$max_l ) $
max_l = 40
96;
|
78 |
|
if ( !
$max_h ) $
max_h = 32
;
|
|
77 |
|
if ( !
$max_h ) $
max_h = 32
;
|
79 |
|
$actio
n_result =
"";
|
|
78 |
|
$actio
n_result =
"";
|
80 |
|
|
|
79 |
|
|
81 |
|
if ( $
_POST['act
ion'] == '
new' )
|
|
80 |
|
if ( $
_POST['act
ion'] == '
new' )
|
82 |
|
{
|
|
81 |
|
{
|
83 |
|
if
( strlen(
$_POST['he
ader']) )
|
|
82 |
|
if
( strlen(
$_POST['he
ader']) )
|
84 |
|
{
|
|
83 |
|
{
|
85 |
|
if ( Mem
berAddStor
y() )
|
|
84 |
|
if ( Mem
berAddStor
y() )
|
86 |
|
$act
ion_result
.= _t( "_
STORY_ADDE
D" );
|
|
85 |
|
$act
ion_result
.= _t( "_
STORY_ADDE
D" );
|
87 |
|
else
|
|
86 |
|
else
|
88 |
|
$act
ion_result
.= _t_err
( "_STORY_
ADDED_FAIL
ED" );
|
|
87 |
|
$act
ion_result
.= _t_err
( "_STORY_
ADDED_FAIL
ED" );
|
89 |
|
}
|
|
88 |
|
}
|
90 |
|
el
se
|
|
89 |
|
el
se
|
91 |
|
$action_
result .=
_t_err( "_
STORY_EMPT
Y_HEADER"
);
|
|
90 |
|
$action_
result .=
_t_err( "_
STORY_EMPT
Y_HEADER"
);
|
92 |
|
}
|
|
91 |
|
}
|
93 |
|
|
|
92 |
|
|
94 |
|
if ( $
_POST['act
ion'] == '
edit' && (
(int)$_POS
T['edit_id
'] != 0) )
|
|
93 |
|
if ( $
_POST['act
ion'] == '
edit' && (
(int)$_POS
T['edit_id
'] != 0) )
|
95 |
|
{
|
|
94 |
|
{
|
96 |
|
if
( strlen(
$_POST['he
ader']) )
|
|
95 |
|
if
( strlen(
$_POST['he
ader']) )
|
97 |
|
{
|
|
96 |
|
{
|
98 |
|
if ( Mem
berEditSto
ry() )
|
|
97 |
|
if ( Mem
berEditSto
ry() )
|
99 |
|
$act
ion_result
.= _t( "_
STORY_UPDA
TED" );
|
|
98 |
|
$act
ion_result
.= _t( "_
STORY_UPDA
TED" );
|
100 |
|
else
|
|
99 |
|
else
|
101 |
|
$act
ion_result
.= _t_err
( "_STORY_
UPDATED_FA
ILED" );
|
|
100 |
|
$act
ion_result
.= _t_err
( "_STORY_
UPDATED_FA
ILED" );
|
102 |
|
}
|
|
101 |
|
}
|
103 |
|
el
se
|
|
102 |
|
el
se
|
104 |
|
$action_
result .=
_t_err( "_
STORY_EMPT
Y_HEADER"
);
|
|
103 |
|
$action_
result .=
_t_err( "_
STORY_EMPT
Y_HEADER"
);
|
105 |
|
}
|
|
104 |
|
}
|
106 |
|
|
|
105 |
|
|
107 |
|
if ( $
_POST['do_
delete'] a
nd $_POST[
'select_st
ory'] and
is_array($
_POST['sel
ect_story'
]) )
|
|
106 |
|
if ( $
_POST['do_
delete'] a
nd $_POST[
'select_st
ory'] and
is_array($
_POST['sel
ect_story'
]) )
|
108 |
|
{
|
|
107 |
|
{
|
109 |
|
$s
qlAdd = $A
DMIN ? ''
: "AND `Se
nder`=" .
(int)$_COO
KIE['membe
rID'];
|
|
108 |
|
$s
qlAdd = $A
DMIN ? ''
: "AND `Se
nder`=" .
(int)$_COO
KIE['membe
rID'];
|
110 |
|
|
|
109 |
|
|
111 |
|
fo
reach( $_P
OST['selec
t_story']
as $iStory
ID )
|
|
110 |
|
fo
reach( $_P
OST['selec
t_story']
as $iStory
ID )
|
112 |
|
{
|
|
111 |
|
{
|
113 |
|
$iStoryI
D = (int)$
iStoryID;
|
|
112 |
|
$iStoryI
D = (int)$
iStoryID;
|
114 |
|
if( !$iS
toryID )
|
|
113 |
|
if( !$iS
toryID )
|
115 |
|
cont
inue;
|
|
114 |
|
cont
inue;
|
116 |
|
|
|
115 |
|
|
117 |
|
$sQuery
= "DELETE
FROM `Stor
ies` WHERE
`ID`=$iSt
oryID $sql
Add";
|
|
116 |
|
$sQuery
= "DELETE
FROM `Stor
ies` WHERE
`ID`=$iSt
oryID $sql
Add";
|
118 |
|
db_res(
$sQuery );
|
|
117 |
|
db_res(
$sQuery );
|
119 |
|
}
|
|
118 |
|
}
|
120 |
|
}
|
|
119 |
|
}
|
121 |
|
|
|
120 |
|
|
122 |
|
if ( $
ADMIN and
$_POST['do
_activate'
] and $_PO
ST['select
_story'] a
nd is_arra
y($_POST['
select_sto
ry']) )
|
|
121 |
|
if ( $
ADMIN and
$_POST['do
_activate'
] and $_PO
ST['select
_story'] a
nd is_arra
y($_POST['
select_sto
ry']) )
|
123 |
|
{
|
|
122 |
|
{
|
124 |
|
fo
reach( $_P
OST['selec
t_story']
as $iStory
ID )
|
|
123 |
|
fo
reach( $_P
OST['selec
t_story']
as $iStory
ID )
|
125 |
|
{
|
|
124 |
|
{
|
126 |
|
$iStoryI
D = (int)$
iStoryID;
|
|
125 |
|
$iStoryI
D = (int)$
iStoryID;
|
127 |
|
if( !$iS
toryID )
|
|
126 |
|
if( !$iS
toryID )
|
128 |
|
cont
inue;
|
|
127 |
|
cont
inue;
|
129 |
|
|
|
128 |
|
|
130 |
|
$sQuery
= "UPDATE
`Stories`
SET `activ
e`='on' WH
ERE `ID`=$
iStoryID";
|
|
129 |
|
$sQuery
= "UPDATE
`Stories`
SET `activ
e`='on' WH
ERE `ID`=$
iStoryID";
|
131 |
|
db_res(
$sQuery );
|
|
130 |
|
db_res(
$sQuery );
|
132 |
|
}
|
|
131 |
|
}
|
133 |
|
}
|
|
132 |
|
}
|
134 |
|
|
|
133 |
|
|
135 |
|
if ( $
ADMIN and
$_POST['do
_deactivat
e'] and $_
POST['sele
ct_story']
and is_ar
ray($_POST
['select_s
tory']) )
|
|
134 |
|
if ( $
ADMIN and
$_POST['do
_deactivat
e'] and $_
POST['sele
ct_story']
and is_ar
ray($_POST
['select_s
tory']) )
|
136 |
|
{
|
|
135 |
|
{
|
137 |
|
fo
reach( $_P
OST['selec
t_story']
as $iStory
ID )
|
|
136 |
|
fo
reach( $_P
OST['selec
t_story']
as $iStory
ID )
|
138 |
|
{
|
|
137 |
|
{
|
139 |
|
$iStoryI
D = (int)$
iStoryID;
|
|
138 |
|
$iStoryI
D = (int)$
iStoryID;
|
140 |
|
if( !$iS
toryID )
|
|
139 |
|
if( !$iS
toryID )
|
141 |
|
cont
inue;
|
|
140 |
|
cont
inue;
|
142 |
|
|
|
141 |
|
|
143 |
|
$sQuery
= "UPDATE
`Stories`
SET `activ
e`='' WHER
E `ID`=$iS
toryID";
|
|
142 |
|
$sQuery
= "UPDATE
`Stories`
SET `activ
e`='' WHER
E `ID`=$iS
toryID";
|
144 |
|
db_res(
$sQuery );
|
|
143 |
|
db_res(
$sQuery );
|
145 |
|
}
|
|
144 |
|
}
|
146 |
|
}
|
|
145 |
|
}
|
147 |
|
|
|
146 |
|
|
148 |
|
|
|
147 |
|
|
149 |
|
|
|
148 |
|
|
150 |
|
|
|
149 |
|
|
151 |
|
|
|
150 |
|
|
152 |
|
if ( !
$ADMIN )
|
|
151 |
|
if ( !
$ADMIN )
|
153 |
|
ec
ho "<table
width=\"1
00%\" cell
padding=4
cellspacin
g=4><td al
ign=center
class=tex
t2>\n";
|
|
152 |
|
ec
ho "<table
width=\"1
00%\" cell
padding=4
cellspacin
g=4><td al
ign=center
class=tex
t2>\n";
|
154 |
|
else
|
|
153 |
|
else
|
155 |
|
ec
ho "<div s
tyle=\"pad
ding: 10px
10px 10px
10px;\">"
;
|
|
154 |
|
ec
ho "<div s
tyle=\"pad
ding: 10px
10px 10px
10px;\">"
;
|
156 |
|
|
|
155 |
|
|
157 |
|
if ( s
trlen($act
ion_result
) )
|
|
156 |
|
if ( s
trlen($act
ion_result
) )
|
158 |
|
ec
ho "<br />
<center><d
iv>{$actio
n_result}<
/div></cen
ter><br />
\n";
|
|
157 |
|
ec
ho "<br />
<center><d
iv>{$actio
n_result}<
/div></cen
ter><br />
\n";
|
159 |
|
|
|
158 |
|
|
160 |
|
echo M
emberPrint
Stories();
|
|
159 |
|
echo M
emberPrint
Stories();
|
161 |
|
|
|
160 |
|
|
162 |
|
if ( !
$ADMIN ||
((int)$_GE
T['edit_id
']) != 0 )
|
|
161 |
|
if ( !
$ADMIN ||
((int)$_GE
T['edit_id
']) != 0 )
|
163 |
|
{
|
|
162 |
|
{
|
164 |
|
if
( (int)$_
GET['edit_
id'] != 0
)
|
|
163 |
|
if
( (int)$_
GET['edit_
id'] != 0
)
|
165 |
|
$story_a
rr = db_ar
r( "SELECT
* FROM `S
tories` WH
ERE `ID` =
". (int)$
_GET['edit
_id'] );
|
|
164 |
|
$story_a
rr = db_ar
r( "SELECT
* FROM `S
tories` WH
ERE `ID` =
". (int)$
_GET['edit
_id'] );
|
166 |
|
|
|
165 |
|
|
167 |
|
$a
ctions = '
';
|
|
166 |
|
$a
ctions = '
';
|
168 |
|
if
( (int)$_
GET['edit_
id'] )
|
|
167 |
|
if
( (int)$_
GET['edit_
id'] )
|
169 |
|
{
|
|
168 |
|
{
|
170 |
|
$actions
.= '<inpu
t type="hi
dden" name
="action"
value="ed
it" />';
|
|
169 |
|
$actions
.= '<inpu
t type="hi
dden" name
="action"
value="ed
it" />';
|
171 |
|
$actions
.= '<inpu
t type="hi
dden" name
="sender"
value="'
. $story_a
rr['Sender
'] . '" />
';
|
|
170 |
|
$actions
.= '<inpu
t type="hi
dden" name
="sender"
value="'
. $story_a
rr['Sender
'] . '" />
';
|
172 |
|
$actions
.= '<inpu
t type="hi
dden" name
="edit_id"
value="'
. $story_a
rr['ID'] .
'" />';
|
|
171 |
|
$actions
.= '<inpu
t type="hi
dden" name
="edit_id"
value="'
. $story_a
rr['ID'] .
'" />';
|
173 |
|
$actions
.= '<inpu
t class="n
o" type="s
ubmit" val
ue="'._t('
_Update st
ory').'" /
>';
|
|
172 |
|
$actions
.= '<inpu
t class="n
o" type="s
ubmit" val
ue="'._t('
_Update st
ory').'" /
>';
|
174 |
|
}
|
|
173 |
|
}
|
175 |
|
el
se
|
|
174 |
|
el
se
|
176 |
|
{
|
|
175 |
|
{
|
177 |
|
$actions
.= '<inpu
t type="hi
dden" name
="action"
value="new
" />';
|
|
176 |
|
$actions
.= '<inpu
t type="hi
dden" name
="action"
value="new
" />';
|
178 |
|
$actions
.= '<inpu
t class="n
o" type="s
ubmit" val
ue="'._t(
"_Add stor
y" ) .'" /
>';
|
|
177 |
|
$actions
.= '<inpu
t class="n
o" type="s
ubmit" val
ue="'._t(
"_Add stor
y" ) .'" /
>';
|
179 |
|
}
|
|
178 |
|
}
|
180 |
|
|
|
179 |
|
|
181 |
|
|
|
180 |
|
|
182 |
|
$a
Replace =
array();
|
|
181 |
|
$a
Replace =
array();
|
183 |
|
|
|
182 |
|
|
184 |
|
$a
Replace['i
cons']
= $site['i
cons'];
|
|
183 |
|
$a
Replace['i
cons']
= $site['i
cons'];
|
185 |
|
$a
Replace['h
eader_l']
= _t( "_He
ader" );
|
|
184 |
|
$a
Replace['h
eader_l']
= _t( "_He
ader" );
|
186 |
|
$a
Replace['t
ext_l']
= _t( "_Te
xt" );
|
|
185 |
|
$a
Replace['t
ext_l']
= _t( "_Te
xt" );
|
187 |
|
|
|
186 |
|
|
188 |
|
$a
Replace['f
orm_action
'] = $_SE
RVER['PHP_
SELF'];
|
|
187 |
|
$a
Replace['f
orm_action
'] = $_SE
RVER['PHP_
SELF'];
|
189 |
|
$a
Replace['s
tory_heade
r'] = html
specialcha
rs( $story
_arr['Head
er'] );
|
|
188 |
|
$a
Replace['s
tory_heade
r'] = html
specialcha
rs( $story
_arr['Head
er'] );
|
190 |
|
$a
Replace['s
tory_text'
] = html
specialcha
rs( $story
_arr['Text
'] );
|
|
189 |
|
$a
Replace['s
tory_text'
] = html
specialcha
rs( $story
_arr['Text
'] );
|
191 |
|
|
|
190 |
|
|
192 |
|
$a
Replace['a
ctions'] =
$actions;
|
|
191 |
|
$a
Replace['a
ctions'] =
$actions;
|
193 |
|
|
|
192 |
|
|
194 |
|
|
|
193 |
|
|
195 |
|
$sForm
=
file_get_c
ontents(
"
{$dir['roo
t']}
templates/
tmpl_{$tmp
l}/story_e
dit.html"
);
|
|
194 |
|
$sForm
=
file_get_c
ontents(
BX_DIRECTO
RY_PATH_RO
OT
.
"
templates/
tmpl_{$tmp
l}/story_e
dit.html"
);
|
196 |
|
fo
reach( $aR
eplace as
$key => $v
al )
|
|
195 |
|
fo
reach( $aR
eplace as
$key => $v
al )
|
197 |
|
$sForm =
str_repla
ce( "__{$k
ey}__", $v
al, $sForm
);
|
|
196 |
|
$sForm =
str_repla
ce( "__{$k
ey}__", $v
al, $sForm
);
|
198 |
|
|
|
197 |
|
|
199 |
|
ec
ho $sForm;
|
|
198 |
|
ec
ho $sForm;
|
200 |
|
}
|
|
199 |
|
}
|
201 |
|
|
|
200 |
|
|
202 |
|
if ( !
$ADMIN )
|
|
201 |
|
if ( !
$ADMIN )
|
203 |
|
ec
ho "</td><
/table>\n"
;
|
|
202 |
|
ec
ho "</td><
/table>\n"
;
|
204 |
|
else
|
|
203 |
|
else
|
205 |
|
ec
ho "</div>
\n";
|
|
204 |
|
ec
ho "</div>
\n";
|
206 |
|
|
|
205 |
|
|
207 |
|
$ret =
ob_get_cl
ean();
|
|
206 |
|
$ret =
ob_get_cl
ean();
|
208 |
|
|
|
207 |
|
|
209 |
|
return
$ret;
|
|
208 |
|
return
$ret;
|
210 |
|
}
|
|
209 |
|
}
|
211 |
|
|
|
210 |
|
|
212 |
|
/**
|
|
211 |
|
/**
|
213 |
|
* Print S
tories
|
|
212 |
|
* Print S
tories
|
214 |
|
*/
|
|
213 |
|
*/
|
215 |
|
function M
emberPrint
Stories()
|
|
214 |
|
function M
emberPrint
Stories()
|
216 |
|
{
|
|
215 |
|
{
|
217 |
|
global
$member;
|
|
216 |
|
global
$member;
|
218 |
|
global
$ADMIN;
|
|
217 |
|
global
$ADMIN;
|
219 |
|
|
|
218 |
|
|
220 |
|
$php_d
ate_format
= getPara
m( 'php_da
te_format'
);
|
|
219 |
|
$php_d
ate_format
= getPara
m( 'php_da
te_format'
);
|
221 |
|
|
|
220 |
|
|
222 |
|
if ( $
ADMIN )
|
|
221 |
|
if ( $
ADMIN )
|
223 |
|
$r
es = db_re
s( "SELECT
`ID`, UNI
X_TIMESTAM
P( `Date`
) AS `Date
`, `Sender
`, `Header
`, `Text`,
`active`
FROM `Stor
ies`
OR
DER BY `Da
te` DESC"
);
|
|
222 |
|
$r
es = db_re
s( "SELECT
`ID`, UNI
X_TIMESTAM
P( `Date`
) AS `Date
`, `Sender
`, `Header
`, `Text`,
`active`
FROM `Stor
ies`
OR
DER BY `Da
te` DESC"
);
|
224 |
|
else
|
|
223 |
|
else
|
225 |
|
$r
es = db_re
s( "SELECT
`ID`, UNI
X_TIMESTAM
P( `Date`
) AS `Date
`, `Sender
`, `Header
`, `Text`,
`active`
FROM `Stor
ies` WHERE
`Sender`
= {$member
['ID']} OR
DER BY `Da
te` DESC"
);
|
|
224 |
|
$r
es = db_re
s( "SELECT
`ID`, UNI
X_TIMESTAM
P( `Date`
) AS `Date
`, `Sender
`, `Header
`, `Text`,
`active`
FROM `Stor
ies` WHERE
`Sender`
= {$member
['ID']} OR
DER BY `Da
te` DESC"
);
|
226 |
|
|
|
225 |
|
|
227 |
|
if ( $
ADMIN && !
mysql_num_
rows($res)
)
|
|
226 |
|
if ( $
ADMIN && !
mysql_num_
rows($res)
)
|
228 |
|
re
turn MsgBo
x( _t( '_N
o stories
available'
) );
|
|
227 |
|
re
turn MsgBo
x( _t( '_N
o stories
available'
) );
|
229 |
|
|
|
228 |
|
|
230 |
|
ob_sta
rt();
|
|
229 |
|
ob_sta
rt();
|
231 |
|
|
|
230 |
|
|
232 |
|
?>
|
|
231 |
|
?>
|
233 |
|
<form meth
od="post"
action="<?
= $_SERVER
['PHP_SELF
'] ?>">
|
|
232 |
|
<form meth
od="post"
action="<?
= $_SERVER
['PHP_SELF
'] ?>">
|
234 |
|
<table
class="st
ories_list
">
|
|
233 |
|
<table
class="st
ories_list
">
|
235 |
|
<t
r>
|
|
234 |
|
<t
r>
|
236 |
|
<th><?=
_t( '_Sele
ct' ) ?></
th>
|
|
235 |
|
<th><?=
_t( '_Sele
ct' ) ?></
th>
|
237 |
|
<th><?=
_t( '_Stat
us' ) ?></
th>
|
|
236 |
|
<th><?=
_t( '_Stat
us' ) ?></
th>
|
238 |
|
<th><?=
_t( '_Date
' ) ?></th
>
|
|
237 |
|
<th><?=
_t( '_Date
' ) ?></th
>
|
239 |
|
<th><?=
_t( '_Titl
e' ) ?></t
h>
|
|
238 |
|
<th><?=
_t( '_Titl
e' ) ?></t
h>
|
240 |
|
</
tr>
|
|
239 |
|
</
tr>
|
241 |
|
<?
|
|
240 |
|
<?
|
242 |
|
|
|
241 |
|
|
243 |
|
$story
_line_clas
s = 'odd';
|
|
242 |
|
$story
_line_clas
s = 'odd';
|
244 |
|
|
|
243 |
|
|
245 |
|
while
( $story_a
rr = mysql
_fetch_arr
ay($res) )
|
|
244 |
|
while
( $story_a
rr = mysql
_fetch_arr
ay($res) )
|
246 |
|
{
|
|
245 |
|
{
|
247 |
|
$s
tory_statu
s = _t( $s
tory_arr['
active'] ?
'_active_
story' : '
_not_activ
e_story' )
;
|
|
246 |
|
$s
tory_statu
s = _t( $s
tory_arr['
active'] ?
'_active_
story' : '
_not_activ
e_story' )
;
|
248 |
|
$s
tory_statu
s_class =
$story_arr
['active']
? 'status
_active' :
'status_i
nactive';
|
|
247 |
|
$s
tory_statu
s_class =
$story_arr
['active']
? 'status
_active' :
'status_i
nactive';
|
249 |
|
$s
tory_heade
r = proces
s_line_out
put( $stor
y_arr['Hea
der'] );
|
|
248 |
|
$s
tory_heade
r = proces
s_line_out
put( $stor
y_arr['Hea
der'] );
|
250 |
|
|
|
249 |
|
|
251 |
|
?>
|
|
250 |
|
?>
|
252 |
|
<t
r class="l
ine_<?= $s
tory_line_
class ?>">
|
|
251 |
|
<t
r class="l
ine_<?= $s
tory_line_
class ?>">
|
253 |
|
<td>
|
|
252 |
|
<td>
|
254 |
|
<inp
ut type="c
heckbox" n
ame="selec
t_story[]"
value="<?
= $story_a
rr['ID'] ?
>" />
|
|
253 |
|
<inp
ut type="c
heckbox" n
ame="selec
t_story[]"
value="<?
= $story_a
rr['ID'] ?
>" />
|
255 |
|
</td>
|
|
254 |
|
</td>
|
256 |
|
<td clas
s="<?= $st
ory_status
_class ?>"
>
|
|
255 |
|
<td clas
s="<?= $st
ory_status
_class ?>"
>
|
257 |
|
<?=
$story_sta
tus ?>
|
|
256 |
|
<?=
$story_sta
tus ?>
|
258 |
|
</td>
|
|
257 |
|
</td>
|
259 |
|
<td><?=
date( $php
_date_form
at, $story
_arr['Date
'] ) ?></t
d>
|
|
258 |
|
<td><?=
date( $php
_date_form
at, $story
_arr['Date
'] ) ?></t
d>
|
260 |
|
<td>
|
|
259 |
|
<td>
|
261 |
|
<b><
a href="st
ory_view.p
hp?ID=<?=
$story_arr
['ID'] ?>"
><?= $stor
y_header ?
></a></b>
|
|
260 |
|
<b><
a href="st
ory_view.p
hp?ID=<?=
$story_arr
['ID'] ?>"
><?= $stor
y_header ?
></a></b>
|
262 |
|
(<a
href="stor
y.php?edit
_id=<?= $s
tory_arr['
ID'] ?>&se
nder=<?= $
story_arr[
'Sender']
?>"><?= _t
('_Edit')
?></a>)
|
|
261 |
|
(<a
href="stor
y.php?edit
_id=<?= $s
tory_arr['
ID'] ?>&se
nder=<?= $
story_arr[
'Sender']
?>"><?= _t
('_Edit')
?></a>)
|
263 |
|
</td>
|
|
262 |
|
</td>
|
264 |
|
</
tr>
|
|
263 |
|
</
tr>
|
265 |
|
<?
|
|
264 |
|
<?
|
266 |
|
|
|
265 |
|
|
267 |
|
$s
tory_line_
class = $s
tory_line_
class == '
odd' ? 'ev
en' : 'odd
';
|
|
266 |
|
$s
tory_line_
class = $s
tory_line_
class == '
odd' ? 'ev
en' : 'odd
';
|
268 |
|
}
|
|
267 |
|
}
|
269 |
|
?>
|
|
268 |
|
?>
|
270 |
|
<t
r>
|
|
269 |
|
<t
r>
|
271 |
|
<td cols
pan="4">
|
|
270 |
|
<td cols
pan="4">
|
272 |
|
<?
|
|
271 |
|
<?
|
273 |
|
if( $A
DMIN )
|
|
272 |
|
if( $A
DMIN )
|
274 |
|
{
|
|
273 |
|
{
|
275 |
|
?>
|
|
274 |
|
?>
|
276 |
|
<inp
ut type="s
ubmit" nam
e="do_acti
vate" valu
e="Make ac
tive" />
|
|
275 |
|
<inp
ut type="s
ubmit" nam
e="do_acti
vate" valu
e="Make ac
tive" />
|
277 |
|
<inp
ut type="s
ubmit" nam
e="do_deac
tivate" va
lue="Make
inactive"
/>
|
|
276 |
|
<inp
ut type="s
ubmit" nam
e="do_deac
tivate" va
lue="Make
inactive"
/>
|
278 |
|
|
|
277 |
|
|
279 |
|
<?
|
|
278 |
|
<?
|
280 |
|
}
|
|
279 |
|
}
|
281 |
|
?>
|
|
280 |
|
?>
|
282 |
|
<inp
ut type="s
ubmit" nam
e="do_dele
te" value=
"<?= _t( '
_Delete' )
?>" oncli
ck="return
confirm(
'<?= _t('_
Are you su
re') ?>?'
);" />
|
|
281 |
|
<inp
ut type="s
ubmit" nam
e="do_dele
te" value=
"<?= _t( '
_Delete' )
?>" oncli
ck="return
confirm(
'<?= _t('_
Are you su
re') ?>?'
);" />
|
283 |
|
</td>
|
|
282 |
|
</td>
|
284 |
|
</
tr>
|
|
283 |
|
</
tr>
|
285 |
|
</tabl
e>
|
|
284 |
|
</tabl
e>
|
286 |
|
</form>
|
|
285 |
|
</form>
|
287 |
|
<!-- <
a href="st
ory.php?ac
tion=delet
e&delete_i
d=<?= $sto
ry_arr['ID
'] ?>&send
er=<?= $st
ory_arr['S
ender'] ?>
"><?= _t('
_Delete')
?></a> -->
|
|
286 |
|
<!-- <
a href="st
ory.php?ac
tion=delet
e&delete_i
d=<?= $sto
ry_arr['ID
'] ?>&send
er=<?= $st
ory_arr['S
ender'] ?>
"><?= _t('
_Delete')
?></a> -->
|
288 |
|
<?
|
|
287 |
|
<?
|
289 |
|
|
|
288 |
|
|
290 |
|
return
ob_get_cl
ean();
|
|
289 |
|
return
ob_get_cl
ean();
|
291 |
|
}
|
|
290 |
|
}
|
292 |
|
|
|
291 |
|
|
293 |
|
/**
|
|
292 |
|
/**
|
294 |
|
* Add sto
ry
|
|
293 |
|
* Add sto
ry
|
295 |
|
*/
|
|
294 |
|
*/
|
296 |
|
function M
emberAddSt
ory()
|
|
295 |
|
function M
emberAddSt
ory()
|
297 |
|
{
|
|
296 |
|
{
|
298 |
|
global
$max_l;
|
|
297 |
|
global
$max_l;
|
299 |
|
global
$max_h;
|
|
298 |
|
global
$max_h;
|
300 |
|
global
$member;
|
|
299 |
|
global
$member;
|
301 |
|
global
$ADMIN;
|
|
300 |
|
global
$ADMIN;
|
302 |
|
|
|
301 |
|
|
303 |
|
if ( $
ADMIN )
|
|
302 |
|
if ( $
ADMIN )
|
304 |
|
re
turn 0;
|
|
303 |
|
re
turn 0;
|
305 |
|
|
|
304 |
|
|
306 |
|
$story
_text = st
rlen( $_PO
ST['text']
) > $max_
l ? "LEFT
( '". adds
lashes(cle
ar_xss( pr
ocess_pass
_data($_PO
ST['text']
) )) ."',
$max_l )"
: "'". add
slashes(cl
ear_xss( p
rocess_pas
s_data($_P
OST['text'
] ))) ."'"
;
|
|
305 |
|
$story
_text = st
rlen( $_PO
ST['text']
) > $max_
l ? "LEFT
( '". adds
lashes(cle
ar_xss( pr
ocess_pass
_data($_PO
ST['text']
) )) ."',
$max_l )"
: "'". add
slashes(cl
ear_xss( p
rocess_pas
s_data($_P
OST['text'
] ))) ."'"
;
|
307 |
|
$story
_header =
strlen( $_
POST['head
er'] ) > $
max_h ? "L
EFT ( '".
process_db
_input( $_
POST['head
er'] ) ."'
, $max_h )
" : "'". p
rocess_db_
input( $_P
OST['heade
r'] ). "'"
;
|
|
306 |
|
$story
_header =
strlen( $_
POST['head
er'] ) > $
max_h ? "L
EFT ( '".
process_db
_input( $_
POST['head
er'] ) ."'
, $max_h )
" : "'". p
rocess_db_
input( $_P
OST['heade
r'] ). "'"
;
|
308 |
|
$story
_sender =
(int)$memb
er['ID'];
|
|
307 |
|
$story
_sender =
(int)$memb
er['ID'];
|
309 |
|
$sQuer
y = "
|
|
308 |
|
$sQuer
y = "
|
310 |
|
IN
SERT INTO
`Stori
es`
|
|
309 |
|
IN
SERT INTO
`Stori
es`
|
311 |
|
SE
T
`Date`
= NOW(),
|
|
310 |
|
SE
T
`Date`
= NOW(),
|
312 |
|
`Sende
r` = '$sto
ry_sender'
,
|
|
311 |
|
`Sende
r` = '$sto
ry_sender'
,
|
313 |
|
`Heade
r` = $stor
y_header,
|
|
312 |
|
`Heade
r` = $stor
y_header,
|
314 |
|
`Text`
= $story_
text
|
|
313 |
|
`Text`
= $story_
text
|
315 |
|
";
|
|
314 |
|
";
|
316 |
|
$res =
db_res( $
sQuery );
|
|
315 |
|
$res =
db_res( $
sQuery );
|
317 |
|
|
|
316 |
|
|
318 |
|
return
$res;
|
|
317 |
|
return
$res;
|
319 |
|
}
|
|
318 |
|
}
|
320 |
|
|
|
319 |
|
|
321 |
|
/**
|
|
320 |
|
/**
|
322 |
|
* Cange s
tory
|
|
321 |
|
* Cange s
tory
|
323 |
|
*/
|
|
322 |
|
*/
|
324 |
|
function M
emberEditS
tory()
|
|
323 |
|
function M
emberEditS
tory()
|
325 |
|
{
|
|
324 |
|
{
|
326 |
|
global
$max_l;
|
|
325 |
|
global
$max_l;
|
327 |
|
global
$max_h;
|
|
326 |
|
global
$max_h;
|
328 |
|
global
$member;
|
|
327 |
|
global
$member;
|
329 |
|
global
$ADMIN;
|
|
328 |
|
global
$ADMIN;
|
330 |
|
|
|
329 |
|
|
331 |
|
$story
_id = (int
)$_POST['e
dit_id'];
|
|
330 |
|
$story
_id = (int
)$_POST['e
dit_id'];
|
332 |
|
$story
_text = st
rlen( $_PO
ST['text']
) > $max_
l ? "LEFT
( '". adds
lashes(cle
ar_xss( pr
ocess_pass
_data($_PO
ST['text']
))) ."',
$max_l )"
: "'". add
slashes(cl
ear_xss( p
rocess_pas
s_data($_P
OST['text'
] ))) ."'"
;
|
|
331 |
|
$story
_text = st
rlen( $_PO
ST['text']
) > $max_
l ? "LEFT
( '". adds
lashes(cle
ar_xss( pr
ocess_pass
_data($_PO
ST['text']
))) ."',
$max_l )"
: "'". add
slashes(cl
ear_xss( p
rocess_pas
s_data($_P
OST['text'
] ))) ."'"
;
|
333 |
|
$story
_header =
strlen( $_
POST['head
er'] ) > $
max_h ? "L
EFT ( '".
process_db
_input( $_
POST['head
er'] ) ."'
, $max_h )
" : "'". p
rocess_db_
input( $_P
OST['heade
r'] ). "'"
;
|
|
332 |
|
$story
_header =
strlen( $_
POST['head
er'] ) > $
max_h ? "L
EFT ( '".
process_db
_input( $_
POST['head
er'] ) ."'
, $max_h )
" : "'". p
rocess_db_
input( $_P
OST['heade
r'] ). "'"
;
|
334 |
|
$story
_sender =
( $ADMIN ?
(int)$_PO
ST['sender
'] : $memb
er['ID'] )
;
|
|
333 |
|
$story
_sender =
( $ADMIN ?
(int)$_PO
ST['sender
'] : $memb
er['ID'] )
;
|
335 |
|
$story
_active_ad
d = ( $ADM
IN ? '' :
", `active
`=''" ); /
/if admin
logged, do
n't update
status. i
f member -
set inact
ive
|
|
334 |
|
$story
_active_ad
d = ( $ADM
IN ? '' :
", `active
`=''" ); /
/if admin
logged, do
n't update
status. i
f member -
set inact
ive
|
336 |
|
|
|
335 |
|
|
337 |
|
$sQuer
y = "UPDAT
E `Stories
` SET `Dat
e` = NOW()
, `Header`
= $story_
header, `T
ext` = $st
ory_text $
story_acti
ve_add WHE
RE `ID` =
$story_id
AND `Sende
r` = $stor
y_sender";
|
|
336 |
|
$sQuer
y = "UPDAT
E `Stories
` SET `Dat
e` = NOW()
, `Header`
= $story_
header, `T
ext` = $st
ory_text $
story_acti
ve_add WHE
RE `ID` =
$story_id
AND `Sende
r` = $stor
y_sender";
|
338 |
|
$res =
db_res( $
sQuery );
|
|
337 |
|
$res =
db_res( $
sQuery );
|
339 |
|
|
|
338 |
|
|
340 |
|
return
$res;
|
|
339 |
|
return
$res;
|
341 |
|
}
|
|
340 |
|
}
|
342 |
|
|
|
341 |
|
|
343 |
|
?>
|
|
342 |
|
?>
|