<?php
if( !defined('ISDVBBS') ){
	header('HTTP/1.0 404 Not Found');
	exit;
}
global $imgurl,$usergroupid;
?>
<table cellpadding="0" cellspacing="0" class="mainbox tableborder" >
<tr><th style="border-bottom:0px;">-=><?=$lang['template1']?></th></tr>
<tr><td><?$svy->BoardShow();?></td></tr>
</table>
<br>
</div>

<!------------mainbox-------------> 
<div class="mainbox">

<!------------右边部分开始-------------> 
<div class="page_right"> 
<!---------------热门问题,精华问题------------------->
  <div class="page_box">
	<div class="tabtitle">
		<div id="tabgroup_bot">
		  <p class="tabgroup"><?=$lang['savvy.info7']?></p>
		  <p class="tabgroup_on"><?=$lang['savvy.info21']?></p>
		</div>
		<div id="topicbody">
		<dl>
			<div class="nav_topic">
				<ul >
<?
require_once INC_PATH.'DV_Encoding.class.php';
$objEnc = DV_Encoding::GetEncoding($GLOBALS['charset']);
$i=0;
foreach ($savvy_board['tmphotinfo'] as $hotinfo){
	if($i++===10)break;
	$url=_urlrewrite("savvy_dispbbs.php?boardid={$hotinfo['boardid']}&id={$hotinfo['topicid']}");
?>
				<li >
					<em>[<?=$hotinfo['child']?>]</em><a href="<?=$url?>" title="<?=$hotinfo['title'];?>"><?=$objEnc->SubString($hotinfo['title'],0,13)?></a>
					
				</li>
<?
}
?>
				</ul>
			</div>
		</dl>
		<dl>
			<div class="nav_topic">
				<ul>
<?
$i=0;
foreach ($savvy_board['tmpbestinfo'] as $bestinfo){
	if($i++===10)break;
	$url=_urlrewrite("savvy_dispbbs.php?boardid={$bestinfo['boardid']}&id={$bestinfo['topicid']}");
?>
				<li>
					<a href="<?=$url?>" title="<?=$hotinfo['title'];?>"><?=$objEnc->SubString($bestinfo['title'],0,16)?></a>
				</li>
<?
}
?>
				</ul>
			</div>
		</dl>
	</div>
   </div>
  </div>
<!---------------end 热门问题,精华问题------------------->

<!---------------积分排行------------------->
   <div class="page_box">
	 <div class="tabtitle">
		<div id="order_bot" class="tabgroup_bot">
		   <p class="tabgroup"><?=$lang['savvy.info8']?></p>
		</div>
		<div id="orderbody">
		<dl>
			<div class="nav_topic">
				<ul>
<? //上周积分排行
foreach ($savvy_board['userweekmoney'] as $userweekmoney){
?>
				<li>
				<em><?=$userweekmoney['wealth']?></em><a href="dispuser.php?id=<?=$userweekmoney['userid']?>"><?=$userweekmoney['username']?></a>
				
				</li>
<?
}
?>				
				</ul>
			</div>
		</dl>
		</div>
	</div>
  </div>
<!---------------end 积分排行------------------->

</div><!------------右边部分结束-------------> 

<!------------左边部分开始-------------> 
<div class="page_left">     
<?php
	$topicsta = array(-1=>$lang['list.tpl.str8_1'],$lang['list.tpl.str1'],$lang['list.tpl.str2'],$lang['list.tpl.str3'],$lang['list.tpl.str4'],$lang['list.tpl.str5'],$lang['list.tpl.str6'],$lang['list.tpl.str7'],$lang['list.tpl.str8']);
	$topicpic = array('ztop1','istop','ztop','isbest','lockfolder','closedb','hotfolder','folder');
	$igetmoney = array('',$lang['list.tpl.str65'],$lang['list.tpl.str66'],$lang['list.tpl.str67'],'',$lang['list.tpl.str68']);
	$lang['list.tpl.str10']=str_replace(array('{$total_online}','{$boardinfo[\'boardtype\']}','{$members_online}','{$guest_online}'),array($totalonline,$boardinfo['boardtype'],$boardmemberonline,$boardguestonline),$lang['list.tpl.str10']);
