<!--<?php
$randnum = rand(1, 9999);
print <<<EOT
-->
<!-- 
EOT;
if($cssForum){
print <<<EOT
-->
<div class="c"></div>
<link rel="stylesheet" type="text/css" href="$pwModeImg/app.css" />
<!-- 
EOT;
}
print <<<EOT
-->
<div id="content" class="fr">
    <table width="100%">
    <tr class="vt"><td height="400" style="padding-bottom:20px;">
    <div style="padding:15px 15px 0">
        <div class="app-title cc">
        <span class="f24">热榜</span>
        </div>
<!-- 热榜 tabs start -->
<!-- 
EOT;
if($tabs){
print <<<EOT
-->
<div class="tabB cc">
<ul>
 <li id="a_own"><a href="{$basename}action=center">排行中心</a></li>
<!-- 
EOT;
foreach($tabs as $key => $value){
print <<<EOT
-->
 <li id="a_$value[tag]"><a href="{$basename}action=$value[tag]">$value[name]</a></li>
<!-- 
EOT;
}print <<<EOT
-->
<script language="JavaScript"> 
setCurrent('a_$action','a_own','current');
</script>
</ul>
</div>
<!-- 
EOT;
}print <<<EOT
-->
	</div>
<!-- 热榜 tabs end -->
<div style="padding:0 10px;">
<!-- 热榜中心 start -->
<!-- 
EOT;
if(empty($action) || $action=='center'){
$num = 0;
foreach($result as $key => $value){
	foreach($value['sub'] as $k => $v){
		$num++;
		$b = $num%2;
if($b!=0){
print <<<EOT
-->
			  <div class="cc mt10">
<!--
EOT;
}
		switch($value['tag']){
			case 'memberHot':
print <<<EOT
-->
				<div class="w-390 fl">
					<div class="p10">
						<div class="hot-title cc"><span class="f14 b">用户$v[cTime]$v[title]</span>
						<ul><li class="red"><a href="{$basename}action=$value[tag]&sub=$v[tag]">更多</a></li></ul>
						</div>
						<div id="list" class="img-list-a">
<!-- 
EOT;
foreach($v['data'] as $k1 => $v1){
print <<<EOT
-->
							<dl class="cc">
							<dt class="fl"><a href="$v1[url]" target="_blank"><img height="20" align="absmiddle" width="20" src="$v1[image]" class="mr10"/></a><span class="fl"><a href="$v1[url]" class="link-w" target="_blank">$v1[title]</a>
							<span class="none">最后登录: $v1[lastDate]</span></span>
							</dt>
							<dd class="fr">$v[cType] $v1[value]$v[unit]</dd>
							</dl>
<!-- 
EOT;
}print <<<EOT
-->
						</div>
					</div>
				</div>
<!--	
EOT;
			break;
			case 'threadHot':
print <<<EOT
-->
				<div class="w-390 fl">
					<div class="p10">
						<div class="hot-title cc"><span class="f14 b">帖子$v[cTime]$v[title]</span>
						<ul><li class="red"><a href="{$basename}action=$value[tag]&sub=$v[tag]">更多</a></li></ul>
						</div>
						<table width="100%">
<!-- 
EOT;
foreach($v['data'] as $k1 => $v1){
print <<<EOT
-->
						<tr class="tr3">
						<td><span class="replay-bg"><div class="b red f16">$v1[value]</div>
<!--
EOT;
if($v[tag]=="threadRate"){print <<<EOT
-->
		&nbsp;<a href="javascript:;" onclick="quickRateRequest('$v1[id]','1','$v[action]')" >评价</a> 
<!--
EOT;
}elseif($v[tag]=="threadFav"){print <<<EOT
-->
		&nbsp;<a id="favor" title="收藏为私有" href="javascript:;" onclick="sendmsg('pw_ajax.php?action=favor&tid=$v1[id]&fid=$v1[fid]','',this.id)">收藏</a> 
<!--
EOT;
}elseif($v[tag]=="threadShare"){print <<<EOT
-->
		&nbsp;<a id="td_read_tpc" title="分享此帖" onclick="sendmsg('operate.php?action=share&ajax=1&type=topic&id=$v1[id]','',this.id);">分享</a> 
<!--
EOT;
}else{print <<<EOT
-->
		&nbsp;$v[unit]		
<!--
EOT;
}print <<<EOT
-->					
						</span></td>
						<td class="gray"><p class="height-18"><a class="uline" href="$v1[url]" target="_blank">$v1[title]</a></p>作者：<a href="u.php?action=show&username=$v1[author]" target="_blank">$v1[author]</a><br/>发帖：<span class="f10">$v1[postdate]</span></td>
						</tr>
<!-- 
EOT;
}print <<<EOT
-->						
						</table>
					</div>
				</div>
<!--
EOT;
			break;
			case 'diaryHot':
print <<<EOT
-->
				<div class="w-390 fl">
					<div class="p10">
						<div class="hot-title cc"><span class="f14 b">日志$v[cTime]$v[title]</span>
						<ul><li class="red"><a href="{$basename}action=$value[tag]&sub=$v[tag]">更多</a></li></ul>
						</div>
						<table width="100%">
<!-- 
EOT;
foreach($v['data'] as $k1 => $v1){
print <<<EOT
-->
						<tr class="tr3">
						<td><span class="replay-bg"><div class="b red f16">$v1[value]</div>
<!--
EOT;
if($v[tag]=="diaryRate"){print <<<EOT
-->
		&nbsp;<a href="javascript:;" onclick="quickRateRequest('$v1[id]','2','$v[action]')" >评价</a> 
<!--
EOT;
}elseif($v[tag]=="diaryFav"){print <<<EOT
-->
	    &nbsp;<a id="diaryFav" href="javascript:;" onclick="sendmsg('operate.php?action=share&ajax=1&type=diary&id=$v1[id]','',this.id);">收藏</a>
<!--
EOT;
}elseif($v[tag]=="diaryShare"){print <<<EOT
-->
		&nbsp;<a id="diaryShare" href="javascript:;" onclick="sendmsg('operate.php?action=share&ajax=1&type=diary&id=$v1[id]','',this.id);">分享</a>
<!--
EOT;
}else{print <<<EOT
-->
		&nbsp;$v[unit]		
<!--
EOT;
}print <<<EOT
-->
						</span></td>
						<td class="gray"><p class="height-18"><a class="uline" href="$v1[url]" target="_blank">$v1[title]</a></p>作者：<a href="u.php?action=show&username=$v1[author]" target="_blank">$v1[author]</a><br/><span class="f10">$v1[posttime]</span></td>
						</tr>
<!-- 
EOT;
}print <<<EOT
-->						
						</table>
					</div>
				</div>
<!--
EOT;
			break;
			case 'forumHot':
print <<<EOT
-->
				<div class="w-390 fl">
					<div class="p10">
						<div class="hot-title cc"><span class="f14 b"> 版块$v[title] </span>
						<ul><li class="red"><a href="{$basename}action=$value[tag]&sub=$v[tag]">更多</a></li></ul>
						</div>
						<table width="100%">
<!-- 
EOT;
foreach($v['data'] as $k1 => $v1){
print <<<EOT
-->						
						<tr class="tr3">
						<td><span class="replay-bg"><div class="b red f16">$v1[value]</div>$v[unit]</span></td>
						<td class="gray"><p class="height-18"><a class="uline" href="thread.php?fid=$v1[id]" target="_blank">$v1[title]</a></p>
						<p class="height-18">最后发帖：<a href="$v1[url]" target="_blank">$v1[desc]</a><br/><span class="f10">$v1[lastDate]</span></p></td>
						</tr>
<!-- 
EOT;
}print <<<EOT
-->						
						</table>
					</div>
				</div>
<!--
EOT;
			break;
		}
if($b == 0){
print <<<EOT
-->
		</div>
<!--
EOT;
}

if('picHot' == $value['tag']){
if( $b != 0){
print <<<EOT
-->
</div>
<!--
EOT;
$num=0;
}print <<<EOT
-->
	<div class="cc">
		<div style="padding:0 10px;">
			<div class="hot-title cc"><span class="f14 b">照片$v[cTime]$v[title]</span>
			<ul><li class="red"><a href="{$basename}action=$value[tag]&sub=$v[tag]">更多</a></li></ul>
			</div>
			<ul class="img-list-b cc">
<!-- 
EOT;
foreach($v['data'] as $k1 => $v1){
$v1[image] = getphotourl($v1[image],$v1['ifthumb']);
print <<<EOT
-->
			<li><table><tr><td class="tac"><div style="width:100px;height:100px;overflow:hidden;"><a href="$v1[url]" target="_blank" ><img onload="if(this.width>100){this.width=100;}else if(this.height>100){this.height=100;}" src="$v1[image]" width="100" height="100" /></a></div></td></tr></table>
			<p><span class="red">$v[unit]数：$v1[value]</span>&nbsp;
<!--
EOT;
if($v[tag]=="picRate"){print <<<EOT
-->
			<a onclick="quickRateRequest($v1[id],'3','$v[action]');" href="javascript:;"><img align="absmiddle" src="images/apps/operation/share.png"/>评价</a>
<!--
EOT;
}elseif($v[tag]=="picFav"){print <<<EOT
-->
			<a  onclick="sendmsg('operate.php?action=share&ajax=1&type=photo&id=$v1[id]','',this.id);" href="javascript:;"><img align="absmiddle" src="images/apps/operation/share.png"/>收藏</a>
<!--
EOT;
}elseif($v[tag]=="picShare"){print <<<EOT
-->
			<a  onclick="sendmsg('operate.php?action=share&ajax=1&type=photo&id=$v1[id]','',this.id);" href="javascript:;"><img align="absmiddle" src="images/apps/operation/share.png"/>分享</a>
<!--
EOT;
}print <<<EOT
-->
			</p></li>
<!-- 
EOT;
}print <<<EOT
-->			
			</ul>
		</div>
	</div>
<!--
EOT;
}}}
if( $b != 0 && $num!=0){
print <<<EOT
-->
</div>
<!--
EOT;
}print <<<EOT
-->
<script src="js/core/core.js" language="JavaScript" type="text/javascript"></script>	
<script src="js/core/utils/changeView.js" language="JavaScript" type="text/javascript"></script>	
<script language="JavaScript">
var frist = New(changeView,['list','dl']);
</script>
<!--
EOT;
}print <<<EOT
-->
<!-- 热榜中心 end -->
<!-- submenu -->
<div class="cc mt10 tab">
<!-- 
EOT;
foreach($subMenu as $key => $value){
print <<<EOT
-->
<a id="current_$value[tag]" href="{$basename}action=$action&sub=$value[tag]"><span>$value[type_name]</span></a>
<!-- 
EOT;
}
$cid = "current_".$sub;
print <<<EOT
-->
</div>
<!-- submenu end -->
<script language="JavaScript"> 
function setCurrentMenu(id,cname){
	var cNode = document.getElementById(id);
	if(cNode != null){
		cNode.className = "current";
	}
}
setCurrentMenu('$cid','');
</script>
<!-- 用户排行 start -->
<!-- 
EOT;
if($action=='memberHot'){
$title = $subMenu[$sub];
if($result){
print <<<EOT
-->
<div class="cc">
	<div class="p10">
	<div class="cc o-info-a">
		<span class="f14 b mr10 fl" style="line-height:1.5;">$title[type_name]</span>
		<div class="fr"><form action="{$basename}action=$action&sub=$sub&rand=$randnum" method="post">
		$result[fType]
		$result[fTime]
		</form></div>
	</div> 
	<div class="o-dl_A o-dl_B mt10 cc">
<!-- 
EOT;
foreach($result[data] as $key => $value){
print <<<EOT
-->
		<dl class="cc fl">
			<dt><a class="fl" href="$value[url]" target="_blank"><img height="50" width="50" class="mt3" src="$value[image]"/></a></dt>
            <dd><a class="f14" href="$value[url]" target="_blank">$value[title]</a><br />$value[value] $result[unit]
				<br /><span class="gray">最后登录：$value[lastDate]</span>
			</dd>
		</dl>
<!-- 
EOT;
}print <<<EOT
-->
	</div>
	</div>
</div>
<!-- 
EOT;
}}print <<<EOT
-->
<!-- 用户排行 end -->

