这一年,我们留下了什么?

2013-10-16 冷风 青春祭

 

这一年,我们留下了什么?

阅读全文>>

标签: 原创 黑夜思考

评论(29) 浏览(59398)

夜深人静,回忆的时刻

2013-7-24 冷风 青春祭

      是这夜深人静,回忆的时刻,想想过去看看未来。走过的每一段路,都有那么一群人陪伴在你左右,从陌生人到朋友,最后成为这段旅程的难忘记忆。他们中间有人耿直倔强,有人温和纯厚,有人显得总是那么愤青,而正些人慢慢走入我们的心底。

阅读全文>>

标签: 原创 友情

评论(9) 浏览(111796)

用一颗强大的心去面对现在,挑战未来!

2013-6-8 冷风 青春祭

      每个故事都有不一样的背景,每个角色都有属于他自己的过去和未来,就好比这个社会注定存在不同阶层的人,他们都有着自己的生存之道,都有着属于自己的一生。故事里的每个人物都只能循着自己的轨迹向前,而不能越轨到他人的航道,不仅是不能,更重要的是不适合,所以

阅读全文>>

标签: 原创 图说 强大的心

评论(8) 浏览(93273)

理想很丰满,现实很骨感!

2013-5-4 冷风 社会观察

      有时候、有些人,在现实面前,似乎一切都显得苍白无力。在丁东丽的态度面前,杨中荣的告白是那么的无奈,所以我们看到了杨中荣最后的感谢退场。临走他对丁东丽说,这个舞台给你的时间还很多,你慢慢等吧。听上去似乎有些许的怒气,但更多的是失望、无奈。。。。。。

阅读全文>>

标签: 原创 非诚勿扰 丁东丽 杨中荣

评论(5) 浏览(77703)

周庄,那样清新!

2013-4-17 冷风 青春祭

      这已经是第二次游周庄了,记得上次还是大学的时候。前些日子,借着清明的小假期,再游周庄。与上次不同的是,在周庄过了一夜,不但白天览尽水乡风韵,更能一睹其夜间繁华。

阅读全文>>

标签: 原创 图说 周庄 2013清明

评论(6) 浏览(109970)

来上海,发第一张图^_^

2013-3-26 冷风 青春祭

       有多少人向往上海,有多少人希望能在这个大都市里留下自己的足迹。曾经,我也梦想过上海之旅,没想到当有机会来到上海滩时,不是旅行,而是因为工作。都说像这样的大城市压力大、节奏快,可能会是这样吧。貌似这已经不是第一次来这里,刚大学毕业那会儿,还来这里面试过。

阅读全文>>

标签: 原创 图说 我在上海

评论(11) 浏览(54995)

树状展示代码

2016-9-23 冷风 奇趣实用

来源

标签: 树状

评论(0) 浏览(936)

attachment.php 代码

2016-9-23 冷风 奇趣实用

attachment.php 代码:
//上传表单显示(地产项目)
if ($action == 'selectFile_dcxm') {
	$attachnum = 0;
	$logid = isset($_GET['logid']) ? intval($_GET['logid']) : '';
	$multi = isset($_GET['multi']) ? intval($_GET['multi']) : 0;

	if ($logid) {
        $Log_Model = new Log_Model();
        $row = $Log_Model->getOneLogForAdmin($logid);
		$attachnum = (int)$row['attnum'];
	}
	$maxsize = changeFileSize(Option::getAttMaxSize());
	//允许附件类型
	$att_type_str = '';
    $att_type_for_muti = '';
	foreach (Option::getAttType() as $val) {
		$att_type_str .= " $val";
        $att_type_for_muti .= '*.'.$val.';';
	}
	$view_tpl = $multi ? 'upload_multi_dcxm' : 'upload_dcxm';
	require_once(View::getView($view_tpl));
	View::output();
}

