@@ -184,11 +184,15 @@ function SpGetEditor($fname,$fvalue,$nheight="350",$etype="Basic",$gtype="print" | |||||
} | } | ||||
else if($GLOBALS['cfg_html_editor']=='ckeditor') | else if($GLOBALS['cfg_html_editor']=='ckeditor') | ||||
{ | { | ||||
$addConfig = ""; | |||||
if (defined("DEDEADMIN")) { | |||||
$addConfig = ",{filebrowserImageUploadUrl:'./dialog/select_images_post.php'}"; | |||||
} | |||||
$code = <<<EOT | $code = <<<EOT | ||||
<script src="{$GLOBALS['cfg_static_dir']}/ckeditor/ckeditor.js"></script> | <script src="{$GLOBALS['cfg_static_dir']}/ckeditor/ckeditor.js"></script> | ||||
<textarea id="{$fname}" name="{$fname}" rows="8" cols="60">{$fvalue}</textarea> | <textarea id="{$fname}" name="{$fname}" rows="8" cols="60">{$fvalue}</textarea> | ||||
<script> | <script> | ||||
var editor = CKEDITOR.replace('{$fname}'); | |||||
var editor = CKEDITOR.replace('{$fname}'{$addConfig}); | |||||
</script> | </script> | ||||
EOT; | EOT; | ||||
if($gtype=="print") | if($gtype=="print") | ||||
@@ -1,118 +0,0 @@ | |||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |||||
<html xmlns="http://www.w3.org/1999/xhtml"> | |||||
<head> | |||||
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $cfg_soft_lang; ?>" /> | |||||
<title>附件数据管理 - 会员中心 - <?php echo $cfg_webname; ?></title> | |||||
<link href="templets/style/base.css" rel="stylesheet" type="text/css" /> | |||||
<script type="text/javascript" src="../static/js/jquery.js"></script> | |||||
<script type="text/javascript" src="templets/js/load.js"></script> | |||||
<script type="text/javascript" src="templets/js/leftmenu.js"></script> | |||||
<script type="text/javascript"> | |||||
function ChangeImage(surl){ document.getElementById('picview').src = surl; } | |||||
//获得选中文件的文件名 | |||||
function getCheckboxItem(){ | |||||
var allSel=""; | |||||
if(document.form1.aids.value) return document.form1.aids.value; | |||||
for(i=0;i<document.form1.aids.length;i++) | |||||
{ | |||||
if(document.form1.aids[i].checked){ | |||||
if(allSel=="") | |||||
allSel=document.form1.aids[i].value; | |||||
else | |||||
allSel=allSel+","+document.form1.aids[i].value; | |||||
} | |||||
} | |||||
return allSel; | |||||
} | |||||
function AllSel(){ | |||||
for(i=0;i<document.form1.aids.length;i++){ | |||||
document.form1.aids[i].checked = true; | |||||
} | |||||
} | |||||
function NoneSel(){ | |||||
for(i=0;i<document.form1.aids.length;i++){ | |||||
document.form1.aids[i].checked = false; | |||||
} | |||||
} | |||||
function DelSel(){ | |||||
var nid = getCheckboxItem(); | |||||
if(nid==""){ | |||||
alert("请选择项目!\r\n"); | |||||
return ; | |||||
} | |||||
location.href = "archives_do.php?dopost=delUploads&ids="+nid; | |||||
} | |||||
</script> | |||||
</head> | |||||
<body> | |||||
<div id="main"> | |||||
<?php include(DEDEMEMBER."/templets/head.htm"); ?> | |||||
<div id="content" class="w960 clearfix"> | |||||
<?php include(DEDEMEMBER."/templets/menu.php");?> | |||||
<div id="mcpmain"> | |||||
<div id="appTab"> | |||||
<ul> | |||||
<li class="thisTab"><a href="uploads.php">附件管理</a></li> | |||||
</ul> | |||||
<div class="tabOther"> | |||||
<form name='forms' method='post' action='uploads_select.php'> | |||||
<input name="keyword" type="text" id="keyword" class="text" value="<?php echo $keyword?>" /> | |||||
<select name='mediatype'> | |||||
<option value='0'>文件类型</option> | |||||
<option value='1'<?php if($mediatype==1) echo " selected='1' "; ?>>图片</option> | |||||
<option value='2'<?php if($mediatype==2) echo " selected='1' "; ?>>FLASH</option> | |||||
<option value='3'<?php if($mediatype==3) echo " selected='1' "; ?>>视频/音频</option> | |||||
<option value='4'<?php if($mediatype==4) echo " selected='1' "; ?>>其它附件</option> | |||||
</select> | |||||
<button class="button2 mL10" type="submit">搜索</button> | |||||
</form> | |||||
</div> | |||||
</div> | |||||
<div id="mainCp"> | |||||
<h3 class="meTitle">附件数据管理</h3> | |||||
<form name="form1"> | |||||
<div class="postForm"> | |||||
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="list"> | |||||
<thead> | |||||
<tr> | |||||
<th width="5%"><input name="checkedClick" type="checkbox" value="" id="checkedClick"/></th> | |||||
<th>文件标题</th> | |||||
<th width="8%">大小 </th> | |||||
<th width="10%">类型 </th> | |||||
<th width="18%">上传时间 </th> | |||||
<th width="12%">操作</th> | |||||
</tr> | |||||
</thead> | |||||
<tbody> | |||||
{dede:datalist} | |||||
<tr> | |||||
<td><input type='checkbox' name='aids' id='aids<?php echo $fields['aid']?>' value='<?php echo $fields['aid']; ?>' class='np' style="width: 31px;"/></td> | |||||
<td valign="middle"><a href='<?php echo $fields['url']?>' target='_blank'><?php echo GetImageView($fields['url'],$fields['mediatype']); ?> <?php echo $fields['title']; ?> </a></td> | |||||
<td align="center"><?php echo GetFileSize($fields['filesize']); ?></td> | |||||
<td align="center"><?php echo MediaType($fields['mediatype'],$fields['url']); ?></td> | |||||
<td align="center"><?php echo MyDate("Y-m-d H:i",$fields['uptime']); ?></td> | |||||
<td align="center"><a href='uploads_edit.php?aid=<?php echo $fields['aid']; ?>'>更改</a> | <a href='archives_do.php?dopost=delUploads&aid=<?php echo $fields['aid']; ?>'>删除</a> </td> | |||||
</tr> | |||||
{/dede:datalist} | |||||
</tbody> | |||||
<tfoot> | |||||
<tr> | |||||
<td colspan="5"><button class="buttonGary2 mt10" onclick="DelSel();">删除</button> | |||||
<div class="pageList">{dede:pagelist listsize=10/}</div> | |||||
</td> | |||||
</tr> | |||||
</tfoot> | |||||
</table> | |||||
</div> | |||||
</form> | |||||
<!--主操作区域 --> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<?php include(DEDEMEMBER."/templets/foot.htm"); ?> | |||||
</div> | |||||
</body> | |||||
</html> |
@@ -1,77 +0,0 @@ | |||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |||||
<html xmlns="http://www.w3.org/1999/xhtml"> | |||||
<head> | |||||
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $cfg_soft_lang; ?>" /> | |||||
<title>上传附件 - 会员中心 - <?php echo $cfg_webname; ?></title> | |||||
<link href="templets/style/base.css" rel="stylesheet" type="text/css" /> | |||||
<script language="javascript"> | |||||
<!-- | |||||
function checkSubmit() | |||||
{ | |||||
if(document.form1.title.value=='') { | |||||
alert("标题不能为空!"); | |||||
document.form1.title.focus(); | |||||
return false; | |||||
} | |||||
} | |||||
--> | |||||
</script> | |||||
</head> | |||||
<body> | |||||
<form name="form1" action="uploads_add.php" method="post" enctype="multipart/form-data" onsubmit="return checkSubmit();"> | |||||
<input type="hidden" name="f" value="<?php echo $f; ?>" /> | |||||
<input type="hidden" name="mediatype" value="<?php echo $mediatype; ?>" /> | |||||
<input type="hidden" name="keyword" value="<?php echo $keyword; ?>" /> | |||||
<input type="hidden" name="dopost" value="save" /> | |||||
<table cellspacing="1" class="submit"> | |||||
<thead> | |||||
<tr> | |||||
<th colspan="2" >上传附件</th> | |||||
</tr> | |||||
</thead> | |||||
<tbody> | |||||
<tr> | |||||
<td width="21%" align="right" valign="top">允许的类型:</td> | |||||
<td width="79%"><?php | |||||
if($mediatype==1){ | |||||
echo $cfg_imgtype; | |||||
} | |||||
else if($mediatype==2){ | |||||
echo "swf"; | |||||
} | |||||
else if($mediatype==3){ | |||||
echo $cfg_mediatype; | |||||
} | |||||
else{ | |||||
echo $cfg_mb_addontype; | |||||
} | |||||
?></td> | |||||
</tr> | |||||
<tr> | |||||
<td align="right" valign="top">注释标题:</td> | |||||
<td><input name="title" type="text" id="title" size="30" class="text" value="" /></td> | |||||
</tr> | |||||
<tr> | |||||
<td align="right" valign="top">选择文件:</td> | |||||
<td><input name="addonfile" type="file" id="addonfile" style="width:300px" <?php if($mediatype==1) echo " onChange=\"SeePicNew('divpicview',this);\" "; ?> /></td> | |||||
</tr> | |||||
<?php if($mediatype==1) { ?> | |||||
<tr> | |||||
<td align="right" valign="top">预览区:</td> | |||||
<td><div id='divpicview' class='divpre'></div></td> | |||||
</tr> | |||||
<?php } ?> | |||||
</tbody> | |||||
<tfoot> | |||||
<tr> | |||||
<td height="45"> </td> | |||||
<td height="45"><button class="button2" type="submit" >提交</button></td> | |||||
</tr> | |||||
</tfoot> | |||||
</table> | |||||
</form> | |||||
</body> | |||||
</html> |
@@ -1,124 +0,0 @@ | |||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |||||
<html xmlns="http://www.w3.org/1999/xhtml"> | |||||
<head> | |||||
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $cfg_soft_lang; ?>" /> | |||||
<title>修改附件 - 会员中心 - <?php echo $cfg_webname; ?></title> | |||||
<link href="templets/style/base.css" rel="stylesheet" type="text/css" /> | |||||
<script type="text/javascript" src="../static/js/jquery.js"></script> | |||||
<script type="text/javascript" language='javascript' src='templets/js/main.js'></script> | |||||
<script type="text/javascript" src="templets/js/load.js"></script> | |||||
<script type="text/javascript" src="templets/js/leftmenu.js"></script> | |||||
<script type="text/javascript"> | |||||
function checkSubmit() | |||||
{ | |||||
if(document.form1.title.value=='') | |||||
{ | |||||
alert('标题不能为空!'); | |||||
document.form1.title.focus(); | |||||
return false; | |||||
} | |||||
if(document.form1.vdcode.value=='') | |||||
{ | |||||
document.form1.vdcode.focus(); | |||||
alert('验证码不能为空!'); | |||||
return false; | |||||
} | |||||
} | |||||
</script> | |||||
</head> | |||||
<body> | |||||
<div id="main"> | |||||
<?php include(DEDEMEMBER."/templets/head.htm"); ?> | |||||
<div id="content" class="w960 clearfix"> | |||||
<?php include(DEDEMEMBER."/templets/menu.php"); ?> | |||||
<div id="mcpmain"> | |||||
<div id="appTab"> | |||||
<ul> | |||||
<li class="thisTab"><a href="uploads.php">附件管理</a></li> | |||||
</ul> | |||||
</div> | |||||
<form name="form1" action="uploads_edit.php" method="post" enctype="multipart/form-data" onsubmit="return checkSubmit();"> | |||||
<input type="hidden" name="aid" value="<?php echo $aid; ?>" /> | |||||
<input type="hidden" name="mediatype" value="<?php echo $arow['mediatype']; ?>" /> | |||||
<input type="hidden" name="oldurl" value="<?php echo $arow['url']; ?>" /> | |||||
<input type="hidden" name="dopost" value="save" /> | |||||
<div id="mainCp"> | |||||
<h3 class="meTitle"><strong>修改附件</strong></h3> | |||||
<div class="postForm"> | |||||
<p class="cellBg"> | |||||
<label>允许的类型:</label> | |||||
<?php | |||||
if($arow['mediatype']==1){ | |||||
echo $cfg_imgtype; | |||||
} | |||||
else if($arow['mediatype']==2){ | |||||
echo "swf"; | |||||
} | |||||
else if($arow['mediatype']==3){ | |||||
echo $cfg_mediatype; | |||||
} | |||||
else{ | |||||
echo $cfg_mb_addontype; | |||||
} | |||||
?> | |||||
</p> | |||||
<p> | |||||
<label>注释标题:</label> | |||||
<input name="title" type="text" id="title" value="<?php echo $arow['title']?>" class="intxt"/> | |||||
</p> | |||||
<?php | |||||
if($arow['mediatype']==1){ | |||||
?> | |||||
<p class="cellBg"> | |||||
<label>更换图片:</label> | |||||
<input name="addonfile" type="file" id="addonfile" style="width:300px" <?php if($arow['mediatype']==1) echo " onChange=\"SeePicNew('divpicview',this);\" "; ?> /> | |||||
</p> | |||||
<p> | |||||
<label>预览区:</label> | |||||
<?php | |||||
$furl = $arow['url']; | |||||
$w = 150; | |||||
if($furl!="" && file_exists($cfg_basedir.$furl)) | |||||
{ | |||||
$info = ""; | |||||
$datas = GetImageSize($cfg_basedir.$furl,$info); | |||||
if($datas[0]>500) | |||||
{ | |||||
$w = 500; | |||||
} | |||||
else | |||||
{ | |||||
$w = $datas[0]; | |||||
} | |||||
} | |||||
else | |||||
{ | |||||
$furl = "images/pview.gif"; | |||||
} | |||||
$furl = $furl."?".time(); | |||||
?> | |||||
<div id='divpicview' class='divpre'></div> | |||||
<a href="<?php echo $furl?>" target="_blank"><img src="<?php echo $furl; ?>" id="picview" width="<?php echo $w?>" border="0" /></a> | |||||
</p> | |||||
<?php | |||||
}else{ | |||||
?> | |||||
<p class="cellBg"> | |||||
<label>更换附件:</label> | |||||
<input name="addonfile" type="file" id="addonfile" style="width:300px" /> | |||||
</p> | |||||
<?php | |||||
} | |||||
?> | |||||
<p> | |||||
<button class="button2" type="submit" >更改</button> | |||||
</p> | |||||
</div> | |||||
</div> | |||||
</form> | |||||
</div> | |||||
</div> | |||||
<?php include(DEDEMEMBER."/templets/foot.htm"); ?> | |||||
</div> | |||||
</body> | |||||
</html> |
@@ -1,88 +0,0 @@ | |||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |||||
<html xmlns="http://www.w3.org/1999/xhtml"> | |||||
<head> | |||||
<title>浏览我的附件 - 会员中心 - <?php echo $cfg_webname; ?></title> | |||||
<?php include(DEDEMEMBER."/templets/head_inc.htm"); ?> | |||||
<link href="templets/style/base.css" rel="stylesheet" type="text/css" /> | |||||
<script type="text/javascript" language="javascript"> | |||||
var fname = '<?php echo $f; ?>'; | |||||
var mediatype = '<?php echo $mediatype; ?>'; | |||||
var keyword = '<?php echo $keyword; ?>'; | |||||
function addNew() | |||||
{ | |||||
location = "uploads_add.php?f="+fname+"&mediatype="+mediatype+"&keyword="+keyword; | |||||
} | |||||
function selOK(surl) | |||||
{ | |||||
window.opener.document.<?php echo $f; ?>.value=surl; | |||||
if(document.all) window.opener=true; | |||||
window.close(); | |||||
} | |||||
</script> | |||||
</head> | |||||
<body> | |||||
<table width="96%" style="margin-top:20px;" align="center"> | |||||
<tr> | |||||
<td> | |||||
<form name='forms' method='post' action='uploads_select.php'> | |||||
<input type="hidden" name="f" value="<?php echo $f; ?>" /> | |||||
<input type="hidden" name="mediatype" value="<?php echo $mediatype; ?>" /> | |||||
<input type="hidden" name="keyword" value="<?php echo $keyword; ?>" /> | |||||
<input name="keyword" type="text" id="keyword" class="intxt" style="width:200px;" value="<?php echo $keyword?>" /> | |||||
<select name='mediatype'> | |||||
<option value='0'>文件类型</option> | |||||
<option value='1'<?php if($mediatype==1) echo " selected='1' "; ?>>图片</option> | |||||
<option value='2'<?php if($mediatype==2) echo " selected='1' "; ?>>FLASH</option> | |||||
<option value='3'<?php if($mediatype==3) echo " selected='1' "; ?>>视频/音频</option> | |||||
<option value='4'<?php if($mediatype==4) echo " selected='1' "; ?>>其它附件</option> | |||||
</select> | |||||
<button class="button2 ml10" type="submit">搜索</button> | |||||
</form></td> | |||||
<td style="text-align:right;"><button class="buttonGary5 mR10" type="button" onclick="addNew();">上传新文件</button></td> | |||||
</tr> | |||||
</table> | |||||
<form name="form1" class="mTB10"> | |||||
<table cellspacing="1" class="list" width="96%" align="center"> | |||||
<thead> | |||||
<tr> | |||||
<th align="left" width="35" align="cener"><input name="checkedClick" type="checkbox" value="" id="checkedClick"></th> | |||||
<th>文件标题</th> | |||||
<th width="10%">大小 </th> | |||||
<th width="10%">类型 </th> | |||||
<th width="15%">上传时间 </th> | |||||
</tr> | |||||
</thead> | |||||
<tbody> | |||||
{dede:datalist} | |||||
<tr> | |||||
<td width="35" align="cener"><input type='checkbox' name='aids' id='aids<?php echo $fields['aid']?>' value="<?php echo $fields['url']; ?>" onclick="selOK('<?php echo $fields['url']; ?>');" /></td> | |||||
<td><?php | |||||
$color = ''; | |||||
if($filename==$fields['url']) $color=" style='color:red' "; | |||||
?> | |||||
<a href="#" onclick="selOK('<?php echo $fields['url']; ?>');" <?php echo $color; ?>> <?php echo GetImageView($fields['url'],$fields['mediatype']); ?> <?php echo $fields['title']; ?> </a> </td> | |||||
<td align="center"><?php echo GetFileSize($fields['filesize']); ?></td> | |||||
<td align="center"><?php echo MediaType($fields['mediatype'],$fields['url']); ?></td> | |||||
<td align="center"><?php echo MyDate("Y-m-d",$fields['uptime']); ?></td> | |||||
</tr> | |||||
{/dede:datalist} | |||||
</tbody> | |||||
<tfoot> | |||||
<tr> | |||||
<td colspan="6"><div> | |||||
<div class="fLeft"> | |||||
<button class="buttonGary5 mt10" type="button" onclick="addNew();">上传新文件</button> | |||||
</div> | |||||
<div class="pages fRight mt10">{dede:pagelist listsize=5/}</div> | |||||
</div></td> | |||||
</tr> | |||||
</tfoot> | |||||
</table> | |||||
</form> | |||||
</body> | |||||
</html> |
@@ -1,64 +0,0 @@ | |||||
<?php | |||||
/** | |||||
* 上传 | |||||
* | |||||
* @version $Id: uploads.php 1 8:38 2010年7月9日Z tianya $ | |||||
* @package DedeCMS.Member | |||||
* @copyright Copyright (c) 2007 - 2020, 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 />"; | |||||
} | |||||
} |
@@ -1,52 +0,0 @@ | |||||
<?php | |||||
/** | |||||
* 增加附件 | |||||
* | |||||
* @version $Id: uploads_add.php 1 8:38 2010年7月9日Z tianya $ | |||||
* @package DedeCMS.Member | |||||
* @copyright Copyright (c) 2007 - 2020, DesDev, Inc. | |||||
* @license http://help.dedecms.com/usersguide/license.html | |||||
* @link http://www.dedecms.com | |||||
*/ | |||||
require_once(dirname(__FILE__).'/config.php'); | |||||
CheckRank(0,0,FALSE); | |||||
require_once(DEDEMEMBER.'/inc/inc_archives_functions.php'); | |||||
if(empty($dopost)) $dopost = ''; | |||||
if(empty($mediatype)) $mediatype = 1; | |||||
$menutype = 'content'; | |||||
if($dopost=='') | |||||
{ | |||||
include(DEDEMEMBER."/templets/uploads_add.htm"); | |||||
} | |||||
else if($dopost=='save') | |||||
{ | |||||
$cfg_ml->CheckUserSpace(); | |||||
if($mediatype==1) | |||||
{ | |||||
$utype = 'image'; | |||||
} | |||||
else if($mediatype==2) | |||||
{ | |||||
$utype = 'flash'; | |||||
} | |||||
else if($mediatype==3) | |||||
{ | |||||
$utype = 'media'; | |||||
} | |||||
else | |||||
{ | |||||
$utype = 'addon'; | |||||
} | |||||
$title = HtmlReplace($title,2); | |||||
$filename = MemberUploads('addonfile','',$cfg_ml->M_ID,$utype,'',-1,-1,true); | |||||
SaveUploadInfo($title,$filename,$mediatype); | |||||
$bkurl = "uploads_select.php?f=".$f."&mediatype=".$mediatype."&keyword=".urlencode($keyword)."&filename=".$filename; | |||||
if($filename=='') | |||||
{ | |||||
ShowMsg("上传文件失败!","-1"); | |||||
} | |||||
else | |||||
{ | |||||
ShowMsg("成功上传一个文件!",$bkurl); | |||||
} | |||||
} |
@@ -1,56 +0,0 @@ | |||||
<?php | |||||
/** | |||||
* 编辑附件 | |||||
* | |||||
* @version $Id: uploads_edit.php 1 8:38 2010年7月9日Z tianya $ | |||||
* @package DedeCMS.Member | |||||
* @copyright Copyright (c) 2007 - 2020, 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(DEDEMEMBER.'/inc/inc_archives_functions.php'); | |||||
$menutype = 'content'; | |||||
$aid = isset($aid) && is_numeric($aid) ? $aid : 0; | |||||
if(empty($dopost)) $dopost = ''; | |||||
if($dopost=='') | |||||
{ | |||||
$arow = $dsql->GetOne("SELECT * FROM `#@__uploads` WHERE aid='$aid ';"); | |||||
if(!is_array($arow)) | |||||
{ | |||||
ShowMsg('附件不存在', '-1'); | |||||
exit(); | |||||
} | |||||
if($arow['mid'] != $cfg_ml->M_ID) | |||||
{ | |||||
ShowMsg("你没有修改这个附件的权限!","-1"); | |||||
exit(); | |||||
} | |||||
include(DEDEMEMBER."/templets/uploads_edit.htm"); | |||||
exit(); | |||||
} | |||||
else if($dopost=='save') | |||||
{ | |||||
$title = HtmlReplace($title,2); | |||||
if($mediatype==1) $utype = 'image'; | |||||
else if($mediatype==2) | |||||
{ | |||||
$utype = 'flash'; | |||||
} | |||||
else if($mediatype==3) | |||||
{ | |||||
$utype = 'media'; | |||||
} | |||||
else | |||||
{ | |||||
$utype = 'addon'; | |||||
} | |||||
$title = HtmlReplace($title, 2); | |||||
$oldurl = HtmlReplace($oldurl); | |||||
$exname = preg_replace("#(.*)/#", "", $oldurl); | |||||
$exname = preg_replace("#\.(.*)$#", "", $exname); | |||||
$filename = MemberUploads('addonfile', $oldurl, $cfg_ml->M_ID, $utype,$exname, -1, -1, TRUE); | |||||
SaveUploadInfo($title, $filename, $mediatype); | |||||
ShowMsg("成功修改文件!", "uploads_edit.php?aid=$aid"); | |||||
} |
@@ -1,73 +0,0 @@ | |||||
<?php | |||||
/** | |||||
* 附件选择 | |||||
* | |||||
* @version $Id: uploads_select.php 1 8:38 2010年7月9日Z tianya $ | |||||
* @package DedeCMS.Member | |||||
* @copyright Copyright (c) 2007 - 2020, DesDev, Inc. | |||||
* @license http://help.dedecms.com/usersguide/license.html | |||||
* @link http://www.dedecms.com | |||||
*/ | |||||
require_once(dirname(__FILE__)."/config.php"); | |||||
CheckRank(0,0,FALSE); | |||||
require_once(DEDEINC."/datalistcp.class.php"); | |||||
setcookie("ENV_GOBACK_URL",$dedeNowurl,time()+3600,"/"); | |||||
$menutype = 'content'; | |||||
if(empty($filename)) $filename = ''; | |||||
$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->SetParameter("f",$f); | |||||
$dlist->SetTemplate(DEDEMEMBER."/templets/uploads_select.htm"); | |||||
$dlist->SetSource($sql); | |||||
$dlist->Display(); | |||||
/** | |||||
* 附件类型 | |||||
* | |||||
* @access public | |||||
* @param int $tid 类型ID | |||||
* @param string $nurl | |||||
* @return string | |||||
*/ | |||||
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 src='$furl' border='0' /><br />"; | |||||
} | |||||
} |
@@ -24,5 +24,5 @@ CKEDITOR.editorConfig = function( config ) { | |||||
config.removeButtons = 'About,ShowBlocks,Iframe,Flash,Form,Checkbox,Radio,TextField,Textarea,Select,Button,ImageButton,HiddenField'; | config.removeButtons = 'About,ShowBlocks,Iframe,Flash,Form,Checkbox,Radio,TextField,Textarea,Select,Button,ImageButton,HiddenField'; | ||||
config.filebrowserImageUploadUrl = "./dialog/select_images_post.php"; | |||||
// config.filebrowserImageUploadUrl = "./dialog/select_images_post.php"; | |||||
}; | }; |