<!doctype html>
<html lang="zh_CN">
<!--
<?php
$rsdb[posttime]=date("Y-m-d",$rsdb[posttime]);
$rsdb[content]=En_TruePath($rsdb[content],0,1);
$member_act=$lfjid?"<a href=\"$webdb[_www_url]/member/wapindex.php\">会员中心</a> <a href=\"$webdb[www_url]/do/waplogin.php?action=quit\">退出</a>":"<a href=\"$webdb[_www_url]/do/waplogin.php\">登录</a> <a href=\"$webdb[www_url]/do/wapreg.php\">注册</a> <a href=\"$webdb[_www_url]/do/wx_login.php\">微信登录</a>";
$fromurl = urlencode($WEBURL);
$rsdb[content]=str_replace("width","wiidth",$rsdb[content]);
$rsdb[content]=str_replace("height","heiight",$rsdb[content]);
print <<<EOT
-->
<head>
<meta charset="gb2312" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no" />
<meta name="apple-mobile-web-app-status-bar-style" content="black"  />
<meta name="apple-mobile-web-app-capable" content="yes">
<title>$titleDB[title]</title>
<meta name="keywords" content="$titleDB[keywords]">
<meta name="description" content="$titleDB[description]">
<link rel="stylesheet" type="text/css" href="$webdb[www_url]/images/news/wapbencandy.css">
<SCRIPT LANGUAGE="JavaScript" src="$webdb[www_url]/images/default/inc.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" src="$webdb[www_url]/images/default/default.js"></SCRIPT>
<script type="text/javascript" src="$webdb[www_url]/images/default/jquery-1.2.6.min.js"></script>
</head>
<body>
<div class="HeaerBox">
	<ul class="infos">
		<li class="home"><a href="$webdb[www_url]/wapindex.php"><span>首页</span></a></li>
		<li class="sitename"><a href="?fid=$fid&id=$id"><span>$webdb[webname]</span></a></li>
		<li class="member">
			<span>会员</span>			
		</li>
		<li class="search">
			<span>搜索</span>			
		</li>
		<li class="members">$member_act</li>
		<li class="SearchBox">
			<dl>
			<form action="$webdb[www_url]/waplist.php" method="post" onSubmit="return cksearch();">
				<dt><input class="keyword" type="text" placeholder="请输入关键词" name="keyword" value="$keyword" /></dt>
				<dd><input type="submit" value="搜索" /></dd>
			</form>
			</dl>
		</li>
	</ul>
</div>
<script type="text/javascript">
<!--
function cksearch(){
	if ($('.SearchBox .keyword').val()==''){
		layer.alert("关键字不能为空");
		return false;
	}
}
$('.HeaerBox .member').click(function(){
	if($(".HeaerBox .members").is(":hidden")){
		  $('.HeaerBox .members').fadeIn();
	}else{
		  $('.HeaerBox .members').fadeOut();
	}	
});
$('.HeaerBox .search').click(function(){
	if($(".HeaerBox .SearchBox").is(":hidden")){
		  $('.HeaerBox .SearchBox').fadeIn();
	}else{
		  $('.HeaerBox .SearchBox').fadeOut();
	}	
});
//-->
</script> 
<div class="guideBox">当前位置：$GuideFidStr</div>
<div class="MainContainerBox">
	<div class="title">$rsdb[title]</div>
	<ul class="info">
		<ol>{$rsdb[posttime]}</ol>
        <li>{$rsdb[hits]}浏览</li>
	</ul>
	<!--
