<!--<?php
include_once PrintEot('left');print <<<EOT
-->
<!--
EOT;
if(empty($action)){print <<<EOT
-->
<div class="admin_info mb10">
	<h3 class="h1"><b>提示信息</b></h3>
    <div class="legend">
    	<p>注意：因为门户不设隐私权限，当论坛版块设置权限时，建议关闭门户相应的频道或模块，否则会导致帖子无法调用到频道而影响用户正常浏览</p>
        <p>快捷通道：<a style="cursor:pointer;" href="$admin_file?adminjob=customnav&admintype=navmode&type=area_navinfo" onclick="parent.PW.Dialog({'id': 'navmode','name': '模式导航','url': '$admin_file?adminjob=customnav&admintype=navmode&type=area_navinfo'});return false;">频道导航设置</a></p>
    	设置编辑人员进行前台内容管理（管理员和总版主有前台管理权限）；要设置多个编辑人员，用英文的逗号：','分开
    </div>
</div>
<h2 class="h1">选择管理页面</h2>
<!--
EOT;
if ($purview_index==1) {
print <<<EOT
-->
<form action="$basename" method="post">
<div class="admin_table mb10">
<table width="100%" cellspacing="0" cellpadding="0">
	<tbody>
		<tr class="tr2">
			<td>&nbsp;</td>
			<td>编辑人员</td>
			<td>操作</td>
		</tr>
		<tr class="tr1 vt">
			<td class="td2">门户模式首页</td>
			<td class="td2">
            	<input class="input input_wa mr5" type="text" name="editadmin[index]" value="$area_editadmin[index]">
            	<a href="javascript:;" id="scr_index" onclick="sendmsg('$basename&action=madmin&ajax=1&scr=index','',this.id);">[添加]</a>
            </td>
			<td class="td2">
            	<a href="$basename&action=show&scr=index" class="mr20" title="管理本页面模块内容">[编辑]</a>
            	<a href="javascript:;" onclick="updateCache('index');return false;" title="更新页面缓存">[更新]</a>
            </td>
		</tr>
<!--
EOT;
$i = 0;
foreach($catedb as $thread){
print <<<EOT
-->
<!--
EOT;
$thiscatefid = $thread[fid];
print <<<EOT
-->
		<tr class="tr1 vt">
			<td class="td2"><span class="mr5">频道:</span>{$thread[name]}</td>
			<td class="td2">
            	<input class="input input_wa mr5" type="text" name="editadmin[{$thread[fid]}]" value="{$area_editadmin[$thiscatefid]}">
                <a href="javascript:;" id="scr_cate_{$thread['fid']}" onclick="sendmsg('$basename&action=madmin&ajax=1&cateid={$thread[fid]}','',this.id);">[添加]</a>
            </td>
			<td class="td2">
            	<a class="mr20" href="$basename&action=show&scr=cate&showid=$thread[fid]" title="管理本页面模块内容">[编辑]</a>
                <a href="javascript:;" onclick="updateCache('cate','$thread[fid]');return false;" title="更新页面缓存">[更新]</a>
            </td>
		</tr>
<!--
EOT;
}
print <<<EOT
-->
	</tbody>
</table>
</div>
<div class="tac mb10">
    <input type="hidden" value="2" name="step" />
    <span class="btn"><span><button type="submit">提 交</button></span></span>
</div>
<!--
EOT;
} else {
print <<<EOT
-->
<div class="admin_table mb10">
<table width="100%" cellspacing="0" cellpadding="0">
	<tbody>
		<tr class="tr2">
			<td>&nbsp;</td>
			<td>编辑</td>
			<td>更新</td>
		</tr>
<!--
EOT;
if ($purview_index || checkEditAdmin($admin_name,'index')) {
print <<<EOT
-->
		<tr class="tr1 vt">
			<td class="td2">门户模式首页</td>
			<td class="td2">
            	<a class="mr20" href="$basename&action=show&scr=index" title="管理本页面模块内容">[编辑]</a>
            	<a href="javascript:;" onclick="updateCache('index');return false;" title="更新页面缓存">[更新]</a>
            </td>
		</tr>
<!--
EOT;
}
print <<<EOT
-->
<!--
EOT;
$i = 0;
foreach($catedb as $thread){
print <<<EOT
-->
<!--
EOT;
$thiscatefid = $thread[fid];
print <<<EOT
-->
		<tr class="tr1 vt">
			<td class="ta2"><span class="mr5">频道:</span>{$thread[name]}</td>
			<td class="td2">
            	<a class="mr20" href="$basename&action=show&scr=cate&showid=$thread[fid]" title="管理本页面模块内容">[编辑]</a>
            	<a href="javascript:;" onclick="updateCache('cate','$thread[fid]');return false;" title="更新页面缓存">[更新]</a>
            </td>
		</tr>
<!--
EOT;
}
print <<<EOT
-->
	</tbody>
</table>
</div>
<!--
EOT;
}
print <<<EOT
-->
<script src="js/pw_ajax.js" language="JavaScript"></script>
<script src="js/global.js" language="JavaScript"></script>
<script language="javascript">
function updateCache(scr,fid){
	var url = '$ajax_basename';
	if (typeof(fid)=='undefined') {
		fid = 0;
	}
	ajax.send(url,'action=updatecache&scr='+scr+'&fid='+fid,ajax.get);
}
</script>
</form>
<!--
EOT;
}elseif($action=='show'){
print <<<EOT
-->
<div class="nav3 mb10">
    <ul class="cc">
        <li><a href="$basename">选择管理页面</a></li>
        <li class="current"><a href="javascript:;">选择模块</a></li>
    </ul>
</div>
<h2 class="h1">$thistitle</h2>
<div class="admin_table mb10">
	<table width="100%" style="table-layout:fixed;">
    	<tr class="tr2">
            <td width="160">模块名称及样式</td>
            <td width="250">编辑内容</td>
            <td>操作</td>
        </tr>
<!--
EOT;
foreach($invokes as $invoke){print <<<EOT
-->
        <tr class="tr1 vt">
            <td class="td2">
            	<p class="f14 mb5 b">$invoke[name]</p>
<!--
EOT;
if($invoke[descrip]){print <<<EOT
-->
                <p class="gray">$invoke[descrip]</p>
<!--
EOT;
}print <<<EOT
-->
            </td>
            <td class="td2">
<!--
EOT;
foreach($invoke[pieces] as $piece){
print <<<EOT
-->
<!--
EOT;
if(!$invoke[ifloop]){print <<<EOT
-->
				<div>
					<a href="$basename&action=edit&invokepieceid=$piece[id]&fid=$showid&scr=$scr" class="mr20">$piece[title]</a>
<!--
EOT;
if(array_key_exists(md5($piece[id].$showid.'0'),$haveDelays)){
print <<<EOT
-->
					<a class="s1" href="$basename&action=edit&invokepieceid=$piece[id]&fid=$showid&scr=$scr&viewtype=delay">提前推荐</a>
<!--
EOT;
}print <<<EOT
-->
				</div>
<!--
EOT;
}else{print <<<EOT
-->
				<div>$piece[title]</div>
<!--
EOT;
foreach($invoke[loops] as $loop){print <<<EOT
-->
				<div style="padding-left:20px"><a class="mr20" href="$basename&action=edit&&invokepieceid=$piece[id]&fid=$showid&loopid=$loop&scr=$scr">{$forum[$loop][name]}</a>
<!--
EOT;
if(array_key_exists(md5($piece[id].$showid.$loop),$haveDelays)){
print <<<EOT
-->
				<a class="s1" href="$basename&action=edit&invokepieceid=$piece[id]&fid=$showid&scr=$scr&loopid=$loop&&viewtype=delay">提前推荐</a>
<!--
EOT;
}print <<<EOT
-->
				</div>
<!--
EOT;
}print <<<EOT
-->

<!--
EOT;
}print <<<EOT
-->

<!--
EOT;
}print <<<EOT
-->
            </td>
            <td class="td2">
            	<a href="$basename&action=editinvoketpl&name=$invoke[name]&cateid=$showid&scr=$scr" class="mr20">[编辑模块]</a>
                <a href="$basename&action=editinvoke&name=$invoke[name]&cateid=$showid&scr=$scr">[设置模块属性]</a>
            </td>
        </tr>
<!--
EOT;
}print <<<EOT
-->
    </table>
</div>
<!--
EOT;
}elseif($action=='editinvoke'){
print <<<EOT
-->
<div class="nav3 mb10">
    <ul class="cc">
        <li><a href="$basename">选择管理页面</a></li>
        <li><a href="$basename&action=show&scr=$scr&showid=$cateid">选择模块</a></li>
        <li class="current"><a href="javascript:;">设置模块属性</a></li>
    </ul>
</div>
<h2 class="h1">设置模块属性</h2>
<form action="$basename&action=editinvoke" method="post">
<div class="admin_table mb10">
	<table width="100%">
    	<tr class="tr1 vt">
        	<td class="td1">简介</td>
            <td class="td2">
            	<textarea name="descrip" class="textarea">$invokedata[descrip]</textarea>
            </td>
        </tr>
<!--
EOT;
if($invokedata[ifloop]){print <<<EOT
-->
        <tr class="tr1 vt">
        	<td class="td1">选择循环板块<br />按住ctrl键可多选</td>
            <td class="td2">$loopmode</td>
        </tr>
<!--
EOT;
}foreach($invokepieces as $piece){print <<<EOT
-->
		<tr><td colspan="2"><h2 class="h1" style="border-top:0;">$piece[title]</h2></td></tr>
        <tr class="tr1 vt">
        	<td class="td1">设置调用类型</td>
            <td class="td2">$piece[func]</td>
        </tr>
<!--
EOT;
if($invokedata[ifloop]){print <<<EOT
-->
<!--
EOT;
}else{
print <<<EOT
-->
        <tr class="tr1 vt">
        	<td class="td1">设置调用版块</td>
            <td class="td2">$piece[rang]</td>
        </tr>
<!--
EOT;
}print <<<EOT
-->
        <tr class="tr1 vt">
        	<td class="td1">调用个数</td>
            <td class="td2"><input type="text" value="$piece[num]" name="num[$piece[id]]" class="input input_wa"></td>
        </tr>
        <tr class="tr1 vt">
        	<td class="td1">缓存更新时间[秒]</td>
            <td class="td2"><input type="text" value="$piece[cachetime]" name="cachetime[$piece[id]]" class="input input_wa mr5">0表示关闭更新</td>
        </tr>
<!--
EOT;
foreach($piece[param] as $value){print <<<EOT
-->
            $value
<!--
EOT;
}}print <<<EOT
-->
    </table>
</div>
<input type="hidden" name="name" value="$name">
<input type="hidden" name="scr" value="$scr">
<input type="hidden" name="cateid" value="$cateid">
<input type="hidden" name="step" value="2">
<div class="tac mb10">
	<span class="btn"><span><button type="submit">提 交</button></span></span>
</div>
</form>
<!--
EOT;
}elseif($action=='editinvoketpl'){
print <<<EOT
-->
<div class="nav3 mb10">
    <ul class="cc">
        <li><a href="$basename">模块内容管理</a></li>
        <li><a href="$basename&action=show&scr=$scr&showid=$cateid">选择模块</a></li>
        <li class="current"><a href="javascript:;">模块管理</a></li>
    </ul>
</div>
<h2 class="h1">$invokedata[name]</h2>
<form action="$basename&action=editinvoketpl" method="post" >
<div class="admin_table mb10">
	<table width="100%">
    	<tr class="tr1 vt">
            <td class="td2"><textarea name="tagcode" style="width:98%;height:200px;" >$invokedata[tagcode]</textarea></td>
        </tr>
    </table>
</div>
<input type="hidden" name="name" value="$name">
<input type="hidden" name="scr" value="$scr">
<input type="hidden" name="cateid" value="$cateid">
<input type="hidden" name="step" value="2">
<div class="tac mb10">
	<span class="btn"><span><button type="submit">提 交</button></span></span>
</div>
</form>
<h3 class="h1">标签说明</h3>
<div class="legend">
<textarea style="width:690px;height:1000px;padding:5px;overflow:auto;border:0;color:#676767;line-height:1.5;">
a) <list >标签，一个<list>代表是一个调用模块： 
    1)action：代表调用的类型。 
    subject:调用帖子     user:调用用户     forum:调用版块     tag:调用标签     image:调用图片 

    2) num :代表调用的个数，如上面的num=”8”这代表，我调用8条数据 
    3) title :模块的名称，注意每个模块里面title必须是唯一的 

