发新话题
打印

代码高亮测试帖子

代码高亮测试帖子

The html code:
<!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=utf-8" />  
<title>FleaPHP - 为日趋复杂的 Web 应用提供基础架构平台</title>  
<link href="Stuff/css/css.css" rel="stylesheet" type="text/css" />  
</head>  
<body>  
.............   
</body>  
</html>  

The sql code:
ALTER TABLE `cdb_products` ADD `catalog_nav` VARCHAR( 600 ) NOT NULL COMMENT '分类导航' AFTER `catalog_path` ;
INSERT INTO temp_products(uid, catalog_id, country_code, product_name, product_brand, product_spec, product_area, product_tag, product_desc, product_pic, product_price, product_unit, product_payment, product_currency, product_minnum, elitetype, product_time, product_hit, ischeck, membertype) SELECT p.uid, p.catalog_id, p.country_code, p.product_name, p.product_brand, p.product_spec, p.product_area, p.product_tag, p.product_desc, p.product_pic, p.product_price, p.product_unit, p.product_payment, p.product_currency, p.product_minnum, p.elitetype, p.product_time, p.product_hit, p.ischeck, p.membertype FROM `cdb_products` p, cdb_users u WHERE p.uid = u.uid AND p.product_pic IS NOT NULL AND  (RIGHT(p.product_pic,4)='.jpg' OR  RIGHT(p.product_pic,4)='.gif' OR RIGHT(p.product_pic,4)='.bmp' OR RIGHT(p.product_pic,4)='.png') ORDER BY p.uid ASC

The php code:
function getByteUnit($size){
	if ($size >= 1073741824)
		$str = round($size / 1073741824 * 100) / 100 . ' GB';
	elseif ($size >= 1048576)
		$str = round($size / 1048576 * 100) / 100 . ' MB';
	elseif ($size >= 1024)
		$str = round($size / 1024 * 100) / 100 . ' KB';
	elseif ($size > 0)
		$str = $size . ' Byte';
	else
		$str = '-';
	return $str;
}

