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( '[path
_to]inc/he
ader.inc.p
hp' );
|
|
21 |
|
require_on
ce( '[path
_to]inc/he
ader.inc.p
hp' );
|
22 |
|
require_on
ce( BX_DIR
ECTORY_PAT
H_INC . 'd
b.inc.php'
);
|
|
22 |
|
require_on
ce( BX_DIR
ECTORY_PAT
H_INC . 'd
b.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 . 'a
dmin.inc.p
hp' );
|
|
24 |
|
require_on
ce( BX_DIR
ECTORY_PAT
H_INC . 'a
dmin.inc.p
hp' );
|
25 |
|
require_on
ce( BX_DIR
ECTORY_PAT
H_INC . 'm
odules.inc
.php' );
|
|
25 |
|
require_on
ce( BX_DIR
ECTORY_PAT
H_INC . 'm
odules.inc
.php' );
|
26 |
|
require_on
ce( BX_DIR
ECTORY_PAT
H_INC . 'm
embership_
levels.inc
.php' );
|
|
26 |
|
require_on
ce( BX_DIR
ECTORY_PAT
H_INC . 'm
embership_
levels.inc
.php' );
|
27 |
|
|
|
27 |
|
|
28 |
|
// - Funct
ions -
|
|
28 |
|
// - Funct
ions -
|
29 |
|
|
|
29 |
|
|
30 |
|
function f
inish()
|
|
30 |
|
function f
inish()
|
31 |
|
{
|
|
31 |
|
{
|
32 |
|
global
$site;
|
|
32 |
|
global
$site;
|
33 |
|
global
$MODE;
|
|
33 |
|
global
$MODE;
|
34 |
|
|
|
34 |
|
|
35 |
|
if ( $
MODE != "_
LIVE_" )
|
|
35 |
|
if ( $
MODE != "_
LIVE_" )
|
36 |
|
{
|
|
36 |
|
{
|
37 |
|
$o
utput = ob
_get_conte
nts();
|
|
37 |
|
$o
utput = ob
_get_conte
nts();
|
38 |
|
ob
_end_clean
();
|
|
38 |
|
ob
_end_clean
();
|
39 |
|
if
( $MODE =
= "_MAIL_"
)
|
|
39 |
|
if
( $MODE =
= "_MAIL_"
)
|
40 |
|
{
|
|
40 |
|
{
|
41 |
|
mail( $s
ite[email]
, "{$site[
'title']}:
Periodic
Report", $
output, "F
rom: Perio
dic <$site
[email]>",
"-f$site[
email]" );
|
|
41 |
|
mail( $s
ite[email]
, "{$site[
'title']}:
Periodic
Report", $
output, "F
rom: Perio
dic <$site
[email]>",
"-f$site[
email]" );
|
42 |
|
}
|
|
42 |
|
}
|
43 |
|
}
|
|
43 |
|
}
|
44 |
|
exit;
|
|
44 |
|
exit;
|
45 |
|
}
|
|
45 |
|
}
|
46 |
|
|
|
46 |
|
|
47 |
|
function c
lean_datab
ase()
|
|
47 |
|
function c
lean_datab
ase()
|
48 |
|
{
|
|
48 |
|
{
|
49 |
|
$db_cl
ean_vkiss
= getParam
("db_clean
_vkiss");
|
|
49 |
|
$db_cl
ean_vkiss
= getParam
("db_clean
_vkiss");
|
50 |
|
$db_cl
ean_profil
es = getPa
ram("db_cl
ean_profil
es");
|
|
50 |
|
$db_cl
ean_profil
es = getPa
ram("db_cl
ean_profil
es");
|
51 |
|
$db_cl
ean_msg =
getParam("
db_clean_m
sg");
|
|
51 |
|
$db_cl
ean_msg =
getParam("
db_clean_m
sg");
|
52 |
|
$db_cl
ean_views
= getParam
("db_clean
_views");
|
|
52 |
|
$db_cl
ean_views
= getParam
("db_clean
_views");
|
53 |
|
$db_cl
ean_priv_m
sg = getPa
ram("db_cl
ean_priv_m
sg");
|
|
53 |
|
$db_cl
ean_priv_m
sg = getPa
ram("db_cl
ean_priv_m
sg");
|
54 |
|
|
|
54 |
|
|
55 |
|
// pro
file_delet
e
|
|
55 |
|
// pro
file_delet
e
|
56 |
|
if ( $
db_clean_p
rofiles >
0)
|
|
56 |
|
if ( $
db_clean_p
rofiles >
0)
|
57 |
|
{
|
|
57 |
|
{
|
58 |
|
$res
=
db_res("SE
LECT
ID
FROM
Profiles
WHERE
(TO_DAYS(N
OW())
-
TO_DAYS(
LastLog
gedI
n))
>
$db_clean_
profiles")
;
|
|
58 |
|
$res
=
db_res("SE
LECT
ID
FROM
Profiles
WHERE
(TO_DAYS(N
OW())
-
TO_DAYS(
Date
LastLog
i
n))
>
$db_clean_
profiles")
;
|
59 |
|
if
( $res )
|
|
59 |
|
if
( $res )
|
60 |
|
{
|
|
60 |
|
{
|
61 |
|
$db_clea
n_profiles
_num = mys
ql_num_row
s($res);
|
|
61 |
|
$db_clea
n_profiles
_num = mys
ql_num_row
s($res);
|
62 |
|
while (
$arr = mys
ql_fetch_a
rray($res)
)
|
|
62 |
|
while (
$arr = mys
ql_fetch_a
rray($res)
)
|
63 |
|
{
|
|
63 |
|
{
|
64 |
|
prof
ile_delete
($arr['ID'
]);
|
|
64 |
|
prof
ile_delete
($arr['ID'
]);
|
65 |
|
}
|
|
65 |
|
}
|
66 |
|
}
|
|
66 |
|
}
|
67 |
|
}
|
|
67 |
|
}
|
68 |
|
|
|
68 |
|
|
69 |
|
|
|
69 |
|
|
70 |
|
if ( $
db_clean_v
kiss > 0 )
|
|
70 |
|
if ( $
db_clean_v
kiss > 0 )
|
71 |
|
{
|
|
71 |
|
{
|
72 |
|
$r
es = db_re
s("DELETE
FROM VKiss
es WHERE (
TO_DAYS(NO
W()) - TO_
DAYS(Arriv
ed)) > $db
_clean_vki
ss");
|
|
72 |
|
$r
es = db_re
s("DELETE
FROM VKiss
es WHERE (
TO_DAYS(NO
W()) - TO_
DAYS(Arriv
ed)) > $db
_clean_vki
ss");
|
73 |
|
if
( $res )
|
|
73 |
|
if
( $res )
|
74 |
|
$db_clea
n_vkiss_nu
m = mysql_
affected_r
ows();
|
|
74 |
|
$db_clea
n_vkiss_nu
m = mysql_
affected_r
ows();
|
75 |
|
}
|
|
75 |
|
}
|
76 |
|
|
|
76 |
|
|
77 |
|
if ( $
db_clean_m
sg > 0 )
|
|
77 |
|
if ( $
db_clean_m
sg > 0 )
|
78 |
|
{
|
|
78 |
|
{
|
79 |
|
$r
es = db_re
s("DELETE
FROM Messa
ges WHERE
(TO_DAYS(N
OW()) - TO
_DAYS(`Dat
e`)) > $db
_clean_msg
");
|
|
79 |
|
$r
es = db_re
s("DELETE
FROM Messa
ges WHERE
(TO_DAYS(N
OW()) - TO
_DAYS(`Dat
e`)) > $db
_clean_msg
");
|
80 |
|
if
( $res )
|
|
80 |
|
if
( $res )
|
81 |
|
$db_clea
n_msg_num
= mysql_af
fected_row
s();
|
|
81 |
|
$db_clea
n_msg_num
= mysql_af
fected_row
s();
|
82 |
|
}
|
|
82 |
|
}
|
83 |
|
|
|
83 |
|
|
84 |
|
if ( $
db_clean_v
iews > 0 )
|
|
84 |
|
if ( $
db_clean_v
iews > 0 )
|
85 |
|
{
|
|
85 |
|
{
|
86 |
|
$r
es = db_re
s("DELETE
FROM Profi
lesTrack W
HERE (TO_D
AYS(NOW())
-TO_DAYS(`
Arrived`))
> $db_cle
an_views")
;
|
|
86 |
|
$r
es = db_re
s("DELETE
FROM Profi
lesTrack W
HERE (TO_D
AYS(NOW())
-TO_DAYS(`
Arrived`))
> $db_cle
an_views")
;
|
87 |
|
if
( $res )
|
|
87 |
|
if
( $res )
|
88 |
|
$db_clea
n_views_nu
m = mysql_
affected_r
ows();
|
|
88 |
|
$db_clea
n_views_nu
m = mysql_
affected_r
ows();
|
89 |
|
}
|
|
89 |
|
}
|
90 |
|
|
|
90 |
|
|
91 |
|
if ( $
db_clean_p
riv_msg >
0 )
|
|
91 |
|
if ( $
db_clean_p
riv_msg >
0 )
|
92 |
|
{
|
|
92 |
|
{
|
93 |
|
$r
es = db_re
s("DELETE
FROM IMess
ages WHERE
(TO_DAYS(
NOW()) - T
O_DAYS(`Wh
en`)) > $d
b_clean_pr
iv_msg");
|
|
93 |
|
$r
es = db_re
s("DELETE
FROM IMess
ages WHERE
(TO_DAYS(
NOW()) - T
O_DAYS(`Wh
en`)) > $d
b_clean_pr
iv_msg");
|
94 |
|
if
( $res )
|
|
94 |
|
if
( $res )
|
95 |
|
$db_clea
n_priv_msg
_num = mys
ql_affecte
d_rows();
|
|
95 |
|
$db_clea
n_priv_msg
_num = mys
ql_affecte
d_rows();
|
96 |
|
}
|
|
96 |
|
}
|
97 |
|
|
|
97 |
|
|
98 |
|
|
|
98 |
|
|
99 |
|
echo "
\n- Databa
se cleanin
g -\n";
|
|
99 |
|
echo "
\n- Databa
se cleanin
g -\n";
|
100 |
|
|
|
100 |
|
|
101 |
|
echo "
Deleted pr
ofiles: $d
b_clean_pr
ofiles_num
\n";
|
|
101 |
|
echo "
Deleted pr
ofiles: $d
b_clean_pr
ofiles_num
\n";
|
102 |
|
echo "
Deleted vi
rtual kiss
es: $db_cl
ean_vkiss_
num\n";
|
|
102 |
|
echo "
Deleted vi
rtual kiss
es: $db_cl
ean_vkiss_
num\n";
|
103 |
|
echo "
Deleted me
ssages: $d
b_clean_ms
g_num\n";
|
|
103 |
|
echo "
Deleted me
ssages: $d
b_clean_ms
g_num\n";
|
104 |
|
echo "
Deleted pr
ivate mess
ages: $db_
clean_priv
_msg_num\n
";
|
|
104 |
|
echo "
Deleted pr
ivate mess
ages: $db_
clean_priv
_msg_num\n
";
|
105 |
|
echo "
Deleted pr
ofile view
s: $db_cle
an_views_n
um\n";
|
|
105 |
|
echo "
Deleted pr
ofile view
s: $db_cle
an_views_n
um\n";
|
106 |
|
}
|
|
106 |
|
}
|
107 |
|
|
|
107 |
|
|
108 |
|
function d
el_old_all
_files()
|
|
108 |
|
function d
el_old_all
_files()
|
109 |
|
{
|
|
109 |
|
{
|
110 |
|
global
$dir;
|
|
110 |
|
global
$dir;
|
111 |
|
|
|
111 |
|
|
112 |
|
$num_t
mp = 0;
|
|
112 |
|
$num_t
mp = 0;
|
113 |
|
$num_d
el = 0;
|
|
113 |
|
$num_d
el = 0;
|
114 |
|
|
|
114 |
|
|
115 |
|
$file_
life = 864
00; // on
e day
|
|
115 |
|
$file_
life = 864
00; // on
e day
|
116 |
|
$dirTo
Clean = ar
ray();
|
|
116 |
|
$dirTo
Clean = ar
ray();
|
117 |
|
$dirTo
Clean[] =
$dir['tmp'
];
|
|
117 |
|
$dirTo
Clean[] =
$dir['tmp'
];
|
118 |
|
$dirTo
Clean[] =
$dir['cach
e'];
|
|
118 |
|
$dirTo
Clean[] =
$dir['cach
e'];
|
119 |
|
|
|
119 |
|
|
120 |
|
foreac
h( $dirToC
lean as $v
alue )
|
|
120 |
|
foreac
h( $dirToC
lean as $v
alue )
|
121 |
|
{
|
|
121 |
|
{
|
122 |
|
if
( !( $lan
g_dir = op
endir( $va
lue ) ) )
|
|
122 |
|
if
( !( $lan
g_dir = op
endir( $va
lue ) ) )
|
123 |
|
{
|
|
123 |
|
{
|
124 |
|
continue
;
|
|
124 |
|
continue
;
|
125 |
|
}
|
|
125 |
|
}
|
126 |
|
el
se
|
|
126 |
|
el
se
|
127 |
|
{
|
|
127 |
|
{
|
128 |
|
while ($
lang_file
= readdir(
$lang_dir
))
|
|
128 |
|
while ($
lang_file
= readdir(
$lang_dir
))
|
129 |
|
{
|
|
129 |
|
{
|
130 |
|
$dif
f = time()
- filecti
me( $value
. $lang_f
ile);
|
|
130 |
|
$dif
f = time()
- filecti
me( $value
. $lang_f
ile);
|
131 |
|
if (
$diff > $
file_life
&& '.' !=
$lang_file
&& '..' !
= $lang_fi
le && '.ht
access' !=
= $lang_fi
le )
|
|
131 |
|
if (
$diff > $
file_life
&& '.' !=
$lang_file
&& '..' !
= $lang_fi
le && '.ht
access' !=
= $lang_fi
le )
|
132 |
|
{
|
|
132 |
|
{
|
133 |
|
@unlink ($
value . $l
ang_file);
|
|
133 |
|
@unlink ($
value . $l
ang_file);
|
134 |
|
++$num_del
;
|
|
134 |
|
++$num_del
;
|
135 |
|
}
|
|
135 |
|
}
|
136 |
|
++$n
um_tmp;
|
|
136 |
|
++$n
um_tmp;
|
137 |
|
}
|
|
137 |
|
}
|
138 |
|
closedir
( $lang_di
r );
|
|
138 |
|
closedir
( $lang_di
r );
|
139 |
|
}
|
|
139 |
|
}
|
140 |
|
}
|
|
140 |
|
}
|
141 |
|
|
|
141 |
|
|
142 |
|
echo "
\n- Tempor
ary files
check -\n"
;
|
|
142 |
|
echo "
\n- Tempor
ary files
check -\n"
;
|
143 |
|
|
|
143 |
|
|
144 |
|
echo "
Total temp
files: $n
um_tmp\n";
|
|
144 |
|
echo "
Total temp
files: $n
um_tmp\n";
|
145 |
|
echo "
Deleted te
mp files:
$num_del\n
";
|
|
145 |
|
echo "
Deleted te
mp files:
$num_del\n
";
|
146 |
|
}
|
|
146 |
|
}
|
147 |
|
|
|
147 |
|
|
148 |
|
|
|
148 |
|
|
149 |
|
|
|
149 |
|
|
150 |
|
function m
odules_pro
ceed()
|
|
150 |
|
function m
odules_pro
ceed()
|
151 |
|
{
|
|
151 |
|
{
|
152 |
|
// sel
ect all pr
ofiles and
check who
can't use
chat or f
orum
|
|
152 |
|
// sel
ect all pr
ofiles and
check who
can't use
chat or f
orum
|
153 |
|
$p_res
= db_res(
"SELECT `
ID` FROM `
Profiles`"
);
|
|
153 |
|
$p_res
= db_res(
"SELECT `
ID` FROM `
Profiles`"
);
|
154 |
|
while
( $p_arr =
mysql_fet
ch_array($
p_res) )
|
|
154 |
|
while
( $p_arr =
mysql_fet
ch_array($
p_res) )
|
155 |
|
{
|
|
155 |
|
{
|
156 |
|
$c
heck_res =
checkActi
on($p_arr[
'ID'], ACT
ION_ID_USE
_CHAT);
|
|
156 |
|
$c
heck_res =
checkActi
on($p_arr[
'ID'], ACT
ION_ID_USE
_CHAT);
|
157 |
|
if
( $check_
res[CHECK_
ACTION_RES
ULT] != CH
ECK_ACTION
_RESULT_AL
LOWED )
|
|
157 |
|
if
( $check_
res[CHECK_
ACTION_RES
ULT] != CH
ECK_ACTION
_RESULT_AL
LOWED )
|
158 |
|
{
|
|
158 |
|
{
|
159 |
|
modules_
block($p_a
rr['ID'],
'chat');
|
|
159 |
|
modules_
block($p_a
rr['ID'],
'chat');
|
160 |
|
}
|
|
160 |
|
}
|
161 |
|
el
se
|
|
161 |
|
el
se
|
162 |
|
{
|
|
162 |
|
{
|
163 |
|
modules_
unblock($p
_arr['ID']
, 'chat');
|
|
163 |
|
modules_
unblock($p
_arr['ID']
, 'chat');
|
164 |
|
}
|
|
164 |
|
}
|
165 |
|
|
|
165 |
|
|
166 |
|
$c
heck_res =
checkActi
on($p_arr[
'ID'], ACT
ION_ID_USE
_FORUM);
|
|
166 |
|
$c
heck_res =
checkActi
on($p_arr[
'ID'], ACT
ION_ID_USE
_FORUM);
|
167 |
|
if
( $check_
res[CHECK_
ACTION_RES
ULT] != CH
ECK_ACTION
_RESULT_AL
LOWED )
|
|
167 |
|
if
( $check_
res[CHECK_
ACTION_RES
ULT] != CH
ECK_ACTION
_RESULT_AL
LOWED )
|
168 |
|
{
|
|
168 |
|
{
|
169 |
|
modules_
block($p_a
rr['ID'],
'forum');
|
|
169 |
|
modules_
block($p_a
rr['ID'],
'forum');
|
170 |
|
}
|
|
170 |
|
}
|
171 |
|
el
se
|
|
171 |
|
el
se
|
172 |
|
{
|
|
172 |
|
{
|
173 |
|
modules_
unblock($p
_arr['ID']
, 'forum')
;
|
|
173 |
|
modules_
unblock($p
_arr['ID']
, 'forum')
;
|
174 |
|
}
|
|
174 |
|
}
|
175 |
|
}
|
|
175 |
|
}
|
176 |
|
|
|
176 |
|
|
177 |
|
echo "
\n- Module
s check -\
n";
|
|
177 |
|
echo "
\n- Module
s check -\
n";
|
178 |
|
echo "
Profiles p
rocessed s
uccessfull
y\n";
|
|
178 |
|
echo "
Profiles p
rocessed s
uccessfull
y\n";
|
179 |
|
}
|
|
179 |
|
}
|
180 |
|
|
|
180 |
|
|
181 |
|
// -------
------
|
|
181 |
|
// -------
------
|
182 |
|
|
|
182 |
|
|
183 |
|
// - Defau
lts -
|
|
183 |
|
// - Defau
lts -
|
184 |
|
$MODE =
"_MAIL_";
|
|
184 |
|
$MODE =
"_MAIL_";
|
185 |
|
//$MODE =
"_LIVE_";
|
|
185 |
|
//$MODE =
"_LIVE_";
|
186 |
|
$DAY =
"_OBEY_";
|
|
186 |
|
$DAY =
"_OBEY_";
|
187 |
|
//$DAY =
"_FORCE_";
|
|
187 |
|
//$DAY =
"_FORCE_";
|
188 |
|
define('NO
N_VISUAL_P
ROCESSING'
, 'YES');
|
|
188 |
|
define('NO
N_VISUAL_P
ROCESSING'
, 'YES');
|
189 |
|
|
|
189 |
|
|
190 |
|
|
|
190 |
|
|
191 |
|
// - Alway
s finish
|
|
191 |
|
// - Alway
s finish
|
192 |
|
set_time_l
imit( 3600
0 );
|
|
192 |
|
set_time_l
imit( 3600
0 );
|
193 |
|
ignore_use
r_abort();
|
|
193 |
|
ignore_use
r_abort();
|
194 |
|
|
|
194 |
|
|
195 |
|
|
|
195 |
|
|
196 |
|
|
|
196 |
|
|
197 |
|
|
|
197 |
|
|
198 |
|
// - Param
eters chec
k -
|
|
198 |
|
// - Param
eters chec
k -
|
199 |
|
for ( $i =
0; strlen
( $argv[$i
] ); $i++
)
|
|
199 |
|
for ( $i =
0; strlen
( $argv[$i
] ); $i++
)
|
200 |
|
{
|
|
200 |
|
{
|
201 |
|
switch
( $argv[$i
] )
|
|
201 |
|
switch
( $argv[$i
] )
|
202 |
|
{
|
|
202 |
|
{
|
203 |
|
ca
se "--live
": $MODE =
"_LIVE_";
break;
|
|
203 |
|
ca
se "--live
": $MODE =
"_LIVE_";
break;
|
204 |
|
ca
se "--mail
": $MODE =
"_MAIL_";
break;
|
|
204 |
|
ca
se "--mail
": $MODE =
"_MAIL_";
break;
|
205 |
|
ca
se "--forc
e-day": $D
AY = "_FOR
CE_"; brea
k;
|
|
205 |
|
ca
se "--forc
e-day": $D
AY = "_FOR
CE_"; brea
k;
|
206 |
|
ca
se "--obey
-day": $DA
Y = "_OBEY
_"; break;
|
|
206 |
|
ca
se "--obey
-day": $DA
Y = "_OBEY
_"; break;
|
207 |
|
}
|
|
207 |
|
}
|
208 |
|
}
|
|
208 |
|
}
|
209 |
|
|
|
209 |
|
|
210 |
|
|
|
210 |
|
|
211 |
|
if ( $MODE
!= "_LIVE
_" )
|
|
211 |
|
if ( $MODE
!= "_LIVE
_" )
|
212 |
|
ob_sta
rt();
|
|
212 |
|
ob_sta
rt();
|
213 |
|
|
|
213 |
|
|
214 |
|
|
|
214 |
|
|
215 |
|
$day = dat
e( "d" );
|
|
215 |
|
$day = dat
e( "d" );
|
216 |
|
if ( getPa
ram( "cmdD
ay" ) == $
day && $DA
Y == "_OBE
Y_" )
|
|
216 |
|
if ( getPa
ram( "cmdD
ay" ) == $
day && $DA
Y == "_OBE
Y_" )
|
217 |
|
{
|
|
217 |
|
{
|
218 |
|
echo "
Already do
ne today,
bailing ou
t\n";
|
|
218 |
|
echo "
Already do
ne today,
bailing ou
t\n";
|
219 |
|
finish
();
|
|
219 |
|
finish
();
|
220 |
|
}
|
|
220 |
|
}
|
221 |
|
else
|
|
221 |
|
else
|
222 |
|
setPar
am( "cmdDa
y", $day )
;
|
|
222 |
|
setPar
am( "cmdDa
y", $day )
;
|
223 |
|
|
|
223 |
|
|
224 |
|
|
|
224 |
|
|
225 |
|
//========
==========
==========
==========
==========
==========
==========
==========
==========
==========
==========
==========
==
|
|
225 |
|
//========
==========
==========
==========
==========
==========
==========
==========
==========
==========
==========
==========
==
|
226 |
|
|
|
226 |
|
|
227 |
|
// - Membe
rship chec
k -
|
|
227 |
|
// - Membe
rship chec
k -
|
228 |
|
echo "\n-
Membership
expiratio
n letters
-\n";
|
|
228 |
|
echo "\n-
Membership
expiratio
n letters
-\n";
|
229 |
|
|
|
229 |
|
|
230 |
|
$expire_no
tification
_days = ge
tParam("ex
pire_notif
ication_da
ys");
|
|
230 |
|
$expire_no
tification
_days = ge
tParam("ex
pire_notif
ication_da
ys");
|
231 |
|
$expire_no
tify_once
= getParam
("expire_n
otify_once
");
|
|
231 |
|
$expire_no
tify_once
= getParam
("expire_n
otify_once
");
|
232 |
|
|
|
232 |
|
|
233 |
|
$expire_le
tters = 0;
|
|
233 |
|
$expire_le
tters = 0;
|
234 |
|
|
|
234 |
|
|
235 |
|
$exp_res =
db_res( "
SELECT `ID
` FROM `Pr
ofiles`",
0 );
|
|
235 |
|
$exp_res =
db_res( "
SELECT `ID
` FROM `Pr
ofiles`",
0 );
|
236 |
|
|
|
236 |
|
|
237 |
|
while( $ro
w = mysql_
fetch_arra
y( $exp_re
s ) )
|
|
237 |
|
while( $ro
w = mysql_
fetch_arra
y( $exp_re
s ) )
|
238 |
|
{
|
|
238 |
|
{
|
239 |
|
$curre
nt_members
hip_arr =
getMemberM
embershipI
nfo( $row[
'ID'] );
|
|
239 |
|
$curre
nt_members
hip_arr =
getMemberM
embershipI
nfo( $row[
'ID'] );
|
240 |
|
// If
expire_not
ification_
days is -1
then noti
fy after e
xpiration
|
|
240 |
|
// If
expire_not
ification_
days is -1
then noti
fy after e
xpiration
|
241 |
|
if ( $
current_me
mbership_a
rr['ID'] =
= MEMBERSH
IP_ID_STAN
DARD && $e
xpire_noti
fication_d
ays == -1
)
|
|
241 |
|
if ( $
current_me
mbership_a
rr['ID'] =
= MEMBERSH
IP_ID_STAN
DARD && $e
xpire_noti
fication_d
ays == -1
)
|
242 |
|
{
|
|
242 |
|
{
|
243 |
|
//
Calculate
last UNIX
Timestamp
|
|
243 |
|
//
Calculate
last UNIX
Timestamp
|
244 |
|
$l
ast_timest
amp = time
() - 24 *
3600;
|
|
244 |
|
$l
ast_timest
amp = time
() - 24 *
3600;
|
245 |
|
$l
ast_member
ship_arr =
getMember
Membership
Info( $row
['ID'], $l
ast_timest
amp );
|
|
245 |
|
$l
ast_member
ship_arr =
getMember
Membership
Info( $row
['ID'], $l
ast_timest
amp );
|
246 |
|
if
( $curren
t_membersh
ip_arr['ID
'] != $las
t_membersh
ip_arr['ID
'] )
|
|
246 |
|
if
( $curren
t_membersh
ip_arr['ID
'] != $las
t_membersh
ip_arr['ID
'] )
|
247 |
|
{
|
|
247 |
|
{
|
248 |
|
modules_
update($ro
w['ID']);
// Handle
membership
level cha
nge
|
|
248 |
|
modules_
update($ro
w['ID']);
// Handle
membership
level cha
nge
|
249 |
|
if ($fur
ther_membe
rship_arr[
'ID'] == M
EMBERSHIP_
ID_STANDAR
D)
|
|
249 |
|
if ($fur
ther_membe
rship_arr[
'ID'] == M
EMBERSHIP_
ID_STANDAR
D)
|
250 |
|
{
|
|
250 |
|
{
|
251 |
|
$mai
l_ret = me
m_expirati
on_letter(
$row['ID']
, $last_me
mbership_a
rr['Name']
, -1);
|
|
251 |
|
$mai
l_ret = me
m_expirati
on_letter(
$row['ID']
, $last_me
mbership_a
rr['Name']
, -1);
|
252 |
|
if (
$mail_ret
)
|
|
252 |
|
if (
$mail_ret
)
|
253 |
|
$expire_le
tters++;
|
|
253 |
|
$expire_le
tters++;
|
254 |
|
}
|
|
254 |
|
}
|
255 |
|
}
|
|
255 |
|
}
|
256 |
|
}
|
|
256 |
|
}
|
257 |
|
// If
memberhip
is not sta
ndard then
check if
it will ch
ange
|
|
257 |
|
// If
memberhip
is not sta
ndard then
check if
it will ch
ange
|
258 |
|
elseif
( $curren
t_membersh
ip_arr['ID
'] != MEMB
ERSHIP_ID_
STANDARD )
|
|
258 |
|
elseif
( $curren
t_membersh
ip_arr['ID
'] != MEMB
ERSHIP_ID_
STANDARD )
|
259 |
|
{
|
|
259 |
|
{
|
260 |
|
//
Calculate
further U
NIX Timest
amp
|
|
260 |
|
//
Calculate
further U
NIX Timest
amp
|
261 |
|
$f
urther_tim
estamp = t
ime() + $e
xpire_noti
fication_d
ays * 24 *
3600;
|
|
261 |
|
$f
urther_tim
estamp = t
ime() + $e
xpire_noti
fication_d
ays * 24 *
3600;
|
262 |
|
$f
urther_mem
bership_ar
r = getMem
berMembers
hipInfo( $
row['ID'],
$further_
timestamp
);
|
|
262 |
|
$f
urther_mem
bership_ar
r = getMem
berMembers
hipInfo( $
row['ID'],
$further_
timestamp
);
|
263 |
|
if
( $curren
t_membersh
ip_arr['ID
'] != $fur
ther_membe
rship_arr[
'ID']
|
|
263 |
|
if
( $curren
t_membersh
ip_arr['ID
'] != $fur
ther_membe
rship_arr[
'ID']
|
264 |
|
&& $furt
her_member
ship_arr['
ID'] == ME
MBERSHIP_I
D_STANDARD
)
|
|
264 |
|
&& $furt
her_member
ship_arr['
ID'] == ME
MBERSHIP_I
D_STANDARD
)
|
265 |
|
{
|
|
265 |
|
{
|
266 |
|
if ( !$e
xpire_noti
fy_once ||
abs($furt
her_timest
amp - time
()) < 24 *
3600 )
|
|
266 |
|
if ( !$e
xpire_noti
fy_once ||
abs($furt
her_timest
amp - time
()) < 24 *
3600 )
|
267 |
|
{
|
|
267 |
|
{
|
268 |
|
$mai
l_ret = me
m_expirati
on_letter(
$row['ID'
], $curren
t_membersh
ip_arr['Na
me'],
|
|
268 |
|
$mai
l_ret = me
m_expirati
on_letter(
$row['ID'
], $curren
t_membersh
ip_arr['Na
me'],
|
269 |
|
(int)( ($c
urrent_mem
bership_ar
r['DateExp
ires'] - t
ime()) / (
24 * 3600)
) );
|
|
269 |
|
(int)( ($c
urrent_mem
bership_ar
r['DateExp
ires'] - t
ime()) / (
24 * 3600)
) );
|
270 |
|
if (
$mail_ret
)
|
|
270 |
|
if (
$mail_ret
)
|
271 |
|
$expire_le
tters++;
|
|
271 |
|
$expire_le
tters++;
|
272 |
|
}
|
|
272 |
|
}
|
273 |
|
}
|
|
273 |
|
}
|
274 |
|
}
|
|
274 |
|
}
|
275 |
|
}
|
|
275 |
|
}
|
276 |
|
|
|
276 |
|
|
277 |
|
echo "Send
membershi
p expire l
etters: $e
xpire_lett
ers letter
s\n";
|
|
277 |
|
echo "Send
membershi
p expire l
etters: $e
xpire_lett
ers letter
s\n";
|
278 |
|
|
|
278 |
|
|
279 |
|
|
|
279 |
|
|
280 |
|
//========
==========
==========
==========
==========
==========
==========
==========
==========
==========
==========
==========
==
|
|
280 |
|
//========
==========
==========
==========
==========
==========
==========
==========
==========
==========
==========
==========
==
|
281 |
|
|
|
281 |
|
|
282 |
|
// clear t
mp folder
----------
----------
----------
----------
----------
----------
----------
----
|
|
282 |
|
// clear t
mp folder
----------
----------
----------
----------
----------
----------
----------
----
|
283 |
|
|
|
283 |
|
|
284 |
|
del_old_al
l_files();
|
|
284 |
|
del_old_al
l_files();
|
285 |
|
|
|
285 |
|
|
286 |
|
// -------
----------
----------
----------
----------
----------
----------
----------
-----
|
|
286 |
|
// -------
----------
----------
----------
----------
----------
----------
----------
-----
|
287 |
|
|
|
287 |
|
|
288 |
|
clean_data
base();
|
|
288 |
|
clean_data
base();
|
289 |
|
|
|
289 |
|
|
290 |
|
modules_pr
oceed();
|
|
290 |
|
modules_pr
oceed();
|
291 |
|
|
|
291 |
|
|
292 |
|
finish();
|
|
292 |
|
finish();
|
293 |
|
|
|
293 |
|
|
294 |
|
?>
|
|
294 |
|
?>
|