No regular expressions were active.
|
|
1 |
|
<?php
|
|
|
2 |
|
|
|
|
3 |
|
/*********
**********
**********
**********
**********
**********
**********
******
|
|
|
4 |
|
*
D
olphin Sma
rt Communi
ty Builder
|
|
|
5 |
|
*
---------
--------
|
|
|
6 |
|
* begi
n
: M
on Mar 23
2006
|
|
|
7 |
|
* copy
right
: (
C) 2006 Bo
onEx Group
|
|
|
8 |
|
* webs
ite
: h
ttp://www.
boonex.com
/
|
|
|
9 |
|
* This fil
e is part
of Dolphin
- Smart C
ommunity B
uilder
|
|
|
10 |
|
*
|
|
|
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/
|
|
|
13 |
|
*
|
|
|
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.
|
|
|
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
,
|
|
|
18 |
|
* see lice
nse.txt fi
le; if not
, write to
marketing
@boonex.co
m
|
|
|
19 |
|
**********
**********
**********
**********
**********
**********
**********
*****/
|
|
|
20 |
|
|
|
|
21 |
|
require_on
ce( '../in
c/header.i
nc.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' );
|
|
|
24 |
|
require_on
ce( BX_DIR
ECTORY_PAT
H_INC . 's
haring.inc
.php' );
|
|
|
25 |
|
require_on
ce( BX_DIR
ECTORY_PAT
H_INC . 'a
dmin_desig
n.inc.php'
);
|
|
|
26 |
|
require_on
ce( BX_DIR
ECTORY_PAT
H_INC . 'u
tils.inc.p
hp' );
|
|
|
27 |
|
require_on
ce( BX_DIR
ECTORY_PAT
H_CLASSES
. 'BxDolSh
aredMedia.
php' );
|
|
|
28 |
|
|
|
|
29 |
|
$_page['ex
tra_js'] =
'';
|
|
|
30 |
|
|
|
|
31 |
|
$logged['a
dmin'] = m
ember_auth
( 1, true,
true );
|
|
|
32 |
|
$ADMIN = $
logged[adm
in];
|
|
|
33 |
|
|
|
|
34 |
|
$_page['cs
s_name']
= 'browse.
css';
|
|
|
35 |
|
|
|
|
36 |
|
if (isset(
$_REQUEST[
'type']) &
& ($_REQUE
ST['type']
=='photo'
||$_REQUES
T['type']=
='music' |
| $_REQUES
T['type']=
='video'))
|
|
|
37 |
|
$sType
= htmlspe
cialchars_
adv($_REQU
EST['type'
]);
|
|
|
38 |
|
else
|
|
|
39 |
|
$sType
= 'photo'
;
|
|
|
40 |
|
|
|
|
41 |
|
$sBigType
= ucfirst(
$sType);
|
|
|
42 |
|
|
|
|
43 |
|
$_page['he
ader'] = "
Browse $sB
igType";
|
|
|
44 |
|
$_page['he
ader_text'
] = "Brows
e $sBigTyp
e";
|
|
|
45 |
|
|
|
|
46 |
|
$_ni = $_p
age['name_
index'];
|
|
|
47 |
|
|
|
|
48 |
|
$aMem = ar
ray();
|
|
|
49 |
|
$oNew = ne
w BxDolSha
redMedia($
sType, $si
te, $dir,
$aMem);
|
|
|
50 |
|
|
|
|
51 |
|
if (isset(
$_POST['Ch
eck']) &&
is_array(
$_POST['Ch
eck'])) {
|
|
|
52 |
|
foreac
h($_POST['
Check'] as
$iKey =>
$iVal) {
|
|
|
53 |
|
sw
itch (true
) {
|
|
|
54 |
|
case iss
et($_POST[
'Delete'])
:
|
|
|
55 |
|
$oNe
w->deleteM
edia((int)
$iVal, $lo
gged);
|
|
|
56 |
|
brea
k;
|
|
|
57 |
|
case iss
et($_POST[
'Approve']
):
|
|
|
58 |
|
$oNe
w->approve
Media((int
)$iVal);
|
|
|
59 |
|
brea
k;
|
|
|
60 |
|
}
|
|
|
61 |
|
}
|
|
|
62 |
|
}
|
|
|
63 |
|
|
|
|
64 |
|
$aWhere =
array();
|
|
|
65 |
|
|
|
|
66 |
|
$aWhere[]
= '1';
|
|
|
67 |
|
|
|
|
68 |
|
if (isset(
$_GET['use
rID'])) {
|
|
|
69 |
|
$iUser
= (int)$_
GET['userI
D'];
|
|
|
70 |
|
$aWher
e[] = "`{$
oNew->sMai
nTable}`.`
{$oNew->aT
ableFields
['medProfI
d']}`=$iUs
er";
|
|
|
71 |
|
}
|
|
|
72 |
|
|
|
|
73 |
|
if (isset(
$_GET['tag
'])) {
|
|
|
74 |
|
$sTag
= htmlspec
ialchars_a
dv($_GET['
tag']);
|
|
|
75 |
|
$aWher
e[] = "`{$
oNew->sMai
nTable}`.`
{$oNew->aT
ableFields
['medTags'
]}` like '
%$sTag%'";
|
|
|
76 |
|
}
|
|
|
77 |
|
|
|
|
78 |
|
$aSqlQuery
['sqlWhere
'] = "WHER
E " . impl
ode( ' AND
', $aWher
e );
|
|
|
79 |
|
|
|
|
80 |
|
$iTotalNum
= db_valu
e( "SELECT
COUNT( *
) FROM `{$
oNew->sMai
nTable}` {
$aSqlQuery
['sqlWhere
']}" );
|
|
|
81 |
|
if( !$iTot
alNum )
|
|
|
82 |
|
$sCode
.= '<div>
There are
no files</
div>';
|
|
|
83 |
|
|
|
|
84 |
|
$iPerPage
= (int)$_G
ET['per_pa
ge'];
|
|
|
85 |
|
if (!$iPer
Page)
|
|
|
86 |
|
$iPerP
age = 10;
|
|
|
87 |
|
|
|
|
88 |
|
$iTotalPag
es = ceil(
$iTotalNu
m / $iPerP
age );
|
|
|
89 |
|
|
|
|
90 |
|
$iCurPage
= (int)$_G
ET['page']
;
|
|
|
91 |
|
|
|
|
92 |
|
if( $iCurP
age > $iTo
talPages )
|
|
|
93 |
|
$iCurP
age = $iTo
talPages;
|
|
|
94 |
|
|
|
|
95 |
|
if( $iCurP
age < 1 )
|
|
|
96 |
|
$iCurP
age = 1;
|
|
|
97 |
|
|
|
|
98 |
|
$sLimitFro
m = ( $iCu
rPage - 1
) * $iPerP
age;
|
|
|
99 |
|
$aSqlQuery
['sqlLimit
'] = "LIMI
T $sLimitF
rom, $iPer
Page";
|
|
|
100 |
|
|
|
|
101 |
|
$aSqlQuery
['sqlOrder
'] = "ORDE
R BY `{$oN
ew->aTable
Fields['me
dDate']}`
DESC";
|
|
|
102 |
|
|
|
|
103 |
|
$aManage =
array('me
dID', 'med
ProfId', '
medTitle',
'medUri',
'medDate'
, 'medView
s', 'medEx
t', 'Appro
ved');
|
|
|
104 |
|
|
|
|
105 |
|
if ($iTota
lNum > 0)
{
|
|
|
106 |
|
$aCoun
t = array(
'total'=>$
iTotalPage
s, 'curren
t'=>$iCurP
age, 'per_
page'=>$iP
erPage);
|
|
|
107 |
|
$rData
= $oNew->
getFilesLi
st($aSqlQu
ery, $aMan
age);
|
|
|
108 |
|
$sCode
= browseC
ode($oNew,
$rData, $
aCount);
|
|
|
109 |
|
}
|
|
|
110 |
|
|
|
|
111 |
|
TopCodeAdm
in();
|
|
|
112 |
|
ContentBlo
ckHead("Li
st of $sBi
gType file
s");
|
|
|
113 |
|
|
|
|
114 |
|
echo $sCod
e;
|
|
|
115 |
|
|
|
|
116 |
|
ContentBlo
ckFoot();
|
|
|
117 |
|
BottomCode
();
|
|
|
118 |
|
|
|
|
119 |
|
function b
rowseCode(
$oNew, $rD
ata, $aCou
nt) {
|
|
|
120 |
|
$sCode
= '<div i
d="browseM
ain"><form
method="p
ost" actio
n="">';
|
|
|
121 |
|
$iCoun
t = mysql_
num_rows($
rData);
|
|
|
122 |
|
|
|
|
123 |
|
$sChec
kAll = $iC
ount > 1 ?
'<input ty
pe="checkb
ox" name=\
"ch_all" o
nclick="ch
eckAll( \'
Check[]\',
this.chec
ked )" />C
heck all'
: '';
|
|
|
124 |
|
|
|
|
125 |
|
if ($i
Count)
|
|
|
126 |
|
wh
ile ($aDat
a = mysql_
fetch_arra
y($rData))
|
|
|
127 |
|
$sCode .
= $oNew->s
howBrowseU
nit($aData
, true);
|
|
|
128 |
|
else
|
|
|
129 |
|
$s
Code .= '<
div>There
is are fil
es</div>';
|
|
|
130 |
|
|
|
|
131 |
|
$sCode
.= '</div
>';
|
|
|
132 |
|
ob_sta
rt();
|
|
|
133 |
|
?>
|
|
|
134 |
|
<div c
lass="clea
r_both"></
div>
|
|
|
135 |
|
<scrip
t>
|
|
|
136 |
|
fu
nction che
ckAll( _pr
ef, do_che
ck ) {
|
|
|
137 |
|
aElems =
document.
getElement
sByTagName
( 'input'
);
|
|
|
138 |
|
for( i =
0; i < aE
lems.lengt
h; i ++ )
{
|
|
|
139 |
|
var
elt = aEle
ms[i];
|
|
|
140 |
|
if(
elt.name.s
ubstr( 0,
_pref.leng
th ) == _p
ref )
|
|
|
141 |
|
elt.checke
d = do_che
ck;
|
|
|
142 |
|
}
|
|
|
143 |
|
}
|
|
|
144 |
|
</scri
pt>
|
|
|
145 |
|
<div c
lass="bott
omPart">
|
|
|
146 |
|
<?
=$sCheckAl
l?>
|
|
|
147 |
|
<i
nput type=
"submit" n
ame="Delet
e" value="
Delete">
|
|
|
148 |
|
<i
nput type=
"submit" n
ame="Appro
ve" value=
"Change st
atus">
|
|
|
149 |
|
<i
nput type=
"hidden" n
ame="type"
value="<?
=$oNew->sT
ype?>">
|
|
|
150 |
|
</div>
|
|
|
151 |
|
<?
|
|
|
152 |
|
$sCode
.= ob_get
_clean();
|
|
|
153 |
|
$sPagi
nation = $
oNew->show
Pagination
($aCount['
total'], $
aCount['cu
rrent'], $
aCount['pe
r_page'],
true);
|
|
|
154 |
|
|
|
|
155 |
|
return
$sCode.$s
Pagination
.'</form>'
;
|
|
|
156 |
|
}
|
|
|
157 |
|
|
|
|
158 |
|
?>
|