内容详细页面的展示
html文件
本文件引入的js和css的下载地址:下载地址(不要积分)
housing文件:
<!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>商写房源,新闻动态详细页面</title>
<link href="__PUBLIC__/css/css3.css" type="text/css" rel="stylesheet">
<SCRIPT src="__PUBLIC__/js/jquery-1.2.6.pack.js" type=text/javascript></SCRIPT>
<SCRIPT src="__PUBLIC__/js/base.js" type=text/javascript></SCRIPT>
<link href="__PUBLIC__/css/housing.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="box">
<include file="../../../Public/top"/>
<!--top-->
<div id="banner"></div><!--banner-->
<div id="main">
<div id="main_left">
<div id="left_biaoti"><h2>商写房源</h2></div>
<div id="left_libiao">
<ul>
<li><a href="__URL__/house?id=1" >店铺出租</a></li>
<li><a href="__URL__/house?id=2">办公选址</a></li>
<li><a href="__URL__/house?id=3">商体出售</a></li>
<li><a href="__URL__/house?id=4">整体项目</a></li>
</ul>
</div>
<include file="../../../Public/left"/>
<div class="main_left_foot"></div><!--left_foot-->
</div><!--main_left-->
<div id="main_right">
<div id="right_lt">
<div class=jqzoom id=spec-n1 >
<volist name="xiangxi1" id="vo">
<IMG height=350
src="../uploadfile/pic/big/{$vo.photos_pic}" jqimg="../uploadfile/pic/big/{$vo.photos_pic}" >
</volist>
</div>
<div id=spec-n5>
<!--<div class=control id=spec-left>
<img src="__PUBLIC__/images/left.gif" />
</div>-->
<div id=spec-list>
<ul class=list-h>
<volist name="xiangxi" id="vo">
<li>
<IMG height=350
src="../uploadfile/pic/big/{$vo.photos_pic}" >
</li></volist>
</ul>
</div>
<!--<div class=control id=spec-right>
<img src="__PUBLIC__/images/right.gif" />
</div>-->
</div>
<SCRIPT type=text/javascript>
$(function(){
$(".jqzoom").jqueryzoom({
xzoom:320,
yzoom:300,
offset:10,
position:"right",
preload:1,
lens:1
});
$("#spec-list").jdMarquee({
deriction:"left",
width:600,
height:86,
step:2,
speed:4,
delay:10,
control:true,
_front:"#spec-right",
_back:"#spec-left"
});
$("#spec-list img").bind("mouseover",function(){
var src=$(this).attr("src");
$("#spec-n1 img").eq(0).attr({
src:src.replace("\/n5\/","\/n1\/"),
jqimg:src.replace("\/n5\/","\/n0\/")
});
$(this).css({
"padding":"1px"
});
}).bind("mouseout",function(){
$(this).css({
"padding":"2px"
});
});
})
</SCRIPT>
<SCRIPT src="__PUBLIC__/js/lib.js" type=text/javascript></SCRIPT>
<SCRIPT src="__PUBLIC__/js/163css.js" type=text/javascript></SCRIPT>
<div id="lt5">
<empty name="front">
<p><span style=" font-weight:bold; font-size:14px;">上一篇:</span> 已经是第一页了</p>
<else />
<p><span style=" font-weight:bold; font-size:14px;">上一篇:</span> <a href="__URL__/housing?id={$front.products_id}" >{$front.products_name}</a></p>
</empty>
<empty name="after">
<p><span style=" font-weight:bold; font-size:14px;">下一篇:</span> 已经是最后一页了</p>
<else />
<p><span style=" font-weight:bold; font-size:14px;">下一篇:</span> <a href="__URL__/housing?id={$after.products_id}" >{$after.products_name}</a></p>
</empty>
</div>
</div><!--right_lt-->
</div>
<volist name="list" id="vo">
<div id="right_rg">
<div id="rg1">
<h2>{$vo.products_name}</h2>
<p><span>发布时间:</span>{$vo.products_uptime}</p>
<p><span>房源类型:</span>{$vo.products_uptime}</p>
<p><span>面积:</span>{$vo.products_inventory}平方米</p>
<p><span>价格:</span>{$vo.products_retail_price}元</p>
<p><span>联系人:</span>{$vo.products_color}</p>
<p><span>联系方式:</span>{$vo.products_weight}</p>
<div id="rg2">
{$vo.products_content}
</div>
</div>
</div><!--right_rg-->
</volist>
</div><!--main_right-->
</div><!--main-->
</div><!--box-->
<!--底部-->
<div id="zhixian">
<div id="blow">
<p style="float:left;"><span> <a href="__URL__/mine" >联系我们</a> | <a href="__URL__/mine" >网站地图</a></span></p>
<p style="float:right;">京ICPBEI备88 88888 88号 版权所有 池铭商业地产有限公司 Copyright 2012 chiming shangye dichan ALL Rights
Reserved</p>
</div><!--blow-->
</div>
<!--底部-->
</body>
</html>
后天代码:
function housing(){
$this->xiangxi3('products',$_GET['id']);
$this->xiangxi1('products_photos',$_GET['id']);
$this->xiangxi('products_photos',$_GET['id']);
$this->xiangxi2('products',$_GET['id']);
$this->aboutli('contactlist');
$user=M("products");
$sel=$user->where("products_id=".$_GET['id']."")->select();
$this->assign("list",$sel);
$this->display();
}
//自己封装的方法
function xiangxi1($chart='',$pid=''){
$user=D($chart);
$list=$user->where("photos_products=".$pid."")->limit('0,1')->select();
//thumbRemoveOrigin
$this->assign("xiangxi1",$list);
}
function xiangxi($chart='',$pid=''){
$user=D($chart);
$list=$user->where("photos_products=".$pid."")->select();
//thumbRemoveOrigin
$this->assign("xiangxi",$list);
}
function xiangxi2($chart='',$pid=''){
$user=D($chart);
$list=$user->where("products_id=".$pid."")->select();
//thumbRemoveOrigin
$this->assign("xiangxi2",$list);
}
function xiangxi3($chart='',$pid=''){
$pro=D($chart);
//上一篇
$front=$pro->where("products_id<'".$pid."'")->order('products_id desc')->limit('0,1')->find();
$this->assign('front',$front);
//下一篇
$after=$pro->where("products_id>'".$pid."'")->order('products_id asc')->limit('0,1')->find();
$this->assign('after',$after);
}