?>
 

<div>
	<?
	$savvy_action=($userid==0?"nologin":(Return_Userdono()===true?"nodone":""));
	?>
	<A HREF="savvypost.php?action=<?=$savvy_action?>&boardid=<?=$GLOBALS['boardid']?>" class="menu_quiz_a" onMouseOver="url_moveandout(this,'menu_quiz_hover')" onMouseOut="url_moveandout(this,'menu_quiz_a')"><?=$lang['list.tpl.str79']?>
	</A>
<ul>
 <?php
	   $arrmenu=array(
	   "all"=>array("link"=>"?boardid=$boardid&oper=all","title"=>$lang['savvy.info1'])
	   ,"untie"=>array("link"=>"?boardid=$boardid&oper=untie","title"=>$lang['savvy.info2'])
	   ,"nountie"=>array("link"=>"?boardid=$boardid&oper=nountie","title"=>$lang['savvy.info3'])
	   ,"high"=>array("link"=>"?boardid=$boardid&oper=high","title"=>$lang['savvy.info4'])
	   ,"zero"=>array("link"=>"?boardid=$boardid&oper=zero","title"=>$lang['savvy.info5'])
	   );
	   foreach ($arrmenu as $k=>$v){
	   	  if($oper==$k||($k=='all'&&$oper=='')){
	   		echo '<font color="black" class="page">'.$v['title'].'</font>';
	      }else{
            echo '<a href="'.$v['link'].'" class="page">'.$v['title'].'</a>';
	      }
	   }
	   ?>