EOT;
$listPics="";
$query = $db->query("SELECT imgurl FROM `{$pre}article_pic` WHERE id='$id'");
while($rs = $db->fetch_array($query)){
if($rs[imgurl]){
$rs[imgurl1]=tempdir($rs[imgurl]);
$listPics.="<li><span><img src='$rs[imgurl1]' onError=\"this.src='$webdb[www_url]/images/default/nopic.jpg'\" onClick=\"showAllpics(\$(this))\"/></span></li>\r\n";
}}
if($rsdb[mid]==100){
	foreach($Mrsdb[photourl][url] AS $key=>$url){
		$listPics.="<li><span><img src='$url' onError=\"this.src='$webdb[www_url]/images/default/nopic.jpg'\" onClick=\"showAllpics(\$(this))\"/></span></li>\r\n";
	}
	ob_end_clean();
	require(html("wapbencandy_$rsdb[mid]"));
	exit;
}
$listPics=$listPics?"<div class='ListThisimgs'>\r\n<div class='lists'>\r\n<ul>\r\n".$listPics."</ul>\r\n</div>\r\n</div>":"";
print <<<EOT
-->
$listPics
<div class="ShowBigPicBox"><img src='$webdb[www_url]/images/news/logo.png'> <span onClick="hiddenShowBigPicBox()">关闭</span><ul><ol onClick="prevShowImg()"></ol><li onClick="nextShowImg()"></li></ul></div>
<script  type='text/javascript' src='http://cms.net/images/news/jquery.touchSwipe.min.js'></script>
<script type="text/javascript" src='$webdb[www_url]/images/news/iscroll.js'></script>
<script type="text/javascript">
<!--
//统计总宽度
var mysortBoxW=0;
$('.ListThisimgs .lists ul li').each(function(){
	mysortBoxW+=$(this).width();
});
$('.ListThisimgs .lists').width(mysortBoxW);
var myScroll; 
myScroll = new IScroll('.ListThisimgs', { scrollX: true, scrollY: false, mouseWheel: true,preventDefault: false,preventDefaultException: { tagName: /^(INPUT|TEXTAREA|BUTTON|SELECT|LI)$/ } });
var ThePics,picnums,nowlist;
function showAllpics(objs){
	var thispic=objs.attr("src");
	ThePics = new Array();
	var i=0;
	$('.ListThisimgs .lists ul li img').each(function(){
		ThePics[i]=$(this).attr("src");
		if(thispic==ThePics[i]){
			nowlist=i;
		}
		i++;
	});
	picnums=i;
	showthisPics();
}
function showthisPics(){
	$('.ShowBigPicBox').fadeIn();
	$('.ShowBigPicBox img').fadeOut();
	$('.ShowBigPicBox img').attr("src",ThePics[nowlist]);
	$('.ShowBigPicBox img').fadeIn();
}
function hiddenShowBigPicBox(){
	$('.ShowBigPicBox').fadeOut();
}
function nextShowImg(){
	nowlist++;
	if(nowlist>=picnums){
		hiddenShowBigPicBox()
	}else{
		$('.ShowBigPicBox img').hide();
		$('.ShowBigPicBox img').attr("src",ThePics[nowlist]);
		$('.ShowBigPicBox img').fadeIn();
	}
}
function prevShowImg(){
	nowlist--;
	if(nowlist<0){
		hiddenShowBigPicBox()
	}else{
		$('.ShowBigPicBox img').hide();
		$('.ShowBigPicBox img').attr("src",ThePics[nowlist]);
		$('.ShowBigPicBox img').fadeIn();
	}
}
$(".ShowBigPicBox img").swipe({
	swipe:function(event, direction, distance, duration, fingerCount){
		if(direction=='left'){
			nextShowImg();
		}
		else if(direction=='right'){
			prevShowImg();
		}
	},
	click:function(){
		hiddenShowBigPicBox();
	},
});
//-->
</script> 
<!--
EOT;
$MoreContent="";
if($rsdb[mid]==102){
	if($Mrsdb[mvurl][type][0]=='iframe'){
		preg_match("/http([^ ]+)/is",$Mrsdb[mvurl][url][0],$array);
		$rsdb[autoplay]="<iframe src='$array[0]' frameborder='0'></iframe>";
	}elseif($Mrsdb[mvurl][type][0]=='mp4'){
		$rsdb[autoplay]="<video src='{$Mrsdb[mvurl][url][0]}' controls='controls'></video>";
	}else{
		$rsdb[autoplay]="当前视频不能正常播放";
	}
	$MoreContent="<div class='AutoPlays'><section>$rsdb[autoplay]</section></div>";
}
print <<<EOT
-->
	$MoreContent
	<div class="content">
		{$rsdb[content]}
	</div>
</div>
<div class="ShowPage">{$showpage}</div>
$OtherArtile
<div class="mod-share">
    <a class="share-btn" onClick="SharShowMessage();ShareAppMessage();"><span class="ico-share">发送给朋友</span></a>
    <a class="share-btn border-line" onClick="SharShowMessage();ShareTimeline();"><span class="ico-pyq">分享到朋友圈</span></a>
