No regular expressions were active.
1 |
|
<?php
|
|
1 |
|
<?php
|
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/he
ader.inc.p
hp');
|
|
21 |
|
require_on
ce('inc/he
ader.inc.p
hp');
|
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 . 'a
dmin.inc.p
hp' );
|
|
23 |
|
require_on
ce( BX_DIR
ECTORY_PAT
H_INC . 'a
dmin.inc.p
hp' );
|
24 |
|
require_on
ce( BX_DIR
ECTORY_PAT
H_INC . 'i
mages.inc.
php' );
|
|
24 |
|
require_on
ce( BX_DIR
ECTORY_PAT
H_INC . 'i
mages.inc.
php' );
|
25 |
|
require_on
ce( BX_DIR
ECTORY_PAT
H_INC . 't
ags.inc.ph
p' );
|
|
25 |
|
require_on
ce( BX_DIR
ECTORY_PAT
H_INC . 't
ags.inc.ph
p' );
|
26 |
|
|
|
26 |
|
|
27 |
|
|
|
27 |
|
|
28 |
|
$_page['na
me_index']
= 82;
|
|
28 |
|
$_page['na
me_index']
= 82;
|
29 |
|
$_page['cs
s_name']
= 'vie
wPhoto.css
';
|
|
29 |
|
$_page['cs
s_name']
= 'vie
wPhoto.css
';
|
30 |
|
|
|
30 |
|
|
31 |
|
$_page['ex
tra_js'] =
'';
|
|
31 |
|
$_page['ex
tra_js'] =
'';
|
32 |
|
|
|
32 |
|
|
33 |
|
check_logg
ed();
|
|
33 |
|
check_logg
ed();
|
34 |
|
|
|
34 |
|
|
35 |
|
$_page['he
ader'] = _
t( "_uploa
d Photo" )
;
|
|
35 |
|
$_page['he
ader'] = _
t( "_uploa
d Photo" )
;
|
36 |
|
$_page['he
ader_text'
] = _t("_u
pload Phot
o");
|
|
36 |
|
$_page['he
ader_text'
] = _t("_u
pload Phot
o");
|
37 |
|
|
|
37 |
|
|
38 |
|
$_ni = $_p
age['name_
index'];
|
|
38 |
|
$_ni = $_p
age['name_
index'];
|
39 |
|
|
|
39 |
|
|
40 |
|
$member['I
D'] = (int
)$_COOKIE[
'memberID'
];
|
|
40 |
|
$member['I
D'] = (int
)$_COOKIE[
'memberID'
];
|
41 |
|
$check_res
= checkAc
tion( $mem
ber['ID'],
ACTION_ID
_UPLOAD_GA
LLERY_PHOT
O );
|
|
41 |
|
$check_res
= checkAc
tion( $mem
ber['ID'],
ACTION_ID
_UPLOAD_GA
LLERY_PHOT
O );
|
42 |
|
if ( $chec
k_res[CHEC
K_ACTION_R
ESULT] !=
CHECK_ACTI
ON_RESULT_
ALLOWED &&
!$logged[
'admin'] &
& !$logged
['moderato
r'] )
|
|
42 |
|
if ( $chec
k_res[CHEC
K_ACTION_R
ESULT] !=
CHECK_ACTI
ON_RESULT_
ALLOWED &&
!$logged[
'admin'] &
& !$logged
['moderato
r'] )
|
43 |
|
{
|
|
43 |
|
{
|
44 |
|
$ret
= "
|
|
44 |
|
$ret
= "
|
45 |
|
<t
able width
=100% heig
ht=100% ce
llpadding=
0 cellspac
ing=0 clas
s=text2>
|
|
45 |
|
<t
able width
=100% heig
ht=100% ce
llpadding=
0 cellspac
ing=0 clas
s=text2>
|
46 |
|
<td alig
n=center b
gcolor=$bo
xbg2>
|
|
46 |
|
<td alig
n=center b
gcolor=$bo
xbg2>
|
47 |
|
". $
check_res[
CHECK_ACTI
ON_MESSAGE
] ."<br />
|
|
47 |
|
". $
check_res[
CHECK_ACTI
ON_MESSAGE
] ."<br />
|
48 |
|
</td>
|
|
48 |
|
</td>
|
49 |
|
</
table>\n";
|
|
49 |
|
</
table>\n";
|
50 |
|
|
|
50 |
|
|
51 |
|
$_page
['name_ind
ex'] = 0;
|
|
51 |
|
$_page
['name_ind
ex'] = 0;
|
52 |
|
$_page
_cont[0]['
page_main_
code'] = $
ret;
|
|
52 |
|
$_page
_cont[0]['
page_main_
code'] = $
ret;
|
53 |
|
PageCo
de();
|
|
53 |
|
PageCo
de();
|
54 |
|
exit()
;
|
|
54 |
|
exit()
;
|
55 |
|
}
|
|
55 |
|
}
|
56 |
|
|
|
56 |
|
|
57 |
|
$iPhotoCou
nt = (int)
db_value("
SELECT COU
NT(*) FROM
`sharePho
toFiles` W
HERE `medP
rofId`='{$
member['ID
']}'");
|
|
57 |
|
$iPhotoCou
nt = (int)
db_value("
SELECT COU
NT(*) FROM
`sharePho
toFiles` W
HERE `medP
rofId`='{$
member['ID
']}'");
|
58 |
|
if ($iPhot
oCount < (
int)getPar
am("shPhot
oLimit"))
{
|
|
58 |
|
if ($iPhot
oCount < (
int)getPar
am("shPhot
oLimit"))
{
|
59 |
|
$sStat
us = '';
|
|
59 |
|
$sStat
us = '';
|
60 |
|
if (is
set($_POST
['upload']
) && isset
($_POST['m
edProfId']
)) {
|
|
60 |
|
if (is
set($_POST
['upload']
) && isset
($_POST['m
edProfId']
)) {
|
61 |
|
$s
Status = '
<div>'._t(
"_File was
uploaded"
).'</div>'
;
|
|
61 |
|
$s
Status = '
<div>'._t(
"_File was
uploaded"
).'</div>'
;
|
62 |
|
$i
User = (in
t)$_POST['
medProfId'
];
|
|
62 |
|
$i
User = (in
t)$_POST['
medProfId'
];
|
63 |
|
$s
File = htm
lspecialch
ars_adv($_
POST['titl
e']);
|
|
63 |
|
$s
File = htm
lspecialch
ars_adv($_
POST['titl
e']);
|
64 |
|
$s
Desc = iss
et($_POST[
'descripti
on']) && s
trlen($_PO
ST['descri
ption']) ?
process_d
b_input(ht
mlspecialc
hars_adv($
_POST['des
cription']
)) : '';
|
|
64 |
|
$s
Desc = iss
et($_POST[
'descripti
on']) && s
trlen($_PO
ST['descri
ption']) ?
process_d
b_input(ht
mlspecialc
hars_adv($
_POST['des
cription']
)) : '';
|
65 |
|
$s
Tags = iss
et($_POST[
'tags']) &
& strlen($
_POST['tag
s']) ? pro
cess_db_in
put(htmlsp
ecialchars
_adv($_POS
T['tags'])
) : '';
|
|
65 |
|
$s
Tags = iss
et($_POST[
'tags']) &
& strlen($
_POST['tag
s']) ? pro
cess_db_in
put(htmlsp
ecialchars
_adv($_POS
T['tags'])
) : '';
|
66 |
|
$s
Status = u
ploadFile(
$sFile, $s
Desc, $sTa
gs, $iUser
);
|
|
66 |
|
$s
Status = u
ploadFile(
$sFile, $s
Desc, $sTa
gs, $iUser
);
|
67 |
|
}
|
|
67 |
|
}
|
68 |
|
}
|
|
68 |
|
}
|
69 |
|
else {
|
|
69 |
|
else {
|
70 |
|
$sCode
= MsgBox(
_t( '_Pho
to gallery
limit was
reached'
) );
|
|
70 |
|
$sCode
= MsgBox(
_t( '_Pho
to gallery
limit was
reached'
) );
|
71 |
|
$_page
['name_ind
ex'] = 0;
|
|
71 |
|
$_page
['name_ind
ex'] = 0;
|
72 |
|
$_page
_cont[0]['
page_main_
code'] = $
sCode;
|
|
72 |
|
$_page
_cont[0]['
page_main_
code'] = $
sCode;
|
73 |
|
PageCo
de();
|
|
73 |
|
PageCo
de();
|
74 |
|
exit()
;
|
|
74 |
|
exit()
;
|
75 |
|
}
|
|
75 |
|
}
|
76 |
|
|
|
76 |
|
|
77 |
|
$_page_con
t[$_ni]['p
age_main_c
ode'] = $s
Status.Pag
eMainCode(
$site['url
'], $membe
r['ID']);
|
|
77 |
|
$_page_con
t[$_ni]['p
age_main_c
ode'] = $s
Status.Pag
eMainCode(
$site['url
'], $membe
r['ID']);
|
78 |
|
|
|
78 |
|
|
79 |
|
PageCode()
;
|
|
79 |
|
PageCode()
;
|
80 |
|
|
|
80 |
|
|
81 |
|
function P
ageMainCod
e($sSiteUr
l, $iUser
= 0) {
|
|
81 |
|
function P
ageMainCod
e($sSiteUr
l, $iUser
= 0) {
|
82 |
|
if ($i
User == 0)
|
|
82 |
|
if ($i
User == 0)
|
83 |
|
re
turn '<scr
ipt langua
ge="javasc
ript">wind
ow.locatio
n.href =\'
'.$sSiteUr
l.'member.
php\';</sc
ript>';
|
|
83 |
|
re
turn '<scr
ipt langua
ge="javasc
ript">wind
ow.locatio
n.href =\'
'.$sSiteUr
l.'member.
php\';</sc
ript>';
|
84 |
|
ob_sta
rt();
|
|
84 |
|
ob_sta
rt();
|
85 |
|
?>
|
|
85 |
|
?>
|
86 |
|
<div i
d="agreeme
nt" style=
"text-alig
n: center;
">
|
|
86 |
|
<div i
d="agreeme
nt" style=
"text-alig
n: center;
">
|
87 |
|
<div s
tyle="font
-weight: b
old;"><?=_
t("_Media
upload Agr
eement",_t
("_Photo")
)?></div>
|
|
87 |
|
<div s
tyle="font
-weight: b
old;"><?=_
t("_Media
upload Agr
eement",_t
("_Photo")
)?></div>
|
88 |
|
<div>
|
|
88 |
|
<div>
|
89 |
|
<t
extarea ro
ws="20" co
ls="80" re
adonly="tr
ue"><?=_t(
"_License
Agreement"
, $sSiteUr
l)?></text
area>
|
|
89 |
|
<t
extarea ro
ws="20" co
ls="80" re
adonly="tr
ue"><?=_t(
"_License
Agreement"
, $sSiteUr
l)?></text
area>
|
90 |
|
</div>
|
|
90 |
|
</div>
|
91 |
|
<div>
|
|
91 |
|
<div>
|
92 |
|
<i
nput type=
"submit" i
d="agree"
value="<?=
_t("_I agr
ee")?>" on
click="doc
ument.getE
lementById
('uploadSh
areMain').
style.disp
lay = 'blo
ck';
|
|
92 |
|
<i
nput type=
"submit" i
d="agree"
value="<?=
_t("_I agr
ee")?>" on
click="doc
ument.getE
lementById
('uploadSh
areMain').
style.disp
lay = 'blo
ck';
|
93 |
|
docume
nt.getElem
entById('a
greement')
.style.dis
play = 'no
ne';"">
|
|
93 |
|
docume
nt.getElem
entById('a
greement')
.style.dis
play = 'no
ne';"">
|
94 |
|
</div>
|
|
94 |
|
</div>
|
95 |
|
</div>
|
|
95 |
|
</div>
|
96 |
|
<div i
d="uploadS
hareMain"
style="dis
play: none
;">
|
|
96 |
|
<div i
d="uploadS
hareMain"
style="dis
play: none
;">
|
97 |
|
<f
orm enctyp
e="multipa
rt/form-da
ta" method
="post" ac
tion="<?=$
_SERVER['P
HP_SELF']?
>">
|
|
97 |
|
<f
orm enctyp
e="multipa
rt/form-da
ta" method
="post" ac
tion="<?=$
_SERVER['P
HP_SELF']?
>">
|
98 |
|
|
|
98 |
|
|
99 |
|
<d
iv class="
uploadLine
">
|
|
99 |
|
<d
iv class="
uploadLine
">
|
100 |
|
<div cla
ss="upload
Text"><?=_
t("_Title"
)?>: </div
>
|
|
100 |
|
<div cla
ss="upload
Text"><?=_
t("_Title"
)?>: </div
>
|
101 |
|
<div><in
put type="
text" name
="title" c
lass="uplo
adForm"/><
/div>
|
|
101 |
|
<div><in
put type="
text" name
="title" c
lass="uplo
adForm"/><
/div>
|
102 |
|
</
div>
|
|
102 |
|
</
div>
|
103 |
|
<d
iv class="
uploadLine
">
|
|
103 |
|
<d
iv class="
uploadLine
">
|
104 |
|
<div cla
ss="upload
Text"><?=_
t("_Descri
ption")?>:
</div>
|
|
104 |
|
<div cla
ss="upload
Text"><?=_
t("_Descri
ption")?>:
</div>
|
105 |
|
<div><te
xtarea nam
e="descrip
tion" clas
s="uploadF
orm"/></te
xtarea></d
iv>
|
|
105 |
|
<div><te
xtarea nam
e="descrip
tion" clas
s="uploadF
orm"/></te
xtarea></d
iv>
|
106 |
|
</
div>
|
|
106 |
|
</
div>
|
107 |
|
<d
iv class="
uploadLine
">
|
|
107 |
|
<d
iv class="
uploadLine
">
|
108 |
|
<div cla
ss="upload
Text"><?=_
t("_Tags")
?>: </div>
|
|
108 |
|
<div cla
ss="upload
Text"><?=_
t("_Tags")
?>: </div>
|
109 |
|
<div><in
put type="
text" name
="tags" cl
ass="uploa
dForm"/></
div>
|
|
109 |
|
<div><in
put type="
text" name
="tags" cl
ass="uploa
dForm"/></
div>
|
110 |
|
</
div>
|
|
110 |
|
</
div>
|
111 |
|
<d
iv class="
uploadLine
">
|
|
111 |
|
<d
iv class="
uploadLine
">
|
112 |
|
<div cla
ss="upload
Text"><?=_
t("_Select
")?>: </di
v>
|
|
112 |
|
<div cla
ss="upload
Text"><?=_
t("_Select
")?>: </di
v>
|
113 |
|
<div><in
put type="
file" name
="uploadFi
le" size="
43"/></div
>
|
|
113 |
|
<div><in
put type="
file" name
="uploadFi
le" size="
43"/></div
>
|
114 |
|
</
div>
|
|
114 |
|
</
div>
|
115 |
|
<i
nput type=
"hidden" n
ame="medPr
ofId" valu
e="<?=$iUs
er?>"/>
|
|
115 |
|
<i
nput type=
"hidden" n
ame="medPr
ofId" valu
e="<?=$iUs
er?>"/>
|
116 |
|
<d
iv class="
uploadLine
">
|
|
116 |
|
<d
iv class="
uploadLine
">
|
117 |
|
<div cla
ss="upload
Button">
|
|
117 |
|
<div cla
ss="upload
Button">
|
118 |
|
<inp
ut type="s
ubmit" nam
e="upload"
value="<?
=_t("_Uplo
ad File")?
>"/>
|
|
118 |
|
<inp
ut type="s
ubmit" nam
e="upload"
value="<?
=_t("_Uplo
ad File")?
>"/>
|
119 |
|
</div>
|
|
119 |
|
</div>
|
120 |
|
</
div>
|
|
120 |
|
</
div>
|
121 |
|
</
form>
|
|
121 |
|
</
form>
|
122 |
|
</div>
|
|
122 |
|
</div>
|
123 |
|
<?
|
|
123 |
|
<?
|
124 |
|
$sCode
= ob_get_
clean();
|
|
124 |
|
$sCode
= ob_get_
clean();
|
125 |
|
|
|
125 |
|
|
126 |
|
return
$sCode;
|
|
126 |
|
return
$sCode;
|
127 |
|
|
|
127 |
|
|
128 |
|
}
|
|
128 |
|
}
|
129 |
|
|
|
129 |
|
|
130 |
|
function u
ploadFile(
$sFile, $s
Desc, $sTa
gs, $iUser
)
|
|
130 |
|
function u
ploadFile(
$sFile, $s
Desc, $sTa
gs, $iUser
)
|
131 |
|
{
|
|
131 |
|
{
|
132 |
|
global
$dir;
|
|
132 |
|
global
$dir;
|
133 |
|
|
|
133 |
|
|
134 |
|
if( $_
FILES['upl
oadFile'][
'error'] !
= 0 )
|
|
134 |
|
if( $_
FILES['upl
oadFile'][
'error'] !
= 0 )
|
135 |
|
$sCode =
'<div cla
ss="upload
Status">'.
_t("_File
upload err
or").'</di
v>';
|
|
135 |
|
$sCode =
'<div cla
ss="upload
Status">'.
_t("_File
upload err
or").'</di
v>';
|
136 |
|
else {
|
|
136 |
|
else {
|
137 |
|
$aFileIn
fo = getim
agesize( $
_FILES['up
loadFile']
['tmp_name
'] );
|
|
137 |
|
$aFileIn
fo = getim
agesize( $
_FILES['up
loadFile']
['tmp_name
'] );
|
138 |
|
if (!$aF
ileInfo)
|
|
138 |
|
if (!$aF
ileInfo)
|
139 |
|
$sCo
de = '<div
class="up
loadStatus
">'._t("_Y
ou uploade
d not imag
e file").'
</div>';
|
|
139 |
|
$sCo
de = '<div
class="up
loadStatus
">'._t("_Y
ou uploade
d not imag
e file").'
</div>';
|
140 |
|
else {
|
|
140 |
|
else {
|
141 |
|
$ext
= false;
|
|
141 |
|
$ext
= false;
|
142 |
|
swit
ch( $aFile
Info['mime
'] ) {
|
|
142 |
|
swit
ch( $aFile
Info['mime
'] ) {
|
143 |
|
case 'imag
e/jpeg': $
ext = 'jpg
'; break;
|
|
143 |
|
case 'imag
e/jpeg': $
ext = 'jpg
'; break;
|
144 |
|
case 'imag
e/gif': $
ext = 'gif
'; break;
|
|
144 |
|
case 'imag
e/gif': $
ext = 'gif
'; break;
|
145 |
|
case 'imag
e/png': $
ext = 'png
'; break;
|
|
145 |
|
case 'imag
e/png': $
ext = 'png
'; break;
|
146 |
|
default:
$
ext = fals
e;
|
|
146 |
|
default:
$
ext = fals
e;
|
147 |
|
}
|
|
147 |
|
}
|
148 |
|
|
|
148 |
|
|
149 |
|
if (
!$ext)
|
|
149 |
|
if (
!$ext)
|
150 |
|
$sCode = '
<div class
="uploadSt
atus">'._t
("_You upl
oaded not
JPEG, GIF
or PNG fil
e").'</div
>';
|
|
150 |
|
$sCode = '
<div class
="uploadSt
atus">'._t
("_You upl
oaded not
JPEG, GIF
or PNG fil
e").'</div
>';
|
151 |
|
else
{
|
|
151 |
|
else
{
|
152 |
|
$sCode = '
<div class
="uploadSt
atus">'._t
("_Upload
successful
").'</div>
';
|
|
152 |
|
$sCode = '
<div class
="uploadSt
atus">'._t
("_Upload
successful
").'</div>
';
|
153 |
|
|
|
153 |
|
|
154 |
|
$sActive =
getParam(
"enable_sh
PhotoActiv
ation") ==
'on' ? 't
rue' : 'fa
lse' ;
|
|
154 |
|
$sActive =
getParam(
"enable_sh
PhotoActiv
ation") ==
'on' ? 't
rue' : 'fa
lse' ;
|
155 |
|
$sPhotoUri
= uriGene
rate($sFil
e, 'shareP
hotoFiles'
, 'medUri'
);
|
|
155 |
|
$sPhotoUri
= uriGene
rate($sFil
e, 'shareP
hotoFiles'
, 'medUri'
);
|
156 |
|
$sQuery =
"INSERT IN
TO `shareP
hotoFiles`
(`medProf
Id`,`medTi
tle`,`medU
ri`,`medEx
t`,`medDes
c`,`medTag
s`,`medDat
e`,`Approv
ed`) VALUE
S('$iUser'
,'$sFile',
'$sPhotoUr
i','$ext',
'$sDesc','
$sTags',".
time().",'
$sActive')
";
|
|
156 |
|
$sQuery =
"INSERT IN
TO `shareP
hotoFiles`
(`medProf
Id`,`medTi
tle`,`medU
ri`,`medEx
t`,`medDes
c`,`medTag
s`,`medDat
e`,`Approv
ed`) VALUE
S('$iUser'
,'$sFile',
'$sPhotoUr
i','$ext',
'$sDesc','
$sTags',".
time().",'
$sActive')
";
|
157 |
|
db_res($sQ
uery);
|
|
157 |
|
db_res($sQ
uery);
|
158 |
|
$iNew = my
sql_insert
_id();
|
|
158 |
|
$iNew = my
sql_insert
_id();
|
159 |
|
reparseObj
Tags( 'pho
to', $iNew
);
|
|
159 |
|
reparseObj
Tags( 'pho
to', $iNew
);
|
160 |
|
|
|
160 |
|
|
161 |
|
$sNewFileN
ame = $dir
['sharingI
mages'] .
$iNew.'.'.
$ext;
|
|
161 |
|
$sNewFileN
ame = $dir
['sharingI
mages'] .
$iNew.'.'.
$ext;
|
162 |
|
$sNewMainN
ame = $dir
['sharingI
mages'] .
$iNew.'_m.
'.$ext;
|
|
162 |
|
$sNewMainN
ame = $dir
['sharingI
mages'] .
$iNew.'_m.
'.$ext;
|
163 |
|
$sNewThumb
Name = $di
r['sharing
Images'] .
$iNew.'_t
.'.$ext;
|
|
163 |
|
$sNewThumb
Name = $di
r['sharing
Images'] .
$iNew.'_t
.'.$ext;
|
164 |
|
|
|
164 |
|
|
165 |
|
$iUpload =
(int)preg
_replace('
/\D/', '',
ini_get('
upload_max
_filesize'
));
|
|
165 |
|
$iUpload =
(int)preg
_replace('
/\D/', '',
ini_get('
upload_max
_filesize'
));
|
166 |
|
$iPost =
(int)preg
_replace('
/\D/', '',
ini_get('
post_max_s
ize'));
|
|
166 |
|
$iPost =
(int)preg
_replace('
/\D/', '',
ini_get('
post_max_s
ize'));
|
167 |
|
|
|
167 |
|
|
168 |
|
$iMin = $i
Upload > $
iPost ? $i
Post : $iU
pload;
|
|
168 |
|
$iMin = $i
Upload > $
iPost ? $i
Post : $iU
pload;
|
169 |
|
if ($_FILE
S['uploadF
ile']['siz
e'] && $_F
ILES['uplo
adFile']['
size'] > $
iMin*1024*
1024)
|
|
169 |
|
if ($_FILE
S['uploadF
ile']['siz
e'] && $_F
ILES['uplo
adFile']['
size'] > $
iMin*1024*
1024)
|
170 |
|
$sCode
= '<div c
lass="uplo
adStatus">
'._t("_SIZ
E_TOO_BIG"
).'</div>'
;
|
|
170 |
|
$sCode
= '<div c
lass="uplo
adStatus">
'._t("_SIZ
E_TOO_BIG"
).'</div>'
;
|
171 |
|
else {
|
|
171 |
|
else {
|
172 |
|
if (!m
ove_upload
ed_file( $
_FILES['up
loadFile']
['tmp_name
'], $sNewF
ileName))
|
|
172 |
|
if (!m
ove_upload
ed_file( $
_FILES['up
loadFile']
['tmp_name
'], $sNewF
ileName))
|
173 |
|
$s
Code = '<d
iv class="
uploadStat
us">'._t("
_Couldn\'t
move file
").'</div>
';
|
|
173 |
|
$s
Code = '<d
iv class="
uploadStat
us">'._t("
_Couldn\'t
move file
").'</div>
';
|
174 |
|
else {
|
|
174 |
|
else {
|
175 |
|
chmod( $
sNewFileNa
me, 0644 )
;
|
|
175 |
|
chmod( $
sNewFileNa
me, 0644 )
;
|
176 |
|
$iWidth
= (int)ge
tParam("ma
x_photo_wi
dth");
|
|
176 |
|
$iWidth
= (int)ge
tParam("ma
x_photo_wi
dth");
|
177 |
|
$iHeight
= (int)ge
tParam("ma
x_photo_he
ight");
|
|
177 |
|
$iHeight
= (int)ge
tParam("ma
x_photo_he
ight");
|
178 |
|
|
|
178 |
|
|
179 |
|
$iThumbW
= (int)ge
tParam("ma
x_thumb_wi
dth");
|
|
179 |
|
$iThumbW
= (int)ge
tParam("ma
x_thumb_wi
dth");
|
180 |
|
$iThumbH
= (int)ge
tParam("ma
x_thumb_he
ight");
|
|
180 |
|
$iThumbH
= (int)ge
tParam("ma
x_thumb_he
ight");
|
181 |
|
|
|
181 |
|
|
182 |
|
if (imag
eResize( $
sNewFileNa
me, $sNewM
ainName, $
iWidth, $i
Height ) !
= IMAGE_ER
ROR_SUCCES
S)
|
|
182 |
|
if (imag
eResize( $
sNewFileNa
me, $sNewM
ainName, $
iWidth, $i
Height ) !
= IMAGE_ER
ROR_SUCCES
S)
|
183 |
|
$sCo
de = '<div
class="up
loadStatus
">'._t("_U
pload fail
ed").'</di
v>';
|
|
183 |
|
$sCo
de = '<div
class="up
loadStatus
">'._t("_U
pload fail
ed").'</di
v>';
|
184 |
|
else {
|
|
184 |
|
else {
|
185 |
|
imag
eResize( $
sNewMainNa
me, $sNewT
humbName,
$iThumbW,
$iThumbH )
;
|
|
185 |
|
imag
eResize( $
sNewMainNa
me, $sNewT
humbName,
$iThumbW,
$iThumbH )
;
|
186 |
|
$bPe
rmalink =
getParam('
permalinks
_gallery_p
hotos') ==
'on' ? tr
ue : false
;
|
|
186 |
|
$bPe
rmalink =
getParam('
permalinks
_gallery_p
hotos') ==
'on' ? tr
ue : false
;
|
187 |
|
$sFileLink
=
getFileUrl
($iNew,
$sPhotoUri
,
'photo',
$bPermalin
k);
|
|
187 |
|
$sFileLink
=
getFileUrl
($iNew,
rawurlenco
de(
$sPhotoUri
)
,
'photo',
$bPermalin
k);
|
188 |
|
head
er("Locati
on:".$sFil
eLink);
|
|
188 |
|
head
er("Locati
on:".$sFil
eLink);
|
189 |
|
exit
;
|
|
189 |
|
exit
;
|
190 |
|
}
|
|
190 |
|
}
|
191 |
|
}
|
|
191 |
|
}
|
192 |
|
}
|
|
192 |
|
}
|
193 |
|
$sqlDelete
= "DELETE
FROM `sha
rePhotoFil
es` WHERE
`medID`='$
iNew'";
|
|
193 |
|
$sqlDelete
= "DELETE
FROM `sha
rePhotoFil
es` WHERE
`medID`='$
iNew'";
|
194 |
|
db_res($sq
lDelete);
|
|
194 |
|
db_res($sq
lDelete);
|
195 |
|
}
|
|
195 |
|
}
|
196 |
|
}
|
|
196 |
|
}
|
197 |
|
}
|
|
197 |
|
}
|
198 |
|
return
$sCode;
|
|
198 |
|
return
$sCode;
|
199 |
|
}
|
|
199 |
|
}
|
200 |
|
|
|
200 |
|
|
201 |
|
?>
|
|
201 |
|
?>
|