<!-- 帖子排行 start -->
<!-- 
EOT;
if($action=='threadHot'){
$title = $subMenu[$sub];
if($result){
print <<<EOT
-->
<div class="cc">
	<div class="p10">
	<div class="cc o-info-a">
		<span class="f14 b mr10 fl" style="line-height:1.5;">$title[type_name]</span>
		<div class="fr"><form action="{$basename}action=$action&sub=$sub&rand=$randnum" method="post">
		$result[fType]
		$result[fTime]
		</form></div>
	</div>
		<table width="100%">
<!--
EOT;
foreach($result['data'] as $key => $value){
print <<<EOT
-->
		<tr class="tr3">
		<td><span class="replay-bg"><div class="b red f16">$value[value]</div>
<!--
EOT;
if($sub=="threadRate"){print <<<EOT
-->
		&nbsp;<a href="javascript:;" onclick="quickRateRequest('$value[id]','1','$fType')" >评价</a> 
<!--
EOT;
}elseif($sub=="threadFav"){print <<<EOT
-->
		&nbsp;<a id="favor" title="收藏为私有" href="javascript:;" onclick="sendmsg('pw_ajax.php?action=favor&tid=$value[id]&fid=$value[fid]','',this.id)">收藏</a> 
<!--
EOT;
}elseif($sub=="threadShare"){print <<<EOT
-->
		&nbsp;<a id="td_read_tpc" title="分享此帖" onclick="sendmsg('operate.php?action=share&ajax=1&type=topic&id=$value[id]','',this.id);">分享</a> 
<!--
EOT;
}else{print <<<EOT
-->
		&nbsp;$result[unit]		
<!--
EOT;
}print <<<EOT
-->
		</span>
		</td>
		<td class="gray"><a class="uline" href="$value[url]" target="_blank">$value[title]</a></td>
		<td class="gray">作者：<a href="u.php?action=show&username=$value[author]" target="_blank">$value[author]</a><br/>发帖：$value[postdate]</td>
		</tr>
<!-- 
EOT;
}print <<<EOT
-->
		</table>
	</div>
</div>
<!-- 
EOT;
}}print <<<EOT
-->
<!-- 帖子排行 end -->

