uploads.php
1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
/**
* 上传
*
* @version $Id: uploads.php 1 8:38 2010年7月9日Z tianya $
* @package DedeCMS.Member
* @copyright Copyright (c) 2007 - 2010, DesDev, Inc.
* @license http://help.dedecms.com/usersguide/license.html
* @link http://www.dedecms.com
*/
require_once(dirname(__FILE__)."/config.php");
CheckRank(0,0);
require_once(DEDEINC."/datalistcp.class.php");
setcookie("ENV_GOBACK_URL",$dedeNowurl,time()+3600,"/");
$menutype = 'content';
$keyword = empty($keyword) ? '' : FilterSearch($keyword);
$addsql = " where mid='".$cfg_ml->M_ID."' AND title LIKE '%$keyword%' ";
if(empty($mediatype)) $mediatype = 0;
$mediatype = intval($mediatype);
if($mediatype>0) $addsql .= " AND mediatype='$mediatype' ";
$sql = "SELECT * FROM `#@__uploads` $addsql ORDER BY aid DESC";
$dlist = new DataListCP();
$dlist->pageSize = 5;
$dlist->SetParameter("mediatype",$mediatype);
$dlist->SetParameter("keyword",$keyword);
$dlist->SetTemplate(DEDEMEMBER."/templets/uploads.htm");
$dlist->SetSource($sql);
$dlist->Display();
function MediaType($tid,$nurl)
{
if($tid==1)
{
return "图片";
}
else if($tid==2)
{
return "FLASH";
}
else if($tid==3)
{
return "视频/音频";
}
else
{
return "附件/其它";
}
}
function GetFileSize($fs)
{
$fs = $fs/1024;
return sprintf("%10.1f",$fs)." K";
}
function GetImageView($furl,$mtype)
{
if($mtype==1)
{
return "<img class='litPic' width='80' height='80' src='$furl' border='0' /><br />";
}
}