b) <loop><li><a href=”{url}” target=”_blank”>{title,32}</a></li></loop>： 
    i) <loop></loop>标签中间代表的是循环的数据 
    ii) 标签格式： 
        1) 针对于action=”subject”模块(帖子) 
            a) {url}:代表链接地址 
            b) {title}:代表标题 
                i) {title,32}则代表对于标题截取32个字 
            c) {image}:代表图片 
                i) {image,80,50}代表对图片进行80*50的缩略 
            d) {forumname}:代表所在版块的名称 
            e) {forumurl}:代表所在版块的链接地址 
            f) {descrip}:代表帖子的描述 
                i) {descript,60}:代表对于描述截取60个字 
            g) {author}:帖子作者 
            h) {authorid}:帖子作者的id 
            i) {tagrelate}:代表相关主题

        2) 针对于action=”user”模块(用户) 
            a) {url}:用户的链接地址 
            b) {title}:用户名 
            c) {image}:用户头像 
            d) {value}:用户某属性的值，如果用户按金钱数排行的，则就调用用户的金钱数 

        3) 针对于 action=”forum” 模块(版块) 
            a) {url}:版块链接 
            b) {title}:版块名称 
            c) {image}:版块logo 
            d) {value}:版块的某属性的值，如:主题数，帖子数..等 

        4) 针对于 action=”tag” 模块(标签) 
            a) {url}:标签链接 
            b) {title}:标签名称 

        5) 针对于 action=”image” 模块(图片) 
            a) 和 action=”subject”相同 

    虽然在模板里面可以定义，调用个数，标题的长度或者图片的截取大小，但是后台还是支持不改动模板而设置这几种属性： 

    缓存更新时间的设置，是以秒为单位，对于需要实时更新的，建议设置5分钟以上(300秒)，对于实时性不高的，可以设置一天(86400秒)以上。
	PS:sp3开始，设置为零，则代表不更新
    
    支持php代码:对于一些需要用程序做逻辑判断的模块，可在模块里面写php代码
