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 |
|
if ( !( $l
ogged['adm
in'] = mem
ber_auth(
1, false )
) )
|
|
33 |
|
check_logg
ed();
|
34 |
|
{
|
|
|
35 |
|
if ( !
( $logged[
'member']
= member_a
uth( 0, fa
lse ) ) )
|
|
|
36 |
|
{
|
|
|
37 |
|
if
( !( $log
ged['aff']
= member_
auth( 2, f
alse ) ) )
|
|
|
38 |
|
{
|
|
|
39 |
|
$logged[
'moderator
'] = membe
r_auth( 3,
false );
|
|
|
40 |
|
}
|
|
|
41 |
|
}
|
|
|
42 |
|
}
|
|
|
43 |
|
|
|
|
44 |
|
|
|
34 |
|
|
45 |
|
$_page['he
ader'] = _
t( "_uploa
d Photo" )
;
|
|
35 |
|
$_page['he
ader'] = _
t( "_uploa
d Photo" )
;
|
46 |
|
$_page['he
ader_text'
] = _t("_u
pload Phot
o");
|
|
36 |
|
$_page['he
ader_text'
] = _t("_u
pload Phot
o");
|
47 |
|
|
|
37 |
|
|
48 |
|
$_ni = $_p
age['name_
index'];
|
|
38 |
|
$_ni = $_p
age['name_
index'];
|
49 |
|
|
|
39 |
|
|
50 |
|
$member['I
D'] = (int
)$_COOKIE[
'memberID'
];
|
|
40 |
|
$member['I
D'] = (int
)$_COOKIE[
'memberID'
];
|
51 |
|
$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 );
|
52 |
|
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'] )
|
53 |
|
{
|
|
43 |
|
{
|
54 |
|
$ret
= "
|
|
44 |
|
$ret
= "
|
55 |
|
<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>
|
56 |
|
<td alig
n=center b
gcolor=$bo
xbg2>
|
|
46 |
|
<td alig
n=center b
gcolor=$bo
xbg2>
|
57 |
|
". $
check_res[
CHECK_ACTI
ON_MESSAGE
] ."<br />
|
|
47 |
|
". $
check_res[
CHECK_ACTI
ON_MESSAGE
] ."<br />
|
58 |
|
</td>
|
|
48 |
|
</td>
|
59 |
|
</
table>\n";
|
|
49 |
|
</
table>\n";
|
60 |
|
|
|
50 |
|
|
61 |
|
$_page
['name_ind
ex'] = 0;
|
|
51 |
|
$_page
['name_ind
ex'] = 0;
|
62 |
|
$_page
_cont[0]['
page_main_
code'] = $
ret;
|
|
52 |
|
$_page
_cont[0]['
page_main_
code'] = $
ret;
|
63 |
|
PageCo
de();
|
|
53 |
|
PageCo
de();
|
64 |
|
exit()
;
|
|
54 |
|
exit()
;
|
65 |
|
}
|
|
55 |
|
}
|
66 |
|
|
|
56 |
|
|
|
|
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"))
{
|
67 |
|
$sStatus =
'';
|
|
59 |
|
$sStat
us = '';
|
68 |
|
if
(isset($_P
OST['uploa
d'])
&&
isset($_PO
ST['medPro
fId']))
|
|
60 |
|
if
(isset($_P
OST['uploa
d'])
&&
isset($_PO
ST['medPro
fId']))
{
|
69 |
|
{
|
|
|
70 |
|
$sStat
us = '<div
>'._t("_Fi
le was upl
oaded").'<
/div>';
|
|
61 |
|
$s
Status = '
<div>'._t(
"_File was
uploaded"
).'</div>'
;
|
71 |
|
$iUser
= (int)$_
POST['medP
rofId'];
|
|
62 |
|
$i
User = (in
t)$_POST['
medProfId'
];
|
72 |
|
$sFile
= htmlspe
cialchars_
adv($_POST
['title'])
;
|
|
63 |
|
$s
File = htm
lspecialch
ars_adv($_
POST['titl
e']);
|
73 |
|
$sDesc
= isset($
_POST['des
cription']
) && strle
n($_POST['
descriptio
n']) ? pro
cess_db_in
put(htmlsp
ecialchars
_adv($_POS
T['descrip
tion'])) :
'';
|
|
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']
)) : '';
|
74 |
|
$sTags
= isset($
_POST['tag
s']) && st
rlen($_POS
T['tags'])
? process
_db_input(
htmlspecia
lchars_adv
($_POST['t
ags'])) :
'';
|
|
65 |
|
$s
Tags = iss
et($_POST[
'tags']) &
& strlen($
_POST['tag
s']) ? pro
cess_db_in
put(htmlsp
ecialchars
_adv($_POS
T['tags'])
) : '';
|
75 |
|
$sStat
us = uploa
dFile($sFi
le, $sDesc
, $sTags,
$iUser);
|
|
66 |
|
$s
Status = u
ploadFile(
$sFile, $s
Desc, $sTa
gs, $iUser
);
|
76 |
|
}
|
|
67 |
|
}
|
77 |
|
|
|
68 |
|
}
|
78 |
|
$_page_con
t[
$_ni
]['page_ma
in_code']
=
$s
Status.Pag
eMain
Code
()
;
|
|
69 |
|
else {
|
79 |
|
|
|
70 |
|
$sCode
= MsgBox(
_t( '_Pho
to gallery
limit was
reached'
) );
|
|
|
71 |
|
$_page
['name_ind
ex'] = 0;
|
|
|
72 |
|
$_page_con
t[
0
]['page_ma
in_code']
=
$s
Code
;
|
80 |
|
PageCode()
;
|
|
73 |
|
PageCo
de();
|
|
|
74 |
|
exit()
;
|
|
|
75 |
|
}
|
81 |
|
|
|
76 |
|
|
82 |
|
function P
ageMainCod
e()
|
|
77 |
|
$_page_con
t[$_ni]['p
age_main_c
ode'] = $s
Status.Pag
eMainCode(
$site['url
'], $membe
r['ID']);
|
83 |
|
{
|
|
|
84 |
|
global
$site;
|
|
|
85 |
|
global
$member;
|
|
|
86 |
|
|
|
|
87 |
|
$sCode
= '<div i
d="agreeme
nt" style=
"text-alig
n: center;
"><div sty
le="font-w
eight: bol
d;">'._t("
_Media upl
oad Agreem
ent",_t("_
Photo")).'
</div><div
><textarea
rows="20"
cols="80"
readonly=
"true">'._
t("_Licens
e Agreemen
t",$site['
url']).'</
textarea><
/div><div>
<input typ
e="submit"
id="agree
" value="'
._t("_I ag
ree").'" o
nclick="do
cument.get
ElementByI
d(\'upload
ShareMain\
').style.d
isplay = \
'block\';
|
|
|
88 |
|
docume
nt.getElem
entById(\'
agreement\
').style.d
isplay = \
'none\';""
></div></d
iv>';
|
|
|
89 |
|
$sCode
.= '<div
id="upload
ShareMain"
style="di
splay: non
e;">';
|
|
|
90 |
|
|
|
|
91 |
|
$sCode
.= "<form
enctype=\
"multipart
/form-data
\" method=
\"post\" a
ction=\"{$
_SERVER['P
HP_SELF']}
\">";
|
|
|
92 |
|
|
|
78 |
|
|
93 |
|
$sCode
.= '<div
class="upl
oadLine"><
div class=
"uploadTex
t">'._t("_
Title").':
</div><di
v><input t
ype="text"
name="tit
le" class=
"uploadFor
m"/></div>
</div>';
|
|
79 |
|
PageCode()
;
|
94 |
|
$sCode
.= '<div
class="upl
oadLine"><
div class=
"uploadTex
t">'._t("_
Descriptio
n").': </d
iv><div><t
extarea na
me="descri
ption" cla
ss="upload
Form"/></t
extarea></
div></div>
';
|
|
|
95 |
|
$sCode
.= '<div
class="upl
oadLine"><
div class=
"uploadTex
t">'._t("_
Tags").':
</div><div
><input ty
pe="text"
name="tags
" class="u
ploadForm"
/></div></
div>';
|
|
|
96 |
|
$sCode
.= '<div
class="upl
oadLine"><
div class=
"uploadTex
t">'._t("_
Select").'
: </div><d
iv><input
type="file
" name="up
loadFile"
size="43"/
></div></d
iv>';
|
|
|
97 |
|
$sCode
.= '<inpu
t type="hi
dden" name
="medProfI
d" value="
'.$member[
'ID'].'"/>
';
|
|
|
98 |
|
$sCode
.= '<div
class="upl
oadLine"><
div style=
"text-alig
n: center;
"><input t
ype="submi
t" name="u
pload" val
ue="'._t("
_Upload Fi
le").'"/><
/div></div
>';
|
|
|
99 |
|
|
|
80 |
|
|
100 |
|
$sCode
.= '</for
m>';
|
|
81 |
|
function P
ageMainCod
e($sSiteUr
l, $iUser
= 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>';
|
|
|
84 |
|
ob_sta
rt();
|
|
|
85 |
|
?>
|
|
|
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>
|
|
|
88 |
|
<div>
|
|
|
89 |
|
<t
extarea ro
ws="20" co
ls="80" re
adonly="tr
ue"><?=_t(
"_License
Agreement"
, $sSiteUr
l)?></text
area>
|
|
|
90 |
|
</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';
|
|
|
93 |
|
docume
nt.getElem
entById('a
greement')
.style.dis
play = 'no
ne';"">
|
|
|
94 |
|
</div>
|
|
|
95 |
|
</div>
|
|
|
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']?
>">
|
101 |
|
|
|
98 |
|
|
102 |
|
$sCode
.= '</div
>';
|
|
99 |
|
<d
iv class="
uploadLine
">
|
|
|
100 |
|
<div cla
ss="upload
Text"><?=_
t("_Title"
)?>: </div
>
|
|
|
101 |
|
<div><in
put type="
text" name
="title" c
lass="uplo
adForm"/><
/div>
|
|
|
102 |
|
</
div>
|
|
|
103 |
|
<d
iv class="
uploadLine
">
|
|
|
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>
|
|
|
106 |
|
</
div>
|
|
|
107 |
|
<d
iv class="
uploadLine
">
|
|
|
108 |
|
<div cla
ss="upload
Text"><?=_
t("_Tags")
?>: </div>
|
|
|
109 |
|
<div><in
put type="
text" name
="tags" cl
ass="uploa
dForm"/></
div>
|
|
|
110 |
|
</
div>
|
|
|
111 |
|
<d
iv class="
uploadLine
">
|
|
|
112 |
|
<div cla
ss="upload
Text"><?=_
t("_Select
")?>: </di
v>
|
|
|
113 |
|
<div><in
put type="
file" name
="uploadFi
le" size="
43"/></div
>
|
|
|
114 |
|
</
div>
|
|
|
115 |
|
<i
nput type=
"hidden" n
ame="medPr
ofId" valu
e="<?=$iUs
er?>"/>
|
|
|
116 |
|
<d
iv class="
uploadLine
">
|
|
|
117 |
|
<div cla
ss="upload
Button">
|
|
|
118 |
|
<inp
ut type="s
ubmit" nam
e="upload"
value="<?
=_t("_Uplo
ad File")?
>"/>
|
|
|
119 |
|
</div>
|
|
|
120 |
|
</
div>
|
|
|
121 |
|
</
form>
|
|
|
122 |
|
</div>
|
|
|
123 |
|
<?
|
|
|
124 |
|
$sCode
= ob_get_
clean();
|
103 |
|
|
|
125 |
|
|
104 |
|
return
$sCode;
|
|
126 |
|
return
$sCode;
|
105 |
|
|
|
127 |
|
|
106 |
|
}
|
|
128 |
|
}
|
107 |
|
|
|
129 |
|
|
108 |
|
function u
ploadFile(
$sFile, $s
Desc, $sTa
gs, $iUser
)
|
|
130 |
|
function u
ploadFile(
$sFile, $s
Desc, $sTa
gs, $iUser
)
|
109 |
|
{
|
|
131 |
|
{
|
110 |
|
global
$dir;
|
|
132 |
|
global
$dir;
|
111 |
|
|
|
133 |
|
|
112 |
|
if( $_
FILES['upl
oadFile'][
'error'] !
= 0 )
|
|
134 |
|
if( $_
FILES['upl
oadFile'][
'error'] !
= 0 )
|
113 |
|
$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>';
|
114 |
|
el
se
|
|
136 |
|
el
se
|
115 |
|
{
|
|
137 |
|
{
|
116 |
|
$aFileIn
fo = getim
agesize( $
_FILES['up
loadFile']
['tmp_name
'] );
|
|
138 |
|
$aFileIn
fo = getim
agesize( $
_FILES['up
loadFile']
['tmp_name
'] );
|
117 |
|
if( !$aF
ileInfo )
|
|
139 |
|
if( !$aF
ileInfo )
|
118 |
|
$sCo
de = '<div
class="up
loadStatus
">'._t("_Y
ou uploade
d not imag
e file").'
</div>';
|
|
140 |
|
$sCo
de = '<div
class="up
loadStatus
">'._t("_Y
ou uploade
d not imag
e file").'
</div>';
|
119 |
|
else
|
|
141 |
|
else
|
120 |
|
{
|
|
142 |
|
{
|
121 |
|
$ext
= false;
|
|
143 |
|
$ext
= false;
|
122 |
|
swit
ch( $aFile
Info['mime
'] )
|
|
144 |
|
swit
ch( $aFile
Info['mime
'] )
|
123 |
|
{
|
|
145 |
|
{
|
124 |
|
case 'imag
e/jpeg': $
ext = 'jpg
'; break;
|
|
146 |
|
case 'imag
e/jpeg': $
ext = 'jpg
'; break;
|
125 |
|
case 'imag
e/gif': $
ext = 'gif
'; break;
|
|
147 |
|
case 'imag
e/gif': $
ext = 'gif
'; break;
|
126 |
|
case 'imag
e/png': $
ext = 'png
'; break;
|
|
148 |
|
case 'imag
e/png': $
ext = 'png
'; break;
|
127 |
|
default:
$
ext = fals
e;
|
|
149 |
|
default:
$
ext = fals
e;
|
128 |
|
}
|
|
150 |
|
}
|
129 |
|
|
|
151 |
|
|
130 |
|
if(
!$ext )
|
|
152 |
|
if(
!$ext )
|
131 |
|
$sCode = '
<div class
="uploadSt
atus">'._t
("_You upl
oaded not
JPEG, GIF
or PNG fil
e").'</div
>';
|
|
153 |
|
$sCode = '
<div class
="uploadSt
atus">'._t
("_You upl
oaded not
JPEG, GIF
or PNG fil
e").'</div
>';
|
132 |
|
else
|
|
154 |
|
else
|
133 |
|
{
|
|
155 |
|
{
|
134 |
|
$sCode = '
<div class
="uploadSt
atus">'._t
("_Upload
successful
").'</div>
';
|
|
156 |
|
$sCode = '
<div class
="uploadSt
atus">'._t
("_Upload
successful
").'</div>
';
|
135 |
|
|
|
157 |
|
|
136 |
|
$sActive =
getParam(
"enable_sh
PhotoActiv
ation") ==
'on' ? 't
rue' : 'fa
lse' ;
|
|
158 |
|
$sActive =
getParam(
"enable_sh
PhotoActiv
ation") ==
'on' ? 't
rue' : 'fa
lse' ;
|
137 |
|
$sQuery
=
"INSERT
INTO
`sharePhot
oFiles`
(`medProfI
d`,`medTit
le`,`med
Ext`,`medD
esc`,`medT
ags`,`medD
ate`,`Appr
oved`)
VALUES('$i
User','$sF
ile','$
ext','$sDe
sc','$sTag
s',
NOW
()
,'$sActive
')";
|
|
159 |
|
$sPhotoUri
= uriGene
rate($sFil
e, 'shareP
hotoFiles'
, 'medUri'
);
|
|
|
160 |
|
$sQuery
=
"INSERT
INTO
`sharePhot
oFiles`
(`medProfI
d`,`medTit
le`,`med
Uri`,`med
Ext`,`medD
esc`,`medT
ags`,`medD
ate`,`Appr
oved`)
VALUES('$i
User','$sF
ile','$
sPhotoUri'
,'$
ext','$sDe
sc','$sTag
s',
".time
()
."
,'$sActive
')";
|
138 |
|
db_res($sQ
uery);
|
|
161 |
|
db_res($sQ
uery);
|
139 |
|
$iNew = my
sql_insert
_id();
|
|
162 |
|
$iNew = my
sql_insert
_id();
|
140 |
|
reparseObj
Tags( 'pho
to', $iNew
);
|
|
163 |
|
reparseObj
Tags( 'pho
to', $iNew
);
|
141 |
|
|
|
164 |
|
|
142 |
|
$sNewFileN
ame = $dir
['sharingI
mages'] .
$iNew.'.'.
$ext;
|
|
165 |
|
$sNewFileN
ame = $dir
['sharingI
mages'] .
$iNew.'.'.
$ext;
|
143 |
|
$sNewMainN
ame = $dir
['sharingI
mages'] .
$iNew.'_m.
'.$ext;
|
|
166 |
|
$sNewMainN
ame = $dir
['sharingI
mages'] .
$iNew.'_m.
'.$ext;
|
144 |
|
$sNewThumb
Name = $di
r['sharing
Images'] .
$iNew.'_t
.'.$ext;
|
|
167 |
|
$sNewThumb
Name = $di
r['sharing
Images'] .
$iNew.'_t
.'.$ext;
|
145 |
|
|
|
168 |
|
|
146 |
|
if( !move_
uploaded_f
ile( $_FIL
ES['upload
File']['tm
p_name'],
$sNewFileN
ame ))
|
|
169 |
|
if( !move_
uploaded_f
ile( $_FIL
ES['upload
File']['tm
p_name'],
$sNewFileN
ame ))
|
147 |
|
$sCode
= '<div c
lass="uplo
adStatus">
'._t("_Cou
ldn\'t mov
e file").'
</div>';
|
|
170 |
|
$sCode
= '<div c
lass="uplo
adStatus">
'._t("_Cou
ldn\'t mov
e file").'
</div>';
|
148 |
|
else
|
|
171 |
|
else
|
149 |
|
{
|
|
172 |
|
{
|
150 |
|
ch
mod( $sNew
FileName,
0644 );
|
|
173 |
|
ch
mod( $sNew
FileName,
0644 );
|
151 |
|
$i
Width = (
int)getPar
am("max_ph
oto_width"
);
|
|
174 |
|
$i
Width = (
int)getPar
am("max_ph
oto_width"
);
|
152 |
|
$i
Height = (
int)getPar
am("max_ph
oto_height
");
|
|
175 |
|
$i
Height = (
int)getPar
am("max_ph
oto_height
");
|
153 |
|
|
|
176 |
|
|
154 |
|
$i
ThumbW = (
int)getPar
am("max_th
umb_width"
);
|
|
177 |
|
$i
ThumbW = (
int)getPar
am("max_th
umb_width"
);
|
155 |
|
$i
ThumbH = (
int)getPar
am("max_th
umb_height
");
|
|
178 |
|
$i
ThumbH = (
int)getPar
am("max_th
umb_height
");
|
156 |
|
|
|
179 |
|
|
157 |
|
if
( imageRes
ize( $sNew
FileName,
$sNewMainN
ame, $iWid
th, $iHeig
ht ) != IM
AGE_ERROR_
SUCCESS)
|
|
180 |
|
if
( imageRes
ize( $sNew
FileName,
$sNewMainN
ame, $iWid
th, $iHeig
ht ) != IM
AGE_ERROR_
SUCCESS)
|
158 |
|
{
|
|
181 |
|
{
|
159 |
|
$sCode =
'<div cla
ss="upload
Status">'.
_t("_Uploa
d failed")
.'</div>';
|
|
182 |
|
$sCode =
'<div cla
ss="upload
Status">'.
_t("_Uploa
d failed")
.'</div>';
|
160 |
|
}
|
|
183 |
|
}
|
161 |
|
el
se
|
|
184 |
|
el
se
|
162 |
|
{
|
|
185 |
|
{
|
163 |
|
imageRes
ize( $sNew
MainName,
$sNewThumb
Name, $iTh
umbW, $iTh
umbH );
|
|
186 |
|
imageRes
ize( $sNew
MainName,
$sNewThumb
Name, $iTh
umbW, $iTh
umbH );
|
164 |
|
header("Lo
cation:
viewPhoto.
php?fileID
=
".$
i
N
e
w
);
|
|
187 |
|
$bPermal
ink = getP
aram('perm
alinks_gal
lery_photo
s') == 'on
' ? true :
false;
|
|
|
188 |
|
$sFileLi
nk = getFi
leUrl($iNe
w, $sPhoto
Uri, 'phot
o', $bPerm
alink);
|
|
|
189 |
|
header("Lo
cation:
".$
sF
i
l
e
Link
);
|
165 |
|
exit;
|
|
190 |
|
exit;
|
166 |
|
}
|
|
191 |
|
}
|
167 |
|
}
|
|
192 |
|
}
|
168 |
|
}
|
|
193 |
|
}
|
169 |
|
}
|
|
194 |
|
}
|
170 |
|
}
|
|
195 |
|
}
|
171 |
|
return
$sCode;
|
|
196 |
|
return
$sCode;
|
172 |
|
}
|
|
197 |
|
}
|
173 |
|
|
|
198 |
|
|
174 |
|
?>
|
|
199 |
|
?>
|