</div>
<script src="$webdb[www_url]/images/default/jweixin-1.0.0.js"></script>
<script type="text/javascript">
  wx.config({
    debug: false,
    appId: '{$signPackage["appId"]}',
    timestamp: {$signPackage["timestamp"]},
    nonceStr: '{$signPackage["nonceStr"]}',
    signature: '{$signPackage["signature"]}',
    jsApiList: [
        'checkJsApi',
		'onMenuShareTimeline',
        'onMenuShareAppMessage',        
      ]
  });
</script>
<script type="text/javascript">
function ShareTimeline(){
    wx.onMenuShareTimeline({
      title: '{$rsdb[title]}',
      link: '$WEBURL',
      imgUrl: '$rsdb[picurl]',
      trigger: function (res) {
        // 不要尝试在trigger中使用ajax异步请求修改本次分享的内容，因为客户端分享操作是一个同步操作，这时候使用ajax的回包会还没有返回
        //alert('用户点击分享到朋友圈');
      },
      success: function (res) {
        //alert('分享成功，请注意查收红包！');
		//window.location.reload();
		window.location.href='wapbencandy.php?fid=$fid&id=$id&job=have_shareTimeline';
      },
      cancel: function (res) {
        //alert('系统监测到你没有真正分享到朋友圈，请重新分享！');
      },
      fail: function (res) {
        alert(JSON.stringify(res));
      }
    });
	//SharShowMessage();
    //alert('请点击左上角的菜单，然后分享到朋友圈去即可');
}
function ShareAppMessage(){
	wx.onMenuShareAppMessage({
      title: '{$rsdb[title]}',
      desc: '{$rsdb[title]}',
      link: '$WEBURL',
      imgUrl: '$rsdb[picurl]',
      trigger: function (res) {
        // 不要尝试在trigger中使用ajax异步请求修改本次分享的内容，因为客户端分享操作是一个同步操作，这时候使用ajax的回包会还没有返回
       // alert('请分享到微信群去，发给单个好友效果没这么明显！');
      },
      success: function (res) {
        //alert('感谢你分享给好友');
		window.location.href='wapbencandy.php?fid=$fid&id=$id&job=have_shareFriend';
      },
      cancel: function (res) {
        //alert('你已取消操作，建议你重新分享给好友！');
      },
      fail: function (res) {
        alert(JSON.stringify(res));
      }
    });
    //alert('请点击左上角的菜单，发送给朋友');
}
wx.ready(function () {
	wx.showOptionMenu();
	ShareTimeline();
	ShareAppMessage();
});

wx.error(function (res) {
  alert(res.errMsg);
});
function SharShowMessage(){
	var t = $(document).height();
	$('.Share_Message').html('<div></div>');
	$('.Share_Message').height(t).fadeIn();
}
function SharHiddenMessage() {
	$('.Share_Message').fadeOut();
}
$('.MainContainerBox').hover(function(){
	$('.HeaerBox .SearchBox').fadeOut();
	$('.HeaerBox .members').fadeOut();
});
</script>
<div class="OhterAritcle">
	<div class="head">相关阅读</div>
	<div class="ListConts"></div>
</div>
<div class="ShowMoreArtic"><span>内容加载中……</span></div>
<script type="text/javascript">
<!--
var page=0;
var check_showMore=1;
function ShowMoreArtic(){
	page++;
	check_showMore=0;
	$('.ShowMoreArtic').fadeIn();
	$.get("$webdb[www_url]/waplist.php?fid=$fid&job=ShowMoreArtic&page="+page+"&"+Math.random(),function(d){
		$('.ShowMoreArtic').fadeOut();
		if(d=='notArtic'){
			//layer.alert("没有更多内容了！");
		}else{
			$('.ListConts').append(d);
			check_showMore=1;
		}	
	});
}
$(document).ready(function () {
	$(window).scroll(function () {
		var scroll_Height=$(window).scrollTop();
		if($('body').height()-scroll_Height<1300 && check_showMore==1){
			ShowMoreArtic();
		}
	});	
});
//-->
</script>
<div class="Share_Message" onClick="SharHiddenMessage();"></div>
<!--
EOT;
?>
-->
<?php
require(ROOT_PATH."inc/wapfoot.php");
?>