<?
if($usergroupid==1 or $usergroupid==2 or $usergroupid==3){
	if($oper=='ask_manager'){
		echo '<font color="black" class="page">'.$lang['savvy.info12'].'</font>';
	}else{
		echo '<a href="?boardid='.$boardid.'&oper=ask_manager" class="page">'.$lang['savvy.info12'].'</a>';
	}
}	
?>
</ul>	
</div><br /><br /><br />
<table cellpadding="0" cellspacing="0" align="left" class="tableborder" width="100%">
<form action="admin_batch.php?boardid=<?=$boardid?>" method="post" name="ask_batch">
<tr>
<th width="50%" style="text-align:center;"  ><?=$lang['list.tpl.str25']?></th>
<th width="10%"  style="text-align:center;" ><?=$lang['list.tpl.str20']?></th>
<th width="8%" style="text-align:center;" ><?=$lang['list.tpl.str21']?></th>
<th width="7%" style="text-align:center;" ><?=$lang['list.tpl.str24']?></th>
<th width="8%" style="text-align:center;" ><?=$lang['list.tpl.str22']?></th>
<th width="17%" align="right" style="padding-right:30px;"><?=$lang['list.tpl.str23']?></th>
</tr>
<?
$t = 0;
foreach( $_topics as $key=>$topic ){
	$topic['lastpost']=explode('$',$topic['lastpost']);
	$topic['lastpost'][2] = gmdate('Y-m-d H:i:s', $topic['lastpost'][2]+getUserTimeZoneOffset());
	(-1 == $topic['isvote']) AND ($topic['title'] = '['.$lang['list.tpl.str70'].']&nbsp;'.$topic['title']);
	$datedifftime = 0;
	if ( intval($board_settings[64]) > 0 ){//判断是开通新贴图片标志
		if ( intval($board_settings[63]) == 0 ){
			$datedifftime = dateDiff('M',$topic['lastpost'][2],$nowtimes);
		}else{
			$datedifftime = dateDiff('M',$topic['dateandtime'],$nowtimes);
		}
		if ( $datedifftime > intval($board_settings[64]) ){
			$datedifftime = 0;
		}
	}
	$dispfile = ((-1 == $topic['isvote']) ? 'dispargue.php' : 'savvy_dispbbs.php');
?>
<tr align="center" style="padding:3px;" class="t6">
<td class="tablebody5" style="padding-left:3px;" align="left" height="30">
<?
if($usergroupid==1 && $oper=='ask_manager' or $usergroupid==2 && $oper=='ask_manager'  or $usergroupid==3 && $oper=='ask_manager' ){
?>
		<input type="checkbox" name="announceid[]" id="announceid[]" value="<?=$topic['topicid']?>">
<?
}
?>

<div style="float:right;">
<?
if ($topic['usetools'] != '')	//显示道具
{
	$S= explode(',',$topic['usetools']);
	for($i=0;$i<count($S);$i++)
	{
		if($S[$i] != "")
		{
			$isprint= true;
			for($j=0;$j<$i;$j++)
			if($S[$j] == $S[$i])
			{
				$isprint= false;
				break;
			}
			if($isprint){
?>
					<img src="dv_plus/tools/minipic/tools<?=$S[$i]?>.gif" border="0" alt="<?=$lang['list.tpl.str73']?>" onclick="openScript('plus_tools_pay.php?action=BuyTools&amp;toolsid=<?=$S[$i]?>',600,450);" style="cursor : pointer;"/>
<?
			}
		}
	}
}
?>
</div>

<span class="savvyimg"><font color="red" title="<?=$lang['list.tpl.str74'].$topic['getmoney'].$lang['list.tpl.str76']?>"><?=$topic['getmoney']?></font></span>
<?
$topic['lastpost'][3] = preg_replace( '/<([^<>]*?)>/i' ,'' ,$topic['lastpost'][3]);
$topic['dateandtime'] = gmdate("Y-m-d H:i:s",$topic['dateandtime']+getUserTimeZoneOffset());
$html_locktopic = htmlspecialchars($topic['locktopic']);
$html_postusername = htmlspecialchars($topic['postusername']);
$html_lastpost = htmlspecialchars($topic['lastpost'][3]);

$url=_urlrewrite("{$dispfile}?boardid={$topic['boardid']}&id={$topic['topicid']}&page={$page}");
?>

<div style="float:left;height:16px;line-height:16px;text-indent:4px;"><a href="<?=$url?>" title="<?=$lang['list.tpl.str71']?><?=$html_locktopic?><?=$lang['list.tpl.str72']?>&#xA;<?=$lang['list.tpl.str31']?><?=$html_postusername?>&#xA;<?=$lang['list.tpl.str32']?><?=$topic['dateandtime']?>&#xA;<?=$lang['list.tpl.str33']?><?=$html_lastpost?> " <?=$topic['topicmode']?>><?=$topic['title']?></a></div>

<?
if ($topic['isvote'] != -1 AND ($topic['child'] + 1) > $board_settings[61]){
	$pagelinks = '';
	if ($board_settings[61] < 1) {
		$board_settings[61] = 20;
	}
	$topicpages = ceil(($topic['child'] + 1) / $board_settings[61]);
	for ($i = 1; $i <= $topicpages; $i++) {
		$pagelinks .= "<a href=\"{$dispfile}?boardid={$topic['boardid']}&id={$topic['topicid']}&page={$page}&star={$i}\"><font color=red>{$i}</font></a> ";
		if($i == 6) {
			$i = $topicpages + 1;
		}
	}
	if($topicpages > 6) {
		$pagelinks .= " .. <a href=\"{$dispfile}?boardid={$topic['boardid']}&id={$topic['topicid']}&page={$page}&star={$topicpages}\"><font color=red>{$topicpages}</font></a> ";
	}
?>
	[ <img src="<?=$imgurl?>pagelist.gif"/>&nbsp;<b><?=$pagelinks?></b> ]
<?
}
if ($datedifftime > 0){
?>
	<img src="<?=$board_settings[65]?>" alt="<?=$datedifftime?><?=$lang['list.tpl.str69']?>"/>
<?
}
?>
</td>
<td class="tablebody5">
<?
if(intval($topic['anonymity'])!=1){
	if ($topic['hidename'] == 0 || $board_settings[58] == 0 || $master == true){
?>
		<a href="dispuser.php?id=<?=$topic['postuserid']?>" target="_blank"><?=$topic['postusername']?></a>
<?
	}else{
?>
	<font color="gray"><?=$lang['list.tpl.str26']?></font>
<?
	}
}else{
	?>
	<font color="gray"><?=$lang['list.tpl.str26']?></font>
	<?
}
?>
</td>
<td class="tablebody5"><?if(intval($topic['child'])>0){echo '<font color="#ff6600">'.$topic['child'].'</font>';}else{echo $topic['child'];}?></td>
<td class="tablebody5"><?if(empty($topic['solve'])){?><img src="<?=$imgurl.'icn_time.gif'?>"><?}elseif(intval($topic['solve'])==1){?><img src="<?=$imgurl.'icn_ok.gif'?>"><?}else{echo '<img src='.$imgurl.'icn_cancel.gif border="0">';}?></td>
<td class="tablebody5">
<?=$topic['hits'];?>
</td>
<td class="tablebody5" align="right" style="padding-right:6px;">
<?
if(intval($topic['anonymity'])==1){
	if($topic['lastpost'][5]==$topic['postuserid']){
			?>
				<font color="gray"><?=$lang['list.tpl.str26']?></font>
			<?
	}
	else{
?>
			<a href="dispuser.php?id=<?=$topic['lastpost'][5]?>" target="_blank"><?=$topic['lastpost'][0]?></a>
<?
	}
}
else{
?>
		<a href="dispuser.php?id=<?=$topic['lastpost'][5]?>" target="_blank"><?=$topic['lastpost'][0]?></a>
<?
}
?>
<br>
<span class="small"><?=$topic['lastpost'][2]?></span>
</td>
</tr>
<tr id="follow<?=$topic['topicid']?>" style="display:none;"><td colspan=6 class="tablebody5"><span id="followTd<?=$topic['topicid']?>"></span></td></tr>
<?
$t++;
}
$jumplist = boardjumplist($boardid);
$jumplist1 = boardjumplist($boardid,$lang['list.tpl.str34']);
if ($action == 'batch'){
?>
<tr>
<td colspan=6 class="tablebody5">
&nbsp;&nbsp;
<select name="newboard" id="newboard">
<?=$jumplist1?>
</select>
&nbsp;&nbsp;
<select name="mode">
<option><?=$lang['list.tpl.str35']?></option><option value="0"><?=$lang['list.tpl.str36']?></option>
<option class="BrightClass"><?=$lang['list.tpl.str37']?></option>
<?
if( $boardinfo['board_setting'] != '' ){
	for ($i=0;$i<=count($board_setting);$i++){
		if ($board_setting[$i] !=''){
?>
<option value="<?=$i?>"><?=$board_setting[$i]?></option>
<?
		}
	}
}
?>
</select>
</td>
</tr>
<?
}
if($usergroupid==1 && $oper=='ask_manager' or $usergroupid==2 && $oper=='ask_manager'  or $usergroupid==3 && $oper=='ask_manager' ){
?>
<SCRIPT LANGUAGE="JavaScript">

function CheckAll(form){
  for (var i=0;i<form.elements.length;i++)
    {
    var e = form.elements[i];
    if (e.name == 'announceid[]')
       e.checked = form.elements['chkall'].checked;
    }
}
function clicksubmit(form){
	if(confirm('<?=$lang['list.tpl.str44']?>'))
	{	this.document.ask_batch.submit();
		return true;
	}
	else{
		return false;
	}
}

</SCRIPT>
		<tr><td colspan="6">
			<input type="hidden" value="<?=$boardid?>" name="boardid"/>
			<input type="checkbox" name="chkall" value="on" onclick="CheckAll(this.form);" class="chkbox"/>	<?=$lang['list.tpl.str38']?>
			<input type="radio" name="action" value="ask_batch" checked="checked" class="radio"/><?=$lang['list.tpl.str40']?>
			<input type="submit" name="Submit" value="<?=$lang['list.tpl.str64']?>" onclick="return clicksubmit(this.form);" class="button"/>
		</td></tr>
<?
}
?>
</form>
</table>
<?
$tmp_boardtype = strip_tags($boardinfo['boardtype']);
?>
</div><!------------左边部分结束-------------> 