//附件库
if ($action == 'attlib') {
	$logid = isset($_GET['logid']) ? intval($_GET['logid']) : '';
	$dcxm = isset($_GET['dcxm']) ? intval($_GET['dcxm']) : 0;
	$sql = "SELECT * FROM " . DB_PREFIX . "attachment WHERE blogid = $logid AND thumfor = 0";
	$query = $DB->query($sql);
	$attach = array();
	while ($row = $DB->fetch_array($query)) {
		$attsize = changeFileSize($row['filesize']);
		$filename = htmlspecialchars($row['filename']);
		$attach[$row['aid']] = array(
				'attsize'  => $attsize,
				'aid'      => $row['aid'],
				'filepath' => $row['filepath'],
				'filename' => $filename,
				'width'    => $row['width'],
				'height'   => $row['height'],
				'fenlei'   => $row['fenlei'],
		);		
		$thum = $DB->once_fetch_array('SELECT * FROM ' . DB_PREFIX . 'attachment WHERE thumfor = '. $row['aid']);
		if ($thum) {
			$attach[$row['aid']]['thum_filepath']	= $thum['filepath'];
			$attach[$row['aid']]['thum_width']	    = $thum['width'];
			$attach[$row['aid']]['thum_height']  	= $thum['height'];
		}
	}
	$attachnum = count($attach);
	if($dcxm){ include View::getView('attlib_dcxm'); }else{ include View::getView('attlib'); }
	View::output();
}

upload_multi_dcxm.php 和upload_dcxm.php 改成了一样的代码,因为只需要批量上传功能即可,如下:


<?php if(!defined('EMLOG_ROOT')) {exit('error!');} ?>
<!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"  dir="ltr" lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>upload</title>
<link href="./views/css/css-att.css?v=<?php echo Option::EMLOG_VERSION; ?>" type="text/css" rel="stylesheet">
<link href="./views/css/css-uploadify.css?v=<?php echo Option::EMLOG_VERSION; ?>" type="text/css" rel="stylesheet">
<script type="text/javascript" src="../include/lib/js/jquery/jquery-1.7.1.js"></script>
</head>
<body>
<script>
function showupload(multi){
	var as_logid = parent.document.getElementById('as_logid').value
	window.location.href="attachment.php?action=selectFile_dcxm&logid="+as_logid+"&multi="+multi;	
}
function showattlib(){
	var as_logid = parent.document.getElementById('as_logid').value
	window.location.href="attachment.php?action=attlib&dcxm=1&logid="+as_logid;	
}
</script>
<div id="media-upload-header">
	<span id="curtab"><a href="javascript:showupload(1);">上传附件</a></span>
	<span><a href="javascript:showattlib();">附件库(<?php echo $attachnum; ?>)</a></span>
