<!--<?php
include_once PrintEot('left');
print <<<EOT
-->
<h3><b>提示信息</b></h3>
<div class="tr5">
1、熱榜排行可結合PW緩存庫進行使用<br />
2、如果開啟了熱榜排行之後，首頁的瀏覽速度減慢，請開啟PW緩存庫里面相對應的緩存！
</div>
<!--
EOT;
if($action=='rebang'){
$column = '<optgroup label="帖子信息"><option value="newpic">圖片輪播</option><option value="newpost">最新帖子</option><option value="newreply">最新回復</option><option value="digest">精華帖子</option><option value="hits">人氣排行</option><option value="replies">回復排行</option></optgroup><optgroup label="會員信息"><option value="new">最新會員</option><option value="postnum">總發帖排行</option><option value="monthpost">本月發帖排行</option><option value="todaypost">今日發帖排行</option><option value="onlinetime">在線時間排行</option></optgroup><optgroup label="版塊信息"><option value="topic">主題排行</option><option value="article">文章排行</option><option value="tpost">今日發帖排行</option></optgroup><optgroup label="積分信息">';
foreach ($credit->cType as $key=>$val){
	$column .= "<option value=\"$key\">{$val}排行</option>";
}
$column .='</optgroup><optgroup label="其他信息"><option value="info">論壇信息</option><option value="custom">自定義欄目</option></optgroup>';
print <<<EOT
-->
<form action="$basename&" method="post">
<input type="hidden" name="action" value="$action">
<input type="hidden" name="job" value="config">
<h2>首頁熱榜設置</h2>
<table width="100%" cellpadding="0" cellspacing="0">
<tr class="tr3">
	<td width="35%">是否開啟首頁熱榜</td>
	<td>
	<input type=radio value=1 $newinfoifopen_Y name="newinfoifopen"> 是
	<input type=radio value=0 $newinfoifopen_N name="newinfoifopen"> 否
	</td>
</tr>
<tr class="tr3">
	<td width="35%">顯示位置</td>
	<td>
	<input type=radio value=1 $position_1 name="position"> 版塊上側
	<input type=radio value=2 $position_2 name="position"> 版塊下側
	<input type=radio value=3 $position_3 name="position"> 版塊左側
	<input type=radio value=4 $position_4 name="position"> 版塊右側
	</td>
</tr>
<tr class="tr3">
	<td>標題截取長度</td>
	<td><input size="35" class="input" value="$nf_config[titlelen]" name="titlelen"></td>
</tr>
<tr class="tr3">
	<td>內容調用條數</td>
	<td><input size="35" class="input" value="$nf_config[shownum]" name="shownum"></td>
</tr>
</table>
<br><center><input type="submit" value="提 交" class="btn"></center>
</form>
<br>

<form action="$basename" method="post" name="cateForm">
<input type="hidden" name="action" value="$action">
<input type="hidden" name="job" value="cate">
<h2><span class="fr" style="margin-right:2em;">[<a style="cursor:pointer;" href="$basename&action=update">更新</a>] [<a style="cursor:pointer;" onclick="return addinput();">添加</a>]</span>欄目管理</h2>
<table width="100%" cellpadding="0" cellspacing="0">

<tr class="tr3 s3">
	<td width="8%">ID</td>
	<td>欄目標題名稱</td>
	<td>欄目內容類型</td>
	<td width="15%">顯示權值(0關閉)</td>
	<td width="15%">操作</td>
</tr>
<tbody id="cate">
<!--
EOT;
foreach($nf_order as $key=>$val){
$tmpcolumn = str_replace("<option value=\"$val[type]\">","<option value=\"$val[type]\" selected>",$column);
$style = $val[order] ? 'class="b"' : 'style="background:#DDD"';
print <<<EOT
-->
<tr id="ip_$key" class="tr3" $style>
	<td><input type="text" class="input" class="input" name="cate[$key][id]" value="$key" size="5"/><input type="hidden" name="cate[$key][flag]" value="$key"/></td>
	<td><input type="text" class="input" class="input" id="name_$key" name="cate[$key][name]" value="$val[name]"/></td>
	<td><select name="cate[$key][type]" onchange="setname('name_$key',this.options[this.selectedIndex].innerHTML);prompt('prompt_$key');">$tmpcolumn</select></td>
	<td><input type="text" class="input" class="input" name="cate[$key][order]" value="$val[order]" size="10" /></td>
	<td><span id="prompt_$key" style="float:right;display:none"><font color=red>(*)</font></span>
		<a class="fourm-two" onClick="javascript:window.location='$basename&action=setting&type=$val[type]&orderid=$key'" title="設置"><span class="edit" style="margin-right:1em;"></span></a>
		<a class="fourm-two" title="刪除" onClick="javascript:if(delinput('ip_$key'))cateForm.submit();"><span class="del" ></span></a>
	</td>
</tr>
<!--
EOT;
}print <<<EOT
-->
</tbody>
</table>
<br /><center><input type="submit" class="btn" value="提 交"></center>
</form>
<br />
<script language="JavaScript">
var ip=1000;

function setname(id,text){
	getObj(id).value = text;
}
function prompt(id){
	getObj(id).style.display = 'block';
}
function delinput(id){
	if (confirm("您確定要刪除此欄目嗎?")) {
		getObj('cate').removeChild(getObj(id));
		return true;
	}
	return false;
}
function addinput(){
	ip++;
	tr = document.createElement('tr');
	tr.id = 'ip_'+ip;
	tr.className = 'tr3';
	td0 = document.createElement('td');
	td1 = document.createElement('td');
	td2 = document.createElement('td');
	td3 = document.createElement('td');
	td4 = document.createElement('td');

	td0.innerHTML ='<input type="text" class="input" class="input" name="cate['+ip+'][id]" value="" size="5"/><input type="hidden" name="cate['+ip+'][flag]" value=""/>';
	td1.innerHTML = '<input type="text" class="input" class="input" name="cate['+ip+'][name]" value="" id="name_'+ip+'"/>';
	td2.innerHTML = '<select name="cate['+ip+'][type]" onchange="setname(\'name_'+ip+'\',this.options[this.selectedIndex].innerHTML);">$column</select>';
	td3.innerHTML = '<input type="text" class="input" class="input" name="cate['+ip+'][order]" value="0" size="10" />';
	td4.innerHTML = '<span id="prompt_'+ip+'" style="float:right;"><font color=red>(*)</font></span>[<a style="cursor:pointer;" onClick="javascript:delinput(\'ip_'+ip+'\')">刪除</a>]&nbsp;';
	tr.appendChild(td0);
	tr.appendChild(td1);
	tr.appendChild(td2);
	tr.appendChild(td3);
	tr.appendChild(td4);
	getObj('cate').appendChild(tr);
}
</script>
<!--
EOT;
}elseif($action=='setting'){print <<<EOT
-->
<form action="$basename" method="post">
<input type="hidden" name="action" value="$action">
<input type="hidden" name="type" value="$type">
<input type="hidden" name="step" value="2">
<input type="hidden" name="orderid" value="$orderid">
<h2>{$nf_order[$orderid][name]}</h2>
<table width="100%" cellpadding="0" cellspacing="0">
<tr class="tr3">
	<td align="right">更新緩存時間(默認時間=0,單位:秒)</td>
	<td colspan="2"><input type="text" class="input" name="updatetime" value="{$nf_order[$orderid][updatetime]}" /></td>
</tr>
<!--
EOT;
if($type=='newpic'){print <<<EOT
-->
<tr class="tr3">
	<td width="33%">圖片選取方式</td>
	<td colspan="2">
		<input type=radio value=0 name="picmode" onclick="seltype('0')" $picmode_1 /> 最新圖片
		<input type=radio value=1 name="picmode" onclick="seltype('1')" $picmode_2 /> 自定義圖片
	</td>
</tr>
<tbody id="custom" style="display:none">
<tr><td class="tr4" colspan="3"><b>自定義圖片</b></td></tr>
<tr class="tr3 tac">
	<td width="33%">圖片地址</td>
	<td>圖片標題</td>
	<td>外部鏈接</td>
</tr>
<!--
EOT;
for($i=0;$i<$nf_config[shownum];$i++){
if($nf_newinfodb[$orderid][$i]){print <<<EOT
-->
	<tr class="tr3 tac">
		<td><input type="text" class="input" name="urls[]" value="{$nf_newinfodb[$orderid][$i][value]}" size="50" /></td>
		<td><input type="text" class="input" name="title[]" value="{$nf_newinfodb[$orderid][$i][name]}" size="50" /></td>
		<td><input type="text" class="input" name="links[]" value="{$nf_newinfodb[$orderid][$i][id]}" size="50" /></td>
	</tr>

<!--
EOT;
}else{print <<<EOT
-->
	<tr class="tr3 tac">
		<td><input type="text" class="input" name="urls[]" size="50" /></td>
		<td><input type="text" class="input" name="title[]" size="50" /></td>
		<td><input type="text" class="input" name="links[]" size="50"/></td>
	</tr>
<!--
EOT;
}}print <<<EOT
-->
</tbody>
<script language="JavaScript">
function seltype(show){
	document.getElementById('custom').style.display = show == '1' ? '' : 'none';
}
seltype('{$nf_order[$orderid][mode]}');
</script>
<!--
EOT;
}elseif($type=='custom'){
print <<<EOT
-->
<tr class="tac">
	<td class="tr4" width="50%">標題</td>
	<td class="tr4" >鏈接地址</td>
</tr>
<!--
EOT;
for($i=0;$i<$nf_config[shownum];$i++){
if($nf_newinfodb[$orderid][$i]){
print <<<EOT
-->
	<tr class="tr3 tac">
		<td><input type="text" class="input" name="titles[]" value="{$nf_newinfodb[$orderid][$i][name]}" size="70" /></td>
		<td><input type="text" class="input" name="links[]" value="{$nf_newinfodb[$orderid][$i][id]}" size="70" /></td>
	</tr>
<!--
EOT;
}else{print <<<EOT
-->
	<tr class="tr3 tac">
		<td><input type="text" class="input" name="titles[]" size="70" /></td>
		<td><input type="text" class="input" name="links[]" size="70" /></td>
	</tr>
<!--
EOT;
}}}elseif($type=='info'){
print <<<EOT
-->
<tr class="tr3">
	<td width="35%" class="tar">首頁熱榜顯示項目</td>
	<td>
		<input type="checkbox" value="newmember" name="info[]" $newmember> 最新注冊會員<br />
		<input type="checkbox" value="totalmember" name="info[]" $totalmember> 論壇會員總數<br />
		<input type="checkbox" value="topic" name="info[]" $topic> 論壇主題總數<br />
		<input type="checkbox" value="article" name="info[]" $article> 論壇帖子總數<br />
		<input type="checkbox" value="tposts" name="info[]" $tposts> 今日發帖數<br />
		<input type="checkbox" value="yposts" name="info[]" $yposts> 昨日發帖數<br />
		<input type="checkbox" value="hposts" name="info[]" $hposts> 最高日發帖數<br />
		<input type="checkbox" value="users" name="info[]" $users> 當前在線會員數<br />
		<input type="checkbox" value="guest" name="info[]" $guest> 當前在線游客數<br />
		<input type="checkbox" value="usertotal" name="info[]" $usertotal> 當前在線總數<br />
		<input type="checkbox" value="higholnum" name="info[]" $higholnum> 最高在線人數<br />
		<input type="checkbox" value="higholtime" name="info[]" $higholtime> 最高在線發生時間<br />
	</td>
</tr>
<!--
EOT;
}print <<<EOT
-->
</table>
<br /><center><input type="submit" class="btn" value="提 交"></center>
</form>
<br />
<!--
EOT;
}include_once PrintEot('adminbottom');
?>-->