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 . 's
haring.inc
.php' );
|
|
25 |
|
require_on
ce( BX_DIR
ECTORY_PAT
H_INC . 's
haring.inc
.php' );
|
|
|
26 |
|
require_on
ce( BX_DIR
ECTORY_PAT
H_CLASSES
. 'BxDolSh
aredMedia.
php' );
|
26 |
|
|
|
27 |
|
|
27 |
|
$_page['na
me_index']
= 44;
|
|
28 |
|
$_page['na
me_index']
= 44;
|
28 |
|
$_page['cs
s_name']
= 'exp
lanation.c
ss';
|
|
29 |
|
$_page['cs
s_name']
= 'exp
lanation.c
ss';
|
29 |
|
|
|
30 |
|
|
30 |
|
$_page['ex
tra_js'] =
'';
|
|
31 |
|
$_page['ex
tra_js'] =
'';
|
31 |
|
|
|
32 |
|
|
32 |
|
if ( !( $l
ogged['adm
in'] = mem
ber_auth(
1, false )
) )
|
|
33 |
|
check_logg
ed();
|
33 |
|
{
|
|
|
34 |
|
if ( !
( $logged[
'member']
= member_a
uth( 0, fa
lse ) ) )
|
|
|
35 |
|
{
|
|
|
36 |
|
if
( !( $log
ged['aff']
= member_
auth( 2, f
alse ) ) )
|
|
|
37 |
|
{
|
|
|
38 |
|
$logged[
'moderator
'] = membe
r_auth( 3,
false );
|
|
|
39 |
|
}
|
|
|
40 |
|
}
|
|
|
41 |
|
}
|
|
|
42 |
|
|
|
|
43 |
|
|
|
34 |
|
|
44 |
|
$_page['he
ader'] = _
t( "_Photo
Actions"
);
|
|
35 |
|
$_page['he
ader'] = _
t( "_Photo
Actions"
);
|
45 |
|
$_page['he
ader_text'
] = _t("_P
hoto Actio
ns");
|
|
36 |
|
$_page['he
ader_text'
] = _t("_P
hoto Actio
ns");
|
46 |
|
|
|
37 |
|
|
47 |
|
$_ni = $_p
age['name_
index'];
|
|
38 |
|
$_ni = $_p
age['name_
index'];
|
48 |
|
|
|
39 |
|
|
49 |
|
$member['I
D'] = (int
)$_COOKIE[
'memberID'
];
|
|
40 |
|
$member['I
D'] = (int
)$_COOKIE[
'memberID'
];
|
50 |
|
|
|
41 |
|
|
51 |
|
if
(isset($_P
OST['fileI
D'])
&&
isset($_PO
ST['send']
)
&&
isset($_PO
ST['email'
]))
|
|
42 |
|
$oMedia =
new BxDolS
haredMedia
('photo',
$site, $di
r, $member
);
|
52 |
|
{
|
|
43 |
|
|
|
|
44 |
|
// -------
----------
----------
-------- m
ain variab
les for ac
tions ----
----------
----------
----------
-- //
|
|
|
45 |
|
|
|
|
46 |
|
$sTable =
'sharePhot
oFiles';
|
|
|
47 |
|
$sIdent =
'medID';
|
|
|
48 |
|
$aInfo = a
rray(
|
|
|
49 |
|
'Owner
'=> 'medPr
ofId',
|
|
|
50 |
|
'Title
'=> 'medTi
tle',
|
|
|
51 |
|
'Tags'
=> 'medTa
gs',
|
|
|
52 |
|
'Desc'
=> 'medDe
sc',
|
|
|
53 |
|
'Uri'
=> 'medUr
i'
|
|
|
54 |
|
);
|
|
|
55 |
|
|
|
|
56 |
|
// -------
----------
----------
----------
----------
----------
----------
----------
----------
----------
- //
|
|
|
57 |
|
|
|
|
58 |
|
if
(isset($_P
OST['fileI
D'])
&&
isset($_PO
ST['send']
)
&&
isset($_PO
ST['email'
]))
{
|
53 |
|
$iFile
= (int
)$_POST['f
ileID'];
|
|
59 |
|
$iFile
= (int
)$_POST['f
ileID'];
|
54 |
|
$sEmai
l = $_PO
ST['email'
];
|
|
60 |
|
$sEmai
l = $_PO
ST['email'
];
|
55 |
|
$sMess
age = html
specialcha
rs_adv($_P
OST['messa
geText']);
|
|
61 |
|
$sMess
age = html
specialcha
rs_adv($_P
OST['messa
geText']);
|
|
|
62 |
|
$sUrl
= proc
ess_pass_d
ata($_POST
['fileUrl'
]);
|
56 |
|
|
|
63 |
|
|
57 |
|
$sCode
.=
sendFileIn
fo($iFile,
$sEmail,
$sMessage
);
|
|
64 |
|
$sCode
.=
$oMedia->
sendFileIn
fo($iFile,
$sEmail,
$sMessage
,
$sUrl
);
|
58 |
|
}
|
|
65 |
|
}
|
59 |
|
|
|
66 |
|
|
60 |
|
if
(isset($_
GE
T['
a
ction'])
&&
isset(
$_
GE
T['
fil
e
ID
']
)
)
|
|
67 |
|
if
(isset($_
POS
T['
medi
a
A
ction'])
&&
$_
POS
T['
m
e
diaAction
']
==
'edit'
)
{
|
61 |
|
{
|
|
68 |
|
$iFile
= (int)
$_POST['fi
leID'];
|
|
|
69 |
|
saveCh
anges($iFi
le);
|
|
|
70 |
|
echo '
<script la
nguage="ja
vascript">
window.par
ent.opener
.location
= window.p
arent.open
er.locatio
n; window.
parent.clo
se();</scr
ipt>';
|
|
|
71 |
|
}
|
|
|
72 |
|
|
|
|
73 |
|
if (isset(
$_GET['act
ion']) &&
isset($_GE
T['fileID'
])) {
|
62 |
|
$sAct
= htmlspec
ialchars_a
dv($_GET['
action']);
|
|
74 |
|
$sAct
= htmlspec
ialchars_a
dv($_GET['
action']);
|
63 |
|
$
i
F
ile
=
(int)$_GET
['fileID']
;
|
|
75 |
|
$
aAct
i
on['f
ile
ID']
=
(int)$_GET
['fileID']
;
|
64 |
|
switch
($sAct)
|
|
76 |
|
switch
($sAct)
{
|
65 |
|
{
|
|
77 |
|
case
'
f
a
vo
r
it
e':
$sCode
=
$oMe
di
a
->addTo
F
av
or
ites
($
aAct
i
on['f
ile
ID
'
]
);
break;
|
66 |
|
ca
se 'favori
te': $sCod
e = addToF
avorites($
iFile); br
eak;
|
|
78 |
|
case
'
e
di
t':
$sCode
=
display
MediaEd
itForm($
aAct
i
on['f
ile
ID
'
]
);
break;
|
67 |
|
case
'
sh
a
r
e':
$sCode
=
di
spl
a
ySubmit
F
or
m
($
i
F
ile
,'share
'
);
break;
|
|
79 |
|
ca
se 'report
':
|
68 |
|
case
'
r
e
por
t':
$sCode
=
display
Subm
itForm($
i
F
ile
,'report
'
);
break;
|
|
80 |
|
ca
se 'share'
: $aAct
ion['actio
n'] = $sAc
t; $aActio
n['fileUrl
'] = urlen
code($_GET
['fileUrl'
]); $sCode
= $oMedia
->showSubm
itForm($aA
ction); br
eak;
|
69 |
|
}
|
|
81 |
|
}
|
70 |
|
}
|
|
82 |
|
}
|
71 |
|
|
|
83 |
|
|
72 |
|
$_page_con
t[$_ni]['p
age_main_c
ode'] = De
signBoxCon
tent( _t(
'_Notifica
tion' ), $
sCode, 1);
|
|
84 |
|
$_page_con
t[$_ni]['p
age_main_c
ode'] = De
signBoxCon
tent( _t(
'_Notifica
tion' ), $
sCode, 1);
|
73 |
|
|
|
85 |
|
|
74 |
|
PageCode()
;
|
|
86 |
|
PageCode()
;
|
75 |
|
|
|
87 |
|
|
76 |
|
function
a
d
d
To
F
av
or
ites
($iFile)
|
|
88 |
|
function
displ
a
yMe
d
iaE
d
it
F
or
m
($iFile)
{
|
77 |
|
{
|
|
|
78 |
|
global
$member;
|
|
89 |
|
global
$member;
|
|
|
90 |
|
global
$sTable;
|
|
|
91 |
|
global
$sIdent;
|
|
|
92 |
|
global
$aInfo;
|
79 |
|
|
|
93 |
|
|
80 |
|
if ($i
File)
|
|
94 |
|
$sqlQu
ery = "SEL
ECT ";
|
81 |
|
{
|
|
95 |
|
|
82 |
|
$s
Query = "S
ELECT * FR
OM `shareP
hotoFavori
tes` WHERE
`medID`='
$iFile' AN
D `userID`
='{$member
['ID']}'";
|
|
96 |
|
$sTemp
l = '<div>
__Key__</d
iv>';
|
83 |
|
$r
Check = db
_res($sQue
ry);
|
|
97 |
|
$sLine
= '';
|
84 |
|
if
(mysql_nu
m_rows($rC
heck) > 0)
|
|
98 |
|
|
|
|
99 |
|
foreac
h ($aInfo
as $sKey =
> $sVal)
|
85 |
|
{
|
|
100 |
|
{
|
86 |
|
$sCode =
'<div cla
ss="mediaI
nfo">'._t(
'_File alr
eady is fa
vorite').'
</div>';
|
|
101 |
|
$s
qlQuery .=
"`$sVal`,
";
|
87 |
|
}
|
|
102 |
|
if
($sKey !=
'Owner' &
& $sKey !=
'Uri')
|
88 |
|
el
se
|
|
|
89 |
|
{
|
|
103 |
|
{
|
90 |
|
$sQuery
= "INSERT
INTO `shar
ePhotoFavo
rites` (`m
edID`,`use
rID`,`favD
ate`) VALU
ES('$iFile
','{$membe
r['ID']}',
NOW())";
|
|
104 |
|
$sHead
= str_repl
ace('__Key
__', $sKey
, $sTempl)
;
|
91 |
|
db_res($
sQuery);
|
|
105 |
|
$sPatt
= $sKey !=
'Desc' ?
'<input ty
pe="text"
size="40"
name="'.$s
Key.'" val
ue="'.$sVa
l.'"/>' :
'<textarea
cols="30"
rows="10"
name="'.$
sKey.'">'.
$sVal.'</t
extarea>'
;
|
92 |
|
$sCode =
'<div cla
ss="mediaI
nfo">'._t(
"_File was
added to
favorite")
.'</div>';
|
|
106 |
|
$sMain
= str_repl
ace('__Key
__', $sPat
t, $sTempl
);
|
|
|
107 |
|
$sLine .
= $sHead.$
sMain;
|
93 |
|
}
|
|
108 |
|
}
|
94 |
|
}
|
|
109 |
|
}
|
95 |
|
|
|
110 |
|
|
96 |
|
return
$sCode;
|
|
111 |
|
$sqlQu
ery = trim
($sqlQuery
, ','). "F
ROM `$sTab
le` WHERE
`$sIdent`=
'$iFile'";
|
97 |
|
}
|
|
|
98 |
|
|
|
112 |
|
|
99 |
|
function d
isplaySubm
itForm($iF
ile, $sAct
='')
|
|
113 |
|
$aData
= db_arr(
$sqlQuery)
;
|
100 |
|
{
|
|
|
101 |
|
global
$member;
|
|
|
102 |
|
global
$site;
|
|
|
103 |
|
|
|
114 |
|
|
104 |
|
if ($i
File && st
rlen($sAct
) > 0)
|
|
115 |
|
if ($a
Data[$aInf
o['Owner']
] != $memb
er['ID'])
|
105 |
|
{
|
|
116 |
|
ex
it;
|
106 |
|
sw
itch ($sAc
t)
|
|
117 |
|
|
107 |
|
{
|
|
118 |
|
foreac
h ($aInfo
as $sKey =
> $sValue)
|
108 |
|
case 'sh
are' :
|
|
119 |
|
$s
Line = str
_replace($
sValue, $a
Data[$sVal
ue], $sLin
e);
|
109 |
|
$sAd
dr = '<di
v>'._t("_E
nter email
(s)").':</
div><div><
input type
="text" si
ze="40" na
me="email"
></div>';
|
|
|
110 |
|
$sSi
tes = '<di
v style="m
argin-top:
10px; marg
in-bottom:
10px;">'.g
etSitesArr
ay($iFile,
'Photo').'
</div>';
|
|
|
111 |
|
brea
k;
|
|
|
112 |
|
case 're
port':
|
|
|
113 |
|
$sAd
dr = '<in
put type="
hidden" na
me="email"
value="'.
$site['ema
il_notify'
].'">';
|
|
|
114 |
|
$sSi
tes = '';
|
|
|
115 |
|
brea
k;
|
|
|
116 |
|
}
|
|
|
117 |
|
|
|
120 |
|
|
118 |
|
$s
Code = '<
div class=
"mediaInfo
">';
|
|
121 |
|
$sCode
= '<div
class="med
iaInfo">';
|
119 |
|
$s
Code .= '<
form name=
"submitAct
ion" metho
d="post" a
ction="'.$
_SERVER['P
HP_SELF'].
'">';
|
|
|
120 |
|
$s
Code .= '<
input type
="hidden"
name="file
ID" value=
"'.$iFile.
'">';
|
|
|
121 |
|
|
|
122 |
|
|
122 |
|
$sCode
.=
$s
Addr.$sS
i
t
e
s
;
|
|
123 |
|
$s
Code .= '<
iframe nam
e="Edit" s
tyle="disp
lay: none;
"></iframe
>
|
123 |
|
$s
Code .= '<
div>'._t("
_Message t
ext").'</d
iv>';
|
|
124 |
|
<form ta
rget="Edit
" name="su
bmitAction
" method="
post" acti
on="'.$_SE
RVER['PHP_
SELF'].'">
';
|
124 |
|
$s
Code .= '<
div><texta
rea cols="
30" rows="
10" name="
messageTex
t"></texta
rea></div>
';
|
|
125 |
|
|
125 |
|
$sCode
.=
'<div><inp
ut
type="subm
it"
size="15"
name="s
e
nd
"
value="
S
e
n
d
">';
|
|
126 |
|
$sCode
.=
$s
L
i
n
e
;
|
|
|
127 |
|
$sCode
.=
'<div><inp
ut
type="subm
it"
size="15"
name="s
av
e
"
value="
'._t('_
S
av
e
Cha
n
ges').'
">';
|
126 |
|
$s
Code .= '<
input type
="reset" s
ize="15" n
ame="send"
value="Re
set"></div
>';
|
|
128 |
|
$sCode .
= '<input
type="rese
t" size="1
5" name="s
end" value
="Reset"><
/div>';
|
|
|
129 |
|
$sCode .
= '<input
type="hidd
en" name="
fileID" va
lue="'.$iF
ile.'">';
|
|
|
130 |
|
$sCode .
= '<input
type="hidd
en" name="
mediaActio
n" value="
edit">';
|
127 |
|
|
|
131 |
|
|
128 |
|
$s
Code .= '<
/form>';
|
|
132 |
|
$s
Code .= '<
/form>';
|
129 |
|
|
|
133 |
|
|
130 |
|
$s
Code .= '<
/div>';
|
|
134 |
|
$sCode
.= '</div
>';
|
131 |
|
}
|
|
|
132 |
|
|
|
135 |
|
|
133 |
|
return
$sCode;
|
|
136 |
|
return
$sCode;
|
134 |
|
}
|
|
137 |
|
}
|
135 |
|
|
|
138 |
|
|
136 |
|
|
|
139 |
|
function
s
av
e
Cha
n
g
e
s
($iFile
)
{
|
137 |
|
function
s
e
n
dFil
e
Info
($iFile
,
$sEmail,
$sMessage
)
|
|
140 |
|
global
$aInfo;
|
138 |
|
{
|
|
141 |
|
global
$s
Tabl
e;
|
139 |
|
global
$s
it
e;
|
|
|
140 |
|
global
$member;
|
|
142 |
|
global
$member;
|
|
|
143 |
|
global
$sIdent;
|
141 |
|
|
|
144 |
|
|
142 |
|
/*$sQu
ery = "SEL
ECT `NickN
ame`
|
|
145 |
|
$sqlQu
ery = "UPD
ATE `$sTab
le` SET ";
|
143 |
|
FROM
`Profiles`
|
|
146 |
|
foreach
($a
Info
as
$
s
Key
=>
$s
V
a
l)
|
144 |
|
WHERE
`ID`='{$m
ember['ID'
]}'";
|
|
|
145 |
|
|
|
|
146 |
|
$aUser
= db_arr(
$sQuery);*
/
|
|
|
147 |
|
|
|
|
148 |
|
$aUser
= getProf
ileInfo( $
member['ID
'] );
|
|
|
149 |
|
|
|
|
150 |
|
$sMail
Header
= "Fro
m: {$site[
'title']}
<{$site['e
mail_notif
y']}>";
|
|
|
151 |
|
$sMail
Parameters
= "-f{
$site['ema
il_notify'
]}";
|
|
|
152 |
|
|
|
|
153 |
|
$sMail
Header = "
MIME-Versi
on: 1.0\r\
n" . "Cont
ent-type:
text/html;
charset=U
TF-8\r\n"
. $sMailHe
ader;
|
|
|
154 |
|
$sMail
Subject =
$aUser['Ni
ckName'].'
shared a
Photo with
you';
|
|
|
155 |
|
|
|
|
156 |
|
$sMai
lBody =
"Hello,\n
|
|
|
157 |
|
{$aU
ser['NickN
ame']} sha
red a phot
o with you
: <a href=
\"{$site['
url']}view
Photo.php?
fileID=$iF
ile\">See
it</a>\n
|
|
|
158 |
|
$sMe
ssage\n
|
|
|
159 |
|
Rega
rds";
|
|
|
160 |
|
|
|
|
161 |
|
$aEmai
ls = explo
de(",",$sE
mail);
|
|
|
162 |
|
foreach
($a
Emails
as
$
i
Key
=>
$s
M
a
i
l)
|
|
|
163 |
|
{
|
|
147 |
|
{
|
164 |
|
$s
Mail = tri
m($sMail);
|
|
148 |
|
sw
itch ($sKe
y)
|
165 |
|
$i
SendingRes
ult = mail
( $sMail,
$sMailSubj
ect, nl2br
($sMailBod
y), $sMail
Header, $s
MailParame
ters );
|
|
|
166 |
|
}
|
|
|
167 |
|
if ($i
SendingRes
ult)
|
|
|
168 |
|
{
|
|
149 |
|
{
|
169 |
|
$s
Code = '<d
iv class="
mediaInfo"
>'._t("_Fi
le info wa
s sent").'
</div>';
|
|
150 |
|
case 'Ow
ner': brea
k;
|
|
|
151 |
|
case 'Ur
i' : break
;
|
|
|
152 |
|
default:
|
|
|
153 |
|
$sIn
put = p
rocess_db_
input($_PO
ST[$sKey])
;
|
|
|
154 |
|
$sql
Query .= "
`$sVal` =
'$sInput',
";
|
170 |
|
}
|
|
155 |
|
}
|
171 |
|
return
$sCode;
|
|
156 |
|
}
|
|
|
157 |
|
|
|
|
158 |
|
$sqlQu
ery = rtri
m($sqlQuer
y,',')." W
HERE `$sId
ent` = '$i
File' AND
`{$aInfo['
Owner']}`=
'{$member[
'ID']}'";
|
|
|
159 |
|
db_res
($sqlQuery
);
|
|
|
160 |
|
if (!m
ysql_affec
ted_rows()
)
|
|
|
161 |
|
ex
it;
|
172 |
|
}
|
|
162 |
|
}
|
173 |
|
|
|
163 |
|
|
174 |
|
?>
|
|
164 |
|
?>
|