<div style="clear:both"></div>
</div><!------------END mainbox------------->


<!--版面跳转-->

<div class="mainbox notice">
<?
if ($boardinfo['topicnum'] > 0){
		$query = $db->query("SELECT COUNT('topicid') AS count FROM {$dv}savvy_topic WHERE mode='$topicmode'".GetdoneType()." AND boardid='$boardid'");
		$num = $db->fetch_array($query);
		$boardinfo['topicnum'] = $num['count'];
		$multipage = pagelist($boardinfo['topicnum'],$board_settings[60],$page,"forum_savvy.php?boardid={$boardid}&action={$action}&topicmode={$topicmode}&oper={$GLOBALS['oper']}",$t,1000,'',1);
		
		$tmp_boardtype = strip_tags($boardinfo['boardtype']);
print <<<EOT
		<h1>
		$multipage
		</h1>
		<span>
		{$lang['list.tpl.str76']}
		&nbsp;<select name="BoardJumpList" id="BoardJumpList" onchange="if(this.options[this.selectedIndex].value!='')location='forum_savvy.php?boardid='+this.options[this.selectedIndex].value;">
		{$lang['list.tpl.str76']}
		$jumplist
		</select>
		</span>
EOT
;
}
?>
</div>
<!--END 版面跳转-->