<!-- 日志排行 start -->
<!-- 
EOT;
if($action=='diaryHot'){
$title = $subMenu[$sub];
if($result){
print <<<EOT
-->
<div class="cc">
	<div class="p10">
	<div class="cc o-info-a">
		<span class="f14 b mr10 fl" style="line-height:1.5;">$title[type_name]</span>
		<div class="fr"><form action="{$basename}action=$action&sub=$sub&rand=$randnum" method="post">
		$result[fType]
		$result[fTime]
		</form></div>
	</div>
		<table width="100%">
<!-- 
EOT;
foreach($result['data'] as $key => $value){
print <<<EOT
-->
		<tr class="tr3">
		<td><span class="replay-bg"><div class="b red f16">$value[value]</div>
<!--
EOT;
if($sub=="diaryRate"){print <<<EOT
-->
		&nbsp;<a href="javascript:;" onclick="quickRateRequest('$value[id]','2','$fType')" >评价</a> 
<!--
EOT;
}elseif($sub=="diaryFav"){print <<<EOT
-->
	    &nbsp;<a id="diaryShare" href="javascript:;" onclick="sendmsg('operate.php?action=share&ajax=1&type=diary&id=$value[id]','',this.id);">收藏</a>
<!--
EOT;
}elseif($sub=="diaryShare"){print <<<EOT
-->
		&nbsp;<a id="diaryShare" href="javascript:;" onclick="sendmsg('operate.php?action=share&ajax=1&type=diary&id=$value[id]','',this.id);">分享</a>
<!--
EOT;
}else{print <<<EOT
-->
		&nbsp;$result[unit]		
<!--
EOT;
}print <<<EOT
-->
		</span></td>
		<td class="gray"><a class="uline" href="$value[url]" target="_blank">$value[title]</a></td>
		<td class="gray">作者：<a href="u.php?action=show&username=$value[author]" target="_blank">$value[author]</a><br/>$value[postdate]</td>
		</tr>
<!-- 
EOT;
}print <<<EOT
-->
		</table>
	</div>
</div>
<!-- 
EOT;
}}print <<<EOT
-->
<!-- 日志排行 end -->
<!-- 相册排行 start -->
<!-- 
EOT;
if($action=='picHot'){
$title = $subMenu[$sub];
if($result){
print <<<EOT
-->
<div class="cc">
	<div class="p10">
	<div class="cc o-info-a">
		<span class="f14 b mr10 fl" style="line-height:1.5;">$title[type_name]</span>
		<div class="fr"><form action="{$basename}action=$action&sub=$sub&rand=$randnum" method="post">
		$result[fType]
		$result[fTime]
		</form></div>
	</div> 
	<div class="mt10">
		<ul class="cc list-img-3">
<!-- 
EOT;
foreach($result['data'] as $key => $value){
$value['image'] = getphotourl($value['image'],$value['ifthumb']);
print <<<EOT
-->
			<li><table><tbody><tr><td class="tac"><a class="photo-img" href="$value[url]" target="_blank"><img onload="if(this.width>100){this.width=100;}else if(this.height>100){this.height=100;}" src="$value[image]" width="100" height="100" /></a></td></tr></tbody></table>
			<p>上传人：<a href="u.php?action=show&username=$value[author]" target="_blank">$value[author]</a><br>$result[unit]数：
			<span class="blue">$value[value]</span>&nbsp;
<!--
EOT;
if($sub=="picRate"){print <<<EOT
-->
			<a onclick="quickRateRequest($value[id],'3','$fType');" href="javascript:;"><img align="absmiddle" src="images/apps/operation/share.png"/>评价</a>
<!--
EOT;
}elseif($sub=="picFav"){print <<<EOT
-->
			<a  onclick="sendmsg('operate.php?action=share&ajax=1&type=photo&id=$value[id]','',this.id);" href="javascript:;"><img align="absmiddle" src="images/apps/operation/share.png"/>收藏</a>
<!--
EOT;
}elseif($sub=="picShare"){print <<<EOT
-->
			<a  onclick="sendmsg('operate.php?action=share&ajax=1&type=photo&id=$value[id]','',this.id);" href="javascript:;"><img align="absmiddle" src="images/apps/operation/share.png"/>分享</a>
<!--
EOT;
}print <<<EOT
-->
			</p></li>
<!--
EOT;
}print <<<EOT
-->
		</ul>
	</div>
	</div>
</div>
<!-- 
EOT;
}}print <<<EOT
-->
<!-- 相册排行 end-->