</div>
<?php 
if(true === isIE6Or7()): ?>
<div class="ie_notice">您正在使用的浏览器版本太低,无法使用批量上传功能。为了更好的使用emlog,建议您升级浏览器或者换用其他浏览器。</div>
<?php else:?>
<form enctype="multipart/form-data" method="post" name="upload" action="">
<div id="media-upload-body">
<div id="custom-bt">
<input width="120" type="file" height="30" name="Filedata" id="fenlei1" style="display: none;">
<input width="120" type="file" height="30" name="Filedata" id="fenlei2" style="display: none;">
<input width="120" type="file" height="30" name="Filedata" id="fenlei3" style="display: none;">
<input width="120" type="file" height="30" name="Filedata" id="fenlei4" style="display: none;">
<input width="120" type="file" height="30" name="Filedata" id="fenlei5" style="display: none;">
<input width="120" type="file" height="30" name="Filedata" id="fenlei0" style="display: none;">
</div>
<div id="custom-queue" class="uploadifyQueue"></div>
</div>
</form>
<script type="text/javascript" src="../include/lib/js/uploadify/jquery.uploadify.min.js?v=<?php echo Option::EMLOG_VERSION; ?>"></script>
<script>
$(document).ready(function() {
	$("#fenlei1").uploadify({
		id              : jQuery(this).attr('id'),
		swf             : '../include/lib/js/uploadify/uploadify.swf',
		uploader        : 'attachment.php?action=upload_multi&fenlei=1&logid='+parent.document.getElementById('as_logid').value,
		cancelImage     : './views/images/cancel.png',
		checkExisting   : false,
		buttonText      : '售楼处',
		auto            : true,
		multi           : true,
		buttonCursor    : 'pointer',
		fileTypeExts    : '<?php echo $att_type_for_muti;?>',
		queueID         : 'custom-queue',
		queueSizeLimit	: 100,
		removeCompleted : false,
		fileSizeLimit	: 20971520,
		fileObjName     : 'attach',
		postData		: {<?php echo AUTH_COOKIE_NAME;?>:'<?php echo $_COOKIE[AUTH_COOKIE_NAME];?>'},
		onQueueComplete : function() { showattlib();},
	});
    $("#fenlei2").uploadify({
		id              : jQuery(this).attr('id'),
		swf             : '../include/lib/js/uploadify/uploadify.swf',
		uploader        : 'attachment.php?action=upload_multi&fenlei=2&logid='+parent.document.getElementById('as_logid').value,
		cancelImage     : './views/images/cancel.png',
		checkExisting   : false,
		buttonText      : '示范区',
		auto            : true,
		multi           : true,
		buttonCursor    : 'pointer',
		fileTypeExts    : '<?php echo $att_type_for_muti;?>',
		queueID         : 'custom-queue',
		queueSizeLimit	: 100,
		removeCompleted : false,
		fileSizeLimit	: 20971520,
		fileObjName     : 'attach',
		postData		: {<?php echo AUTH_COOKIE_NAME;?>:'<?php echo $_COOKIE[AUTH_COOKIE_NAME];?>'},
		onQueueComplete : function() { showattlib();},
	});
    $("#fenlei3").uploadify({
		id              : jQuery(this).attr('id'),
		swf             : '../include/lib/js/uploadify/uploadify.swf',
		uploader        : 'attachment.php?action=upload_multi&fenlei=3&logid='+parent.document.getElementById('as_logid').value,
		cancelImage     : './views/images/cancel.png',
		checkExisting   : false,
		buttonText      : '样板间',
		auto            : true,
		multi           : true,
		buttonCursor    : 'pointer',
		fileTypeExts    : '<?php echo $att_type_for_muti;?>',
		queueID         : 'custom-queue',
		queueSizeLimit	: 100,
		removeCompleted : false,
		fileSizeLimit	: 20971520,
		fileObjName     : 'attach',
		postData		: {<?php echo AUTH_COOKIE_NAME;?>:'<?php echo $_COOKIE[AUTH_COOKIE_NAME];?>'},
		onQueueComplete : function() { showattlib();},
	});
    $("#fenlei4").uploadify({
		id              : jQuery(this).attr('id'),
		swf             : '../include/lib/js/uploadify/uploadify.swf',
		uploader        : 'attachment.php?action=upload_multi&fenlei=4&logid='+parent.document.getElementById('as_logid').value,
		cancelImage     : './views/images/cancel.png',
		checkExisting   : false,
		buttonText      : '立面实景',
		auto            : true,
		multi           : true,
		buttonCursor    : 'pointer',
		fileTypeExts    : '<?php echo $att_type_for_muti;?>',
		queueID         : 'custom-queue',
		queueSizeLimit	: 100,
		removeCompleted : false,
		fileSizeLimit	: 20971520,
		fileObjName     : 'attach',
		postData		: {<?php echo AUTH_COOKIE_NAME;?>:'<?php echo $_COOKIE[AUTH_COOKIE_NAME];?>'},
		onQueueComplete : function() { showattlib();},
	});
    $("#fenlei5").uploadify({
		id              : jQuery(this).attr('id'),
		swf             : '../include/lib/js/uploadify/uploadify.swf',
		uploader        : 'attachment.php?action=upload_multi&fenlei=5&logid='+parent.document.getElementById('as_logid').value,
		cancelImage     : './views/images/cancel.png',
		checkExisting   : false,
		buttonText      : '景观实景',
		auto            : true,
		multi           : true,
		buttonCursor    : 'pointer',
		fileTypeExts    : '<?php echo $att_type_for_muti;?>',
		queueID         : 'custom-queue',
		queueSizeLimit	: 100,
		removeCompleted : false,
		fileSizeLimit	: 20971520,
		fileObjName     : 'attach',
		postData		: {<?php echo AUTH_COOKIE_NAME;?>:'<?php echo $_COOKIE[AUTH_COOKIE_NAME];?>'},
		onQueueComplete : function() { showattlib();},
	});
    $("#fenlei0").uploadify({
		id              : jQuery(this).attr('id'),
		swf             : '../include/lib/js/uploadify/uploadify.swf',
		uploader        : 'attachment.php?action=upload_multi&fenlei=0&logid='+parent.document.getElementById('as_logid').value,
		cancelImage     : './views/images/cancel.png',
		checkExisting   : false,
		buttonText      : '其他文件',
		auto            : true,
		multi           : true,
		buttonCursor    : 'pointer',
		fileTypeExts    : '<?php echo $att_type_for_muti;?>',
		queueID         : 'custom-queue',
		queueSizeLimit	: 100,
		removeCompleted : false,
		fileSizeLimit	: 20971520,
		fileObjName     : 'attach',
		postData		: {<?php echo AUTH_COOKIE_NAME;?>:'<?php echo $_COOKIE[AUTH_COOKIE_NAME];?>'},
		onQueueComplete : function() { showattlib();},
	});
});
</script>
<?php endif; ?>
</body>
</html>


