那么美好,小小的遗憾

2017-7-4 冷风 青春祭

点击查看原图

阅读全文>>

标签: 图说 我们的婚礼 草坪

评论(3) 浏览(1411)

有时,我们竟忘了生活!

2016-11-22 冷风 青春祭

清晨之美

阅读全文>>

标签: 图说 生活

评论(2) 浏览(1948)

荒草丛生

2016-10-21 冷风 青春祭

许久未更,这里已荒草丛生。

我心依在,忙碌生活的忙碌。

标签: 杂草

评论(0) 浏览(1628)

树状展示代码

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)

网页点击全屏

2016-8-2 冷风 奇趣实用

html代码,点击全屏显示

阅读全文>>

标签: 代码 全屏

评论(0) 浏览(1215)

热力图制作更新记录

2016-4-28 冷风 本站新闻

2016年04月28日,上线。

          05月06日,增加板块名称是否显示。

          05月19日,删除列表中填写名字的要求,简化后,仅需填写经纬度坐标、数值。

          07月28日,增加“设置最大值”项,可以自定义热力图显示最大值。

去这个页面

标签: 地图 热力图

评论(1) 浏览(1376)

基于上海145板块搜索标注更新记录

2016-4-27 冷风 本站新闻

2016年3月,上线,建议使用谷歌浏览器。

2016年3月,标注后右键可删除。

2016年4月27日,实现画面全屏;当自动标注出现位置偏差时,标注可以自由挪动了。



去这个页面

标签: 标注 121板块 更新记录

评论(0) 浏览(1067)

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