function dhtmlspecialchars($string) {
	if(is_array($string)) {
		foreach($string as $key => $val) {
			$string[$key] = dhtmlspecialchars($val);
		}
	} else {
		$string = preg_replace('/&((#(\d{3,5}|x[a-fA-F0-9]{4})|[a-zA-Z][a-z0-9]{2,5});)/', '&\\1',
		str_replace(array('&', "'", '"', '<', '>'), array('&', ''', '"', '&lt;', '&gt;'), $string));
	}
	return $string;
}

function mkdirs($dir, $mode = 0777){
	if (!is_dir($dir)) {
			mkdirs(@dirname($dir), $mode);
			return @mkdir($dir, $mode);
	}
	return true;
}

The javascript code:
<script>
	$(document).ready(function() {
		$("#chkall").click(function () {
			var checkall  = $(this).attr('name');
			var ischecked = $(this).attr('checked');
			ischecked     = ischecked == true ? true : false;
			$("input[@type='checkbox']").each(function() {   
					$(this).attr("checked", ischecked);   
			});
		});

		$("input[@type='checkbox']").each(function() {
				if($(this).attr('name') !== 'chkall'){
					$(this).click(function () {
						var ischecked = $("#chkall").attr('checked');
						ischecked     = ischecked == true ? true : false;
						if(ischecked){
							$("#chkall").attr('checked', ischecked&0);
						} 
					});
				}
		});

		$("#changesubmit").click(function () {
			$('form[@id="product_form"]').attr('action', '<?=url('Products','ProductSaveChange')?>');
			$('form[@id="product_form"]').submit();
		});
		
		$("#removesubmit").click(function () {
			if(confirm('您确定要删除所选产品吗?')){
				$('form[@id="product_form"]').attr('action', '<?=url('Products','ProductRemoveAll')?>');
				$('form[@id="product_form"]').submit();
			}
		});

	});
</script>

The css code:
.dp-highlighter{font-family:"consolas","courier new",courier,mono,serif; font-size:12px; background-color:#f1f8fe; width:100%; overflow:auto; margin:0; padding-top:1px;}
.dp-highlighter ol, .dp-highlighter ol li, .dp-highlighter ol li span{margin:0; padding:0; border:none;}
.dp-highlighter a, .dp-highlighter a:hover{background:none; border:none; padding:0; margin:0;}
.dp-highlighter .bar{padding-left:45px;}
.dp-highlighter.collapsed .bar, .dp-highlighter.nogutter .bar{padding-left:0px;}
.dp-highlighter ol{list-style:decimal; background-color:#fff; margin:0px 0px 1px 45px !important; padding:0px; color:#5C5C5C;}
.dp-highlighter.nogutter ol, .dp-highlighter.nogutter ol li{list-style:none !important; margin-left:0px !important;}
.dp-highlighter ol li, .dp-highlighter .columns div{list-style:decimal-leading-zero; list-style-position:outside !important; border-left:3px solid #CAD9EA; background-color:#F8F8F8; color:#5C5C5C; padding:0 3px 0 10px !important; margin:0 !important; line-height:16px;}
.dp-highlighter.nogutter ol li, .dp-highlighter.nogutter .columns div{border:0;}
.dp-highlighter .columns{background-color:#F8F8F8; color:gray; overflow:hidden; width:100%;}
.dp-highlighter .columns div{padding-bottom:5px;}
.dp-highlighter ol li.alt{background-color:#FFF; color:inherit;}
.dp-highlighter ol li span{color:black; background-color:inherit;}
.dp-highlighter.collapsed ol{margin:0px;}
.dp-highlighter.collapsed ol li{display:none;}
.dp-highlighter.printing{border:none;}
.dp-highlighter.printing .tools{display:none !important;}
.dp-highlighter.printing li{display:list-item !important;}
.dp-highlighter .tools{padding:3px 8px 3px 10px; font:9px Verdana,Geneva,Arial,Helvetica,sans-serif; color:silver; background-color:#f8f8f8; padding-bottom:10px; border-left:3px solid #CAD9EA;}
.dp-highlighter.nogutter .tools{border-left:0;}
.dp-highlighter.collapsed .tools{border-bottom:0;}
.dp-highlighter .tools a{font-size:12px; color:#a0a0a0; background-color:inherit; text-decoration:none; margin-right:10px;}
.dp-highlighter .tools a:hover{color:red; background-color:inherit; text-decoration:underline;}
.dp-about{background-color:#fff; color:#333; margin:0px; padding:0px;}
.dp-about table{width:100%; height:100%; font-size:12px; font-family:Tahoma,Verdana,Arial,sans-serif !important;}
.dp-about td{padding:10px; vertical-align:top;}
.dp-about .copy{border-bottom:1px solid #ACA899; height:95%;}
.dp-about .title{color:red; background-color:inherit; font-weight:bold;}
.dp-about .para{margin:0 0 4px 0;}
.dp-about .footer{background-color:#ECEADB; color:#333; border-top:1px solid #fff; text-align:right;}
.dp-about .close{font-size:12px; font-family:Tahoma,Verdana,Arial,sans-serif !important; background-color:#ECEADB; color:#333; width:60px; height:22px;}
.dp-highlighter .comment,.dp-highlighter .comments{color:#008200; background-color:inherit;}
.dp-highlighter .string{color:blue; background-color:inherit;}
.dp-highlighter .keyword{color:#069; font-weight:bold; background-color:inherit;}
.dp-highlighter .preprocessor{color:gray; background-color:inherit;}

空间出租:P4 3.0+1G+RIAD 1 160G+PHP+IIS+MYSQL+MDaemon

QQ:126682182
Email:hhyisw@163.com
Home:http://www.stksky.com

TOP

发新话题