attlib_dcxm.php代码如下:


<?php if(!defined('EMLOG_ROOT')) {exit('error!');} ?>
<!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"  dir="ltr" lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>upload</title>
<link href="./views/css/css-att.css?v=<?php echo Option::EMLOG_VERSION; ?>" type=text/css rel=stylesheet>
<script type="text/javascript" src="./views/js/common.js?v=<?php echo Option::EMLOG_VERSION; ?>"></script>
</head>
<script>
function showupload(multi){
	var as_logid = parent.document.getElementById('as_logid').value
	window.location.href="attachment.php?action=selectFile_dcxm&logid="+as_logid+"&multi="+multi;	
}
function showattlib(){
	var as_logid = parent.document.getElementById('as_logid').value
	window.location.href="attachment.php?action=attlib&dcxm=1&logid="+as_logid;	
}
</script>
<body>
<div id="media-upload-header">
	<span><a href="javascript:showupload(1);">上传附件</a></span>
	<span id="curtab"><a href="javascript:showattlib();">附件库(<?php echo $attachnum; ?>)</a></span>
</div>
<div id="media-upload-body">
<?php if(!$attach): ?>
<p id="attmsg">该文章没有附件</p>
<?php else:
foreach($attach as $key=>$value):
	$extension  = strtolower(substr(strrchr($value['filepath'], "."),1));
	$atturl = BLOG_URL.substr($value['filepath'], 3);
	if ($extension == 'zip' || $extension == 'rar'){
		$imgpath = "./views/images/tar.gif";
		$embedlink = "<a href=\"javascript: parent.addattach_file('$atturl', '{$value['filename']}', {$value['aid']});\">插入 </a>";
	} elseif (in_array($extension, array('gif', 'jpg', 'jpeg', 'png', 'bmp'))) {
		$imgpath = $value['filepath'];
		$ed_imgpath = BLOG_URL.substr($imgpath,3);
		$embedlink = "<a href=\"javascript: parent.addattach_img('$atturl', '$ed_imgpath',{$value['aid']}, '{$value['width']}', '{$value['height']}', '{$value['filename']}');\" title=\"插入原图\">原图</a>";
		if (isset($value['thum_filepath'])) {
			$thum_url = BLOG_URL.substr($value['thum_filepath'], 3);
			$embedlink .= " <a href=\"javascript: parent.addattach_img('$atturl', '$thum_url',{$value['aid']}, '{$value['thum_width']}', '{$value['thum_height']}', '{$value['filename']}');\" title=\"插入缩略图\">缩略图</a>";
		}
	} else {
		$imgpath = "./views/images/fnone.gif";
		$embedlink = "<a href=\"javascript: parent.addattach_file('$atturl', '{$value['filename']}($attsize)', {$value['aid']});\">插入 </a>";
	}
?>
	<li id="attlist"><a href="<?php echo $atturl; ?>" target="_blank" title="<?php echo $value['filename']; ?>"><img src="<?php echo $imgpath; ?>" width="90" height="90" border="0" align="absmiddle"/></a>
	<?php if ($value['width'] && $value['height']): ?>
	<br />
	<?php echo $value['width']?>x<?php echo $value['height']?>
	<?php else:?>
	<br />
	<?php echo subString($value['filename'], 0, 6) ?>
	<?php endif;?>
	<br /><a href="javascript: em_confirm(<?php echo $value['aid']; ?>, 'attachment_dcxm', '<?php echo LoginAuth::genToken(); ?>');">删除</a> <?php echo $embedlink; ?>
	<br /><?php
	if($value['fenlei']=='0'){ echo "其他文件";}
	if($value['fenlei']=='1'){ echo "售楼处";}
	if($value['fenlei']=='2'){ echo "示范区";}
	if($value['fenlei']=='3'){ echo "样板间";}
	if($value['fenlei']=='4'){ echo "立面实景";}
	if($value['fenlei']=='5'){ echo "景观实景";}
	?></li>
<?php endforeach; endif; ?>
</div>
</body>
</html>



评论(0) 浏览(1577)

Powered by emlog 鲁ICP备11021102号-1 sitemap 当前在线:1人