php写在<!--#  #-->标签中间</textarea> 
</div>
<!--
EOT;
}elseif($action=='edit'){
print <<<EOT
-->
<div class="mb10 nav3">
    <ul class="cc">
        <li><a href="$basename">模块内容管理</a></li>
        <li><a href="$basename&action=show&scr=$scr&showid=$cateid">选择模块</a></li>
        <li class="current"><a href="javascript:;">模块内容管理</a></li>
    </ul>
</div>
<div class="mb10">$thistitle</div>
<h2 class="h1">请输入要调用的帖子tid</h2>
<div class="admin_table mb10">
	<table cellspacing="0" cellpadding="0" width="100%">
    	<tr class="tr1">
        	<td class="td2">
<!--
EOT;
if($invokepiece['action']=='subject' || $invokepiece['action']=='image'){
print <<<EOT
-->
				<input type="text" class="input input_wa" id="pushtid" value="" >
<!--
EOT;
}
print <<<EOT
-->
				<span class="bt2"><span><button type="button" onclick="addPush();">添 加</button></span></span>
			</td>
        </tr>
     </table>
</div>
<h2 class="h1" style="padding:0;">
    <div class="tab_A" style="margin-top:3px;">
        <ul class="cc" style="padding-left:10px;">
            <li $effectStyle><a href="$basename&action=edit&invokepieceid=$invokepieceid&fid=$fid&loopid=$loopid&scr=$scr">展示的数据</a></li>
            <li $overdueStyle><a href="$basename&action=edit&invokepieceid=$invokepieceid&fid=$fid&loopid=$loopid&scr=$scr&viewtype=overdue">过期的数据</a></li>
            <li $delayStyle><a href="$basename&action=edit&invokepieceid=$invokepieceid&fid=$fid&loopid=$loopid&scr=$scr&viewtype=delay">提前推荐</a></li>
        </ul>
    </div>
</h2>
<div class="admin_table mb10">
<table cellspacing="0" cellpadding="0" width="100%" id="ftable">
	<tr class="tr2 vt">
		<td width="30">位置</td>
<!--
EOT;
foreach ($param as $key=>$value) {
if (passOverKeys($key)) continue;
$key = getParamName($key,$invokepiece['action']);
print <<<EOT
-->
		<td>{$key}</td>
<!--
EOT;
}
print <<<EOT
-->
		<td>推送人</td>
		<td>管理</td>
	</tr>
<!--
EOT;
$i = 0;
foreach ($custom as $key=>$value) {
$temp_offset = $pushs[$key][offset]+1;
$i++;
print <<<EOT
-->
	<tr id="push_{$key}" class="tr1 vt">
		<td class="td2">$temp_offset</td>
<!--
EOT;
foreach ($param as $k=>$val) {
if (passOverKeys($k)) continue;
print <<<EOT
-->
		<td class="td2">$value[$k]</td>
<!--
EOT;
}
print <<<EOT
-->
		<td class="td2">{$pushs[$key][editor]}</td>
		<td class="td2">
        	<a href="javascript:;" class="mr20" onclick="editPush('$key');return false;">[编辑]</a>
        	<a href="javascript:;" onclick="delPush('$key');return false;">[删除]</a>
        </td>
	</tr>
<!--
EOT;
}
print <<<EOT
-->
</table>
</div>
<!--
EOT;
if($viewtype=='overdue'){print <<<EOT
-->
<!--
EOT;
if($count>0){print <<<EOT
-->
<div class="p10"><a href="javascript:;" onclick="delPushs();return false;">清空过期数据</a></div>
<!--
EOT;
}
print <<<EOT
-->
<div class="cc">$pages</div>
<!--
EOT;
}
print <<<EOT
-->
<script src="js/pw_ajax.js" language="JavaScript"></script>
<script src="js/global.js" language="JavaScript"></script>
<script src="js/date.js" language="JavaScript"></script>
<script language="JavaScript" src="js/color_picker.js"></script>
<script language="JavaScript">
function editPush(id){
	var url = "$ajax_basename";
	ajax.send(url,'action=editpush&id='+id,ajax.get);
}
function addPush(){
	var url = "$ajax_basename";
	var invokepieceid = '$invokepieceid';
	var fid	= '$fid';
	var loopid = '$loopid';
	var pushtid= 0;
	if (getObj('pushtid')) {
		pushtid = getObj('pushtid').value;
	}
	ajax.send(url,'action=addpush&invokepieceid='+invokepieceid+'&fid='+fid+'&loopid='+loopid+'&pushtid='+pushtid,ajax.get);
}
function delPush(id){
	if (!confirm("确定要删除此条目吗？")){
		return false;
	}
	var url = "$ajax_basename";
	ajax.send(url,'action=delpush&pushid='+id,ajax.get);
}
function delPushs(){
	if (!confirm("确定要清空过期数据吗？")){
		return false;
	}
	var url = "$ajax_basename";
	var invokepieceid = '$invokepieceid';
	var fid	= '$fid';
	var loopid = '$loopid';
	ajax.send(url,'action=delpushs&invokepieceid='+invokepieceid+'&fid='+fid+'&loopid='+loopid,ajax.get);
}
function countlen(element,num){
	if (element.value.length>num){
		alert('超过字数限制');
		element.value=element.value.substring(0,num);
	}
	return true;
}
function pickReback(color){
	getObj('color_show').style.backgroundColor = color;
}
function styleOnclick(e,obj){
	var objclass = e.className;
	var temp = objclass.split(' ');
	var newclass = '';
	for (var n=0; n<temp.length; n++){
		if (temp[n]=='one') {
			continue;
		}
		newclass += ' ' + temp[n];
	}
	if (objclass.match(/one/)) {
		e.className = newclass;
		getObj(obj).value = '';
	} else {
		e.className = newclass + ' one';
		getObj(obj).value = 1;
	}
}
function colorCancel(){
	getObj('color_show').style.backgroundColor='#FFFFFF';
	getObj('title1').value='';
}
function checkFileType() {
	var fileName = getObj("uploadpic").value;
	if (fileName != '') {
		var regTest = /\.(jpe?g|gif|png)$/gi;
		var arrMactches = fileName.match(regTest);
		if (arrMactches == null) {
			getObj('fileTypeError').style.display = '';
			return false;
		} else {
			getObj('fileTypeError').style.display = 'none';
		}
	}
	return true;
}
</script>
<!--
EOT;
}include_once PrintEot('adminbottom');
?>-->