<!-- 版块排行start -->
<!-- 
EOT;
if($action=='forumHot'){
$title = $subMenu[$sub];
if($result){
print <<<EOT
-->
<div class="cc">
	<div class="p10">
	<div class="o-info-a cc" style="line-height:1.5;"><span class="f14 b"> $title[type_name] </span></div>
		<table width="100%">
<!-- 
EOT;
foreach($result['data'] as $key => $value){
print <<<EOT
-->
		<tr class="tr3">
		<td><span class="replay-bg"><div class="b red f16">$value[value]</div>$result[unit]</span></td>
		<td><a class="b f14" href="thread.php?fid=$value[id]" target="_blank">$value[title]</a></td>
		<td class="gray"><a class="uline" href="$value[url]" target="_blank">$value[desc]</a><br>作者：<a href="u.php?action=show&username=$value[author]" target="_blank">$value[author]</a><br/>最后发帖：$value[lastDate]</td>
		</tr>
<!-- 
EOT;
}print <<<EOT
-->
		</table>
	</div>
</div>
<!-- 
EOT;
}}print <<<EOT
-->
<!-- 版块排行end -->
</div>
</td></tr></table>
</div>
<script language="javascript" src="apps/$appdir/js/hot.js"></script>
<!--
EOT;
?>-->