<!--知道图示-->
<table border=0 cellpadding="0" cellspacing="0" class="mainbox tableborder">
  <tr>
	<th colspan="6" style=" border:0px; border-bottom:1px;">&nbsp;&nbsp;-=&gt; <?=$tmp_boardtype?><?=$lang['list.tpl.str48']?></th>
  </tr>
  <tr>
	<td height="40" bgcolor="#ffffff">&nbsp;&nbsp;<img align="absmiddle" src="<?=$imgurl?>icn_ok.gif" alt="<?=$lang['list.tpl.str49']?>" /> <?=$lang['list.tpl.str49']?></td>
	<td bgcolor="#ffffff"><img align="absmiddle" src="<?=$imgurl?>icn_time.gif" alt="<?=$lang['list.tpl.str50']?>" /> <?=$lang['list.tpl.str51']?></td>
	<td bgcolor="#ffffff"><img align="absmiddle" src="<?=$imgurl?>icn_cancel.gif" alt="<?=$lang['list.tpl.str52']?>" /> <?=$lang['list.tpl.str52']?></td>
	<td bgcolor="#ffffff"><img align="absmiddle" src="<?=$imgurl?>icn_best.gif" alt="<?=$lang['list.tpl.str53']?>" /> <?=$lang['list.tpl.str53']?></td>
	<td bgcolor="#ffffff"><img align="absmiddle" src="<?=$imgurl?>icn_ps.gif" alt="<?=$lang['list.tpl.str54']?>" /> <?=$lang['list.tpl.str54']?></td>
	<td bgcolor="#ffffff">
	<img align="absmiddle" src="<?=$imgurl?>ztop.gif" alt="<?=$lang['list.tpl.str55']?>" />
	<img align="absmiddle" src="<?=$imgurl?>istop.gif" alt="<?=$lang['list.tpl.str56']?>" />
	<img align="absmiddle" src="<?=$imgurl?>ztop1.gif" alt="<?=$lang['list.tpl.str57']?>" />  <?=$lang['list.tpl.str58']?></td>
  </tr>
</table> 
<!--END 知道图示-->
<script>
//右边知道切换
var new1 = new NewsSpanBar();
new1.f=0;
new1.titleid = "tabgroup_bot";
new1.bodyid = "topicbody";
new1.class_hiton = "tabgroup_on";
new1.class_hitno = "tabgroup";
new1.load();

//右边用户积分切换
var new3 = new NewsSpanBar();
new3.f=0;
new3.titleid = "order_bot";
new3.bodyid = "orderbody";
new3.class_hiton = "tabgroup_on";
new3.class_hitno = "tabgroup";
new3.load();
</script>
