<!--#Include File="Include.asp"--><%
'--------------------------------------
'Power By 580Web @2010-2014 f02
'URL:http://www.580Web.Cn/
'EMail:wsok85@qq.com
'QQ:253819801
'版权所有 未经允许不得去除本版权信息
'--------------------------------------

Call CheckAdminType("0,1",UType)
Call CheckAdminLimit(ULimit,"s_Template",0)

Types=Clng(Request.QueryString("Type"))

Select Case Types
	Case 1
		Call BuilderBox() '模板标签生成器表单
	Case 2
		Call BuilderDo() '模板标签生成器结果
	Case Else
		Call FKFun.ShowErr("未发现功能项！",1)
End Select

'==========================================
'函 数 名：BuilderBox()
'作    用：模板标签生成器表单
'==========================================
Sub BuilderBox()
	Dim MenuSelect,FriendsTypeSelect,RecommendSelect,SubjectSelect,GetNumSelect,GetFocusSelect
	'菜单列表
	Sqlstr="Select Fk_Menu_Id,Fk_Menu_Name From [Fk_Menu] Order By Fk_Menu_Id Asc"
	Rs.Open Sqlstr,Conn,1,1
	While Not Rs.Eof
        MenuSelect=MenuSelect&"<option value='"&Rs("Fk_Menu_Id")&"'>"&Rs("Fk_Menu_Name")&"</option>"
		Rs.MoveNext
	Wend
	Rs.Close
	'友情链接类型列表
	Sqlstr="Select Fk_FriendsType_Id,Fk_FriendsType_Name From [Fk_FriendsType] Order By Fk_FriendsType_Id Asc"
	Rs.Open Sqlstr,Conn,1,1
	While Not Rs.Eof
        FriendsTypeSelect=FriendsTypeSelect&"<option value='"&Rs("Fk_FriendsType_Id")&"'>"&Rs("Fk_FriendsType_Name")&"</option>"
		Rs.MoveNext
	Wend
	Rs.Close
	'推荐类型列表
	Sqlstr="Select Fk_Recommend_Id,Fk_Recommend_Name From [Fk_Recommend] Order By Fk_Recommend_Id Desc"
	Rs.Open Sqlstr,Conn,1,1
	While Not Rs.Eof
        RecommendSelect=RecommendSelect&"<option value='"&Rs("Fk_Recommend_Id")&"'>"&Rs("Fk_Recommend_Name")&"</option>"
		Rs.MoveNext
	Wend
	Rs.Close
	'专题列表
	Sqlstr="Select Fk_Subject_Id,Fk_Subject_Name From [Fk_Subject] Order By Fk_Subject_Id Desc"
	Rs.Open Sqlstr,Conn,1,1
	While Not Rs.Eof
        SubjectSelect=SubjectSelect&"<option value='"&Rs("Fk_Subject_Id")&"'>"&Rs("Fk_Subject_Name")&"</option>"
		Rs.MoveNext
	Wend
	Rs.Close
	'数值
	For i=1 To 30
		GetNumSelect=GetNumSelect&"<option value='"&i&"'>"&i&"条</option>"
	Next
	'轮换方案列表
	TempArr=Split(FKFun.GetFloderList("../Plugin/FlashFocus/"),"||")
	For Each Temp In TempArr
		GetFocusSelect=GetFocusSelect&"<option value='"&Temp&"'>"&Temp&"</option>"
	Next
%>
<div id="title">模板标签生成器</div>
<div id="box">
	<ul class="dialogNav">
    	<li class="check bnr" id="s1" onclick="bnav('1');">常规标签</li>
    	<li class="bnr" id="s2" onclick="bnav('2');">For标签</li>
    	<li class="bnr" id="s3" onclick="bnav('3');">其他标签</li>
		<div class="cal"></div>
    </ul>
	<div class="cal"></div>
    <!--常规标签-->
	<table width="95%" id="t1" class="t" border="1" bordercolor="#CCCCCC" align="center" cellpadding="0" cellspacing="0">
		<tr>
			<td width="20%" height="30" align="center"><a href="LabelBuilder.asp?Type=2&Build=1" target="get" div="BuildResult">全站常规标签</a></td>
			<td width="20%" align="center"><a href="LabelBuilder.asp?Type=2&build=2" target="get" div="BuildResult">静态模块栏目常规标签</a></td>
			<td width="20%" align="center"><a href="LabelBuilder.asp?Type=2&build=3" target="get" div="BuildResult">内容/留言模块栏目常规标签</a></td>
			<td width="20%" align="center"><a href="LabelBuilder.asp?Type=2&build=4" target="get" div="BuildResult">专题页常规标签</a></td>
			<td width="20%" align="center"><a href="LabelBuilder.asp?Type=2&build=5" target="get" div="BuildResult">搜索页常规标签</a></td>
		</tr>
        <tr>
            <td height="30" align="center">&nbsp;内容页面标签：</td>
            <td colspan="4">
			<form id="Label6" name="Label6" method="post" target="ajax" action="LabelBuilder.asp?Type=2&build=6" dataType="text" refreshDiv="BuildResult">
				&nbsp;<select name="Menu" class="input" id="Menu" onchange="ChangeSelect('Select.asp?Type=101&Id='+$(this).val(),'Module_f6');">
					<option value="0">请选择菜单</option>
					<%=MenuSelect%>
				</select>
				<select name="Module" class="input" id="Module_f6">
					<option value="0">请先选择菜单</option>
				</select>
				<input type="submit" class="button" name="button1" id="button1" value="生 成" />
			</form>
			</td>
        </tr>
	</table>
    <!--For标签-->
	<table width="95%" id="t2" class="t dis" border="1" bordercolor="#CCCCCC" align="center" cellpadding="0" cellspacing="0">
        <tr>
            <td width="15%" height="30" align="right">菜单For标签：</td>
            <td width="85%">
			<form id="Label101" name="Label101" method="post" target="ajax" action="LabelBuilder.asp?Type=2&build=101" dataType="text" refreshDiv="BuildResult">
				&nbsp;<select name="Menu" class="input" id="Menu" onchange="ChangeSelect('Select.asp?Type=101&List=list&Id='+$(this).val(),'Module_f101');">
					<option value="{$MenuId$}">当前菜单</option>
					<%=MenuSelect%>
				</select>
				<select name="Module" class="input" id="Module_f101">
					<option value="{$ModuleId$}">当前栏目</option>
				</select>
				<select name="Level" class="input" id="Level">
					<option value="1">读取1级</option>
					<option value="2">读取2级</option>
					<option value="3">读取3级</option>
					<option value="4">读取4级</option>
					<option value="5">读取5级</option>
				</select>
				<select name="Recall" class="input" id="Recall">
					<option value="0">无需回溯</option>
					<option value="-1">回溯1级</option>
					<option value="-2">回溯2级</option>
					<option value="-3">回溯3级</option>
					<option value="-4">回溯4级</option>
					<option value="-5">回溯5级</option>
				</select>
				<input type="submit" class="button" name="button1" id="button1" value="生 成" />
			</form>
			</td>
        </tr>
        <tr>
            <td width="15%" height="30" align="right">内容For标签：</td>
            <td width="85%">
			<form id="Label102" name="Label102" method="post" target="ajax" action="LabelBuilder.asp?Type=2&build=102" dataType="text" refreshDiv="BuildResult">
				&nbsp;<select name="Menu" class="input" id="Menu" onchange="ChangeSelect('Select.asp?Type=101&List=list&Id='+$(this).val(),'Module_f102');">
					<option value="{$MenuId$}">当前菜单</option>
					<%=MenuSelect%>
				</select>
				<select name="Module" class="input" id="Module_f102">
					<option value="{$ModuleId$}">当前栏目</option>
				</select>
				<select name="Recommend" class="input" id="Recommend">
					<option value="0">是否推荐</option>
					<option value="-1">非推荐记录</option>
					<%=RecommendSelect%>
				</select>
				<select name="Subject" class="input" id="Subject">
					<option value="0">是否专题</option>
					<option value="-1">非专题记录</option>
					<%=SubjectSelect%>
				</select>
				<select name="Pic" class="input" id="Pic">
					<option value="0">是否题图</option>
					<option value="1">有题图内容</option>
					<option value="-1">无题图内容</option>
					<option value="0">全部内容</option>
				</select>
				<select name="Order" class="input" id="Order">
					<option value="1">按ID倒序</option>
					<option value="2">按ID正序</option>
					<option value="3">按时间倒序</option>
					<option value="4">按时间正序</option>
					<option value="5">按点击倒序</option>
					<option value="6">按点击正序</option>
				</select>
				<select name="Count" class="input" id="Count">
					<option value="0">分页模式</option>
					<%=GetNumSelect%>
				</select>
				<input type="submit" class="button" name="button2" id="button2" value="生 成" />
			</form>
			</td>
        </tr>
        <tr>
            <td width="15%" height="30" align="right">友情链接For标签：</td>
            <td width="85%">
			<form id="Label103" name="Label103" method="post" target="ajax" action="LabelBuilder.asp?Type=2&build=103" dataType="text" refreshDiv="BuildResult">
				&nbsp;<select name="FriendsType" class="input" id="FriendsType">
					<%=FriendsTypeSelect%>
				</select>
				<select name="FriendsShowType" class="input" id="FriendsShowType">
					<option value="0">所有模式</option>
					<option value="1">LOGO模式</option>
					<option value="2">文字模式</option>
				</select>
				<select name="Count" class="input" id="Count">
					<option value="0">所有记录</option>
					<%=GetNumSelect%>
				</select>
				<input type="submit" class="button" name="button2" id="button2" value="生 成" />
			</form>
			</td>
        </tr>
        <tr>
            <td width="15%" height="30" align="right">留言For标签：</td>
            <td width="85%">
			<form id="Label104" name="Label104" method="post" target="ajax" action="LabelBuilder.asp?Type=2&build=104" dataType="text" refreshDiv="BuildResult">
				&nbsp;<select name="Menu" class="input" id="Menu" onchange="ChangeSelect('Select.asp?Type=101&List=list&Id='+$(this).val(),'Module_f104');">
					<option value="{$MenuId$}">当前菜单</option>
					<%=MenuSelect%>
				</select>
				<select name="Module" class="input" id="Module_f104">
					<option value="{$ModuleId$}">当前栏目</option>
				</select>
				<select name="State" class="input" id="State">
					<option value="0">所有记录</option>
					<option value="1">已回复记录</option>
					<option value="2">未回复记录</option>
				</select>
				<select name="Count" class="input" id="Count">
					<option value="0">分页模式</option>
					<%=GetNumSelect%>
				</select>
				<input type="submit" class="button" name="button2" id="button2" value="生 成" />
			</form>
			</td>
        </tr>
        <tr>
            <td width="15%" height="30" align="right">专题For标签：</td>
            <td width="85%">
			<form id="Label105" name="Label105" method="post" target="ajax" action="LabelBuilder.asp?Type=2&build=105" dataType="text" refreshDiv="BuildResult">
				<select name="Count" class="input" id="Count">
					<option value="0">所有记录</option>
					<%=GetNumSelect%>
				</select>
				<input type="submit" class="button" name="button2" id="button2" value="生 成" />
			</form>
			</td>
        </tr>
        <tr>
            <td width="15%" height="30" align="right">图片For标签：</td>
            <td width="85%">
			<form id="Label106" name="Label106" method="post" target="ajax" action="LabelBuilder.asp?Type=2&build=106" dataType="text" refreshDiv="BuildResult">
				<input type="submit" class="button" name="button2" id="button2" value="生 成" />
			</form>
			</td>
        </tr>
        <tr>
            <td width="15%" height="30" align="right">循环列表：</td>
            <td width="85%">
			<form id="Label106" name="Label106" method="post" target="ajax" action="LabelBuilder.asp?Type=2&build=107" dataType="text" refreshDiv="BuildResult">
				<input type="submit" class="button" name="button2" id="button2" value="生 成" />
			</form>
			</td>
        </tr> 
		 
	<tr>
			<td width="15%" height="30" align="right">轮换For标签：</td>
			<td width="85%">
			<form id="Label108" name="Label108" method="post" target="ajax" action="LabelBuilder.asp?Type=2&build=108" dataType="text" refreshDiv="BuildResult">
				<select name="FocusID" class="input" id="FocusID">
<%
'轮换列表
Dim FocusSelect
FocusSelect=""
Sqlstr="Select  Fk_Focus_Id,Fk_Focus_Name From [Fk_Focus] Order By Fk_Focus_Id Desc"
Rs.Open Sqlstr,Conn,1,1
While Not Rs.Eof
	FocusSelect=FocusSelect&"<option value='"&Rs("Fk_Focus_Id")&"'>"&Rs("Fk_Focus_Name")&"</option>"
	Rs.MoveNext
Wend
Rs.Close
Response.write(FocusSelect)
%>
				</select>
				<input type="submit" class="button" name="button2" id="button2" value="生 成" />
			</form>
			</td>
		</tr>	
		      
	</table>	
    <!--其他标签-->
	<table width="95%" id="t3" class="t dis" border="1" bordercolor="#CCCCCC" align="center" cellpadding="0" cellspacing="0">
        <tr>
            <td width="15%" height="30" align="right">轮换调用：</td>
            <td width="85%">
			<form id="Label201" name="Label201" method="post" target="ajax" action="LabelBuilder.asp?Type=2&build=201" dataType="text" refreshDiv="BuildResult">
				&nbsp;<select name="Menu" class="input" id="Menu" onchange="ChangeSelect('Select.asp?Type=101&List=list&Id='+$(this).val(),'Module_f201');">
					<option value="{$MenuId$}">当前菜单</option>
					<%=MenuSelect%>
				</select>
				<select name="Module" class="input" id="Module_f201">
					<option value="{$ModuleId$}">当前栏目</option>
				</select>
				<select name="Focus" class="input" id="Focus">
					<%=GetFocusSelect%>
				</select>
				宽度：<input type="text" name="Width" class="input" id="Width" size="5" />
				高度：<input type="text" name="Height" class="input" id="Height" size="5" />
				<input type="submit" class="button" name="button1" id="button1" value="生 成" />
			</form>
			</td>
        </tr>
        <tr>
            <td width="15%" height="30" align="right">字符串截取：</td>
            <td width="85%">
				&nbsp;<input type="text" class="input" size="100" value="{$StrCut(|cutStr_s|要截取的字符串标签|cutStr_e|,截取字数)$}" />
			</td>
        </tr>
        <tr>
            <td width="15%" height="30" align="right">日期格式化：</td>
            <td width="85%">
				&nbsp;<input type="text" class="input" size="100" value="{$DateTimeFormat(时间标签,yyyy-mm-dd hh:nn:ss)$}" /><br />
				&nbsp;yyyy：完整年份，如2013<br />
				&nbsp;yy：简单年份，如13<br />
				&nbsp;mm：月份<br />
				&nbsp;dd：日期<br />
				&nbsp;hh：小时<br />
				&nbsp;nn：分钟<br />
				&nbsp;ss：秒
			</td>
        </tr>
        <tr>
            <td width="15%" height="30" align="right">If标签：</td>
            <td width="85%">
				&nbsp;{$If(参数1,参数2,比较方式)$}<br />
				&nbsp;如果成立输出的HTML<br />
				&nbsp;{$Else$}<br />
				&nbsp;如果不成立输出的HTML<br />
				&nbsp;{$End If$}<br />
				&nbsp;If比较方式支持&lt;/&gt;/=/&gt;=/&lt;=/&lt;&gt;/Mod<br />
				&nbsp;<span style="color:red;">可以没有{$Else$}，另最多支持2级If嵌套。</span>
			</td>
        </tr>
	</table>	
	<p>&nbsp;</p>
	<table width="95%" border="1" bordercolor="#CCCCCC" align="center" cellpadding="0" cellspacing="0">
        <tr>
        	<td height="30" align="center">标签生成结果</td>
       	</tr>
        <tr>
            <td height="30" id="BuildResult">&nbsp;&nbsp;等待生成……</td>
        </tr>
	</table>
</div>
<div id="bottom">
	<input type="button" onclick="dialogClose();" class="button" name="button" id="button" value="关 闭" />
</div>
<%
End Sub

'==========================================
'函 数 名：BuilderDo()
'作    用：模板标签生成器结果
'==========================================
Sub BuilderDo()
	Dim BuildType,BuildStr,TempArr2
	Dim t_Menu,t_Module,t_Recommend,t_Subject,t_Level,t_Recall,t_Order,t_Count,t_FriendsType,t_FriendsShowType,t_State,t_Focus,t_Width,t_Height
	Dim Field_Name,Field_Label
	BuildType=Clng(Request.QueryString("Build"))
	BuildStr=""
	If BuildType=1 Then '全站常规标签
		BuildStr=BuildStr&"&&"&"{$SiteName$}||站点名称"
		BuildStr=BuildStr&"&&"&"{$SiteUrl$}||站点链接"
		BuildStr=BuildStr&"&&"&"{$SiteKeyword$}||站点关键字"
		BuildStr=BuildStr&"&&"&"{$SiteDescription$}||站点描述"
		BuildStr=BuildStr&"&&"&"{$SiteSkin$}||模板路径"
		BuildStr=BuildStr&"&&"&"{$SiteDir$}||站点路径"
		BuildStr=BuildStr&"&&"&"{$SiteBreadCrumb$}||面包屑导航"
		BuildStr=BuildStr&"&&"&"{$NavNow$}||当前主栏目Id"
		'站点设置自定义字段
		Sqlstr="Select Fk_Field_Name,Fk_Field_Label From [Fk_Field] Where Fk_Field_Use=1 Order By Fk_Field_Id Asc"
		Rs.Open Sqlstr,Conn,1,1
		While Not Rs.Eof
			BuildStr=BuildStr&"&&"&"{$SiteField_"&Rs("Fk_Field_Label")&"$}||"&Rs("Fk_Field_Name")&""
			Rs.MoveNext
		Wend
		Rs.Close
	ElseIf BuildType=2 Then '非分页模块常规标签
		BuildStr=BuildStr&"&&"&"{$MenuId$}||所在菜单ID"
		BuildStr=BuildStr&"&&"&"{$MenuName$}||所在菜单名称"
		BuildStr=BuildStr&"&&"&"{$ModuleFId$}||父栏目ID"
		BuildStr=BuildStr&"&&"&"{$ModuleFName$}||父栏目名称"
		BuildStr=BuildStr&"&&"&"{$ModuleFUrl$}||父栏目链接"
		BuildStr=BuildStr&"&&"&"{$ModuleId$}||栏目ID"
		BuildStr=BuildStr&"&&"&"{$ModuleName$}||栏目名称"
		BuildStr=BuildStr&"&&"&"{$ModuleSubTitle$}||栏目副标题"
		BuildStr=BuildStr&"&&"&"{$ModulePic$}||栏目图片"
		BuildStr=BuildStr&"&&"&"{$ModuleUrl$}||栏目链接"
		BuildStr=BuildStr&"&&"&"{$ModuleKeyword$}||栏目关键字"
		BuildStr=BuildStr&"&&"&"{$ModuleDescription$}||栏目描述"
		'菜单项自定义字段
		Sqlstr="Select Fk_Field_Name,Fk_Field_Label From [Fk_Field] Where Fk_Field_Use=2 Order By Fk_Field_Id Asc"
		Rs.Open Sqlstr,Conn,1,1
		While Not Rs.Eof
			BuildStr=BuildStr&"&&"&"{$ModuleField_"&Rs("Fk_Field_Label")&"$}||"&Rs("Fk_Field_Name")&""
			Rs.MoveNext
		Wend
		Rs.Close
	ElseIf BuildType=3 Then '分页模块常规标签
		BuildStr=BuildStr&"&&"&"{$MenuId$}||所在菜单ID"
		BuildStr=BuildStr&"&&"&"{$MenuName$}||所在菜单名称"
		BuildStr=BuildStr&"&&"&"{$ModuleFId$}||父栏目ID"
		BuildStr=BuildStr&"&&"&"{$ModuleFName$}||父栏目名称"
		BuildStr=BuildStr&"&&"&"{$ModuleFUrl$}||父栏目链接"
		BuildStr=BuildStr&"&&"&"{$ModuleId$}||栏目ID"
		BuildStr=BuildStr&"&&"&"{$ModuleName$}||栏目名称"
		BuildStr=BuildStr&"&&"&"{$ModuleSubTitle$}||栏目副标题"
		BuildStr=BuildStr&"&&"&"{$ModulePic$}||栏目图片"
		BuildStr=BuildStr&"&&"&"{$ModuleUrl$}||栏目链接"
		BuildStr=BuildStr&"&&"&"{$ModuleKeyword$}||栏目关键字"
		BuildStr=BuildStr&"&&"&"{$ModuleDescription$}||栏目描述"
		BuildStr=BuildStr&"&&"&"{$ModulePageCode(页码类型)$}||栏目页码代码"
		BuildStr=BuildStr&"&&"&"{$PageFirst$}||第一页URL"
		BuildStr=BuildStr&"&&"&"{$PagePrev$}||上一页URL"
		BuildStr=BuildStr&"&&"&"{$PageNext$}||下一页URL"
		BuildStr=BuildStr&"&&"&"{$PageLast$}||最后一页URL"
		BuildStr=BuildStr&"&&"&"{$PageNow$}||当前页码"
		BuildStr=BuildStr&"&&"&"{$PageCount$}||页数"
		BuildStr=BuildStr&"&&"&"{$PageRecordCount$}||总记录数"
		BuildStr=BuildStr&"&&"&"{$PageSize$}||每页数量"
		'菜单项自定义字段
		Sqlstr="Select Fk_Field_Name,Fk_Field_Label From [Fk_Field] Where Fk_Field_Use=2 Order By Fk_Field_Id Asc"
		Rs.Open Sqlstr,Conn,1,1
		While Not Rs.Eof
			BuildStr=BuildStr&"&&"&"{$ModuleField_"&Rs("Fk_Field_Label")&"$}||"&Rs("Fk_Field_Name")&""
			Rs.MoveNext
		Wend
		Rs.Close
	ElseIf BuildType=4 Then '专题页常规标签
		BuildStr=BuildStr&"&&"&"{$SubjectId$}||专题ID"
		BuildStr=BuildStr&"&&"&"{$SubjectName$}||专题名称"
		BuildStr=BuildStr&"&&"&"{$SubjectAbout$}||专题简介"
		BuildStr=BuildStr&"&&"&"{$SubjectPic$}||专题图片"
		BuildStr=BuildStr&"&&"&"{$SubjectUrl$}||专题链接"
	ElseIf BuildType=5 Then '搜索页常规标签
		BuildStr=BuildStr&"&&"&"{$SearchStr$}||搜索关键字"
		BuildStr=BuildStr&"&&"&"{$SearchPageCode(页码类型)$}||搜索页码代码"
		BuildStr=BuildStr&"&&"&"{$PageFirst$}||第一页链接"
		BuildStr=BuildStr&"&&"&"{$PagePrev$}||上一页链接"
		BuildStr=BuildStr&"&&"&"{$PageNext$}||下一页链接"
		BuildStr=BuildStr&"&&"&"{$PageLast$}||最后一页链接"
		BuildStr=BuildStr&"&&"&"{$PageNow$}||当前页码"
		BuildStr=BuildStr&"&&"&"{$PageCount$}||页数"
		BuildStr=BuildStr&"&&"&"{$PageRecordCount$}||总记录数"
		BuildStr=BuildStr&"&&"&"{$PageSize$}||每页数量"
	ElseIf BuildType=6 Then '内容页常规标签
		t_Menu=FKFun.HTMLEncode(Trim(Request.Form("Menu")))
		t_Module=FKFun.HTMLEncode(Trim(Request.Form("Module")))
		If Not IsNumeric(t_Module) Then
			Call FKFun.ShowErr("&nbsp;&nbsp;请先选择栏目！",2)
		End If
		Sqlstr="Select Fk_Module_Type,Fk_Module_Model From [Fk_Module] Where Fk_Module_Id=" & t_Module
		Rs.Open Sqlstr,Conn,1,1
		If Not Rs.Eof Then
			ModuleType=Rs("Fk_Module_Type")
			ModelId=Rs("Fk_Module_Model")
		Else
			Rs.Close
			Call FKFun.ShowErr("&nbsp;&nbsp;栏目不存在！",2)
		End If
		Rs.Close
		If Instr("0345",ModuleType)>0 Then
			Call FKFun.ShowErr("&nbsp;&nbsp;您选择的不是内容栏目！",2)
		End If
		Sqlstr="Select Fk_Model_Default,Fk_Model_Field From [Fk_Model] Where Fk_Model_Id=" & ModelId
		Rs.Open Sqlstr,Conn,1,1
		If Not Rs.Eof Then
			ModelDefault=Rs("Fk_Model_Default")
			ModelField=Rs("Fk_Model_Field")
		Else
			Rs.Close
			Call FKFun.ShowErr("&nbsp;&nbsp;模型不存在！",2)
		End If
		Rs.Close
		If ModuleType=1 Then
			BuildStr=BuildStr&"&&"&"{$ViewModuleId$}||所在栏目ID"
			BuildStr=BuildStr&"&&"&"{$ViewModuleName$}||所在栏目名称"
			BuildStr=BuildStr&"&&"&"{$ViewModuleSubTitle$}||所在栏目副标题"
			BuildStr=BuildStr&"&&"&"{$ViewModuleKeyword$}||所在栏目关键字"
			BuildStr=BuildStr&"&&"&"{$ViewModuleDescription$}||所在栏目描述"
			BuildStr=BuildStr&"&&"&"{$ViewModuleUrl$}||所在栏目链接"
			BuildStr=BuildStr&"&&"&"{$ViewModulePic$}||所在栏目图片"
			'菜单项自定义字段
			Sqlstr="Select Fk_Field_Name,Fk_Field_Label From [Fk_Field] Where Fk_Field_Use=2 Order By Fk_Field_Id Asc"
			Rs.Open Sqlstr,Conn,1,1
			While Not Rs.Eof
				BuildStr=BuildStr&"&&"&"{$ViewModuleField_"&Rs("Fk_Field_Label")&"$}||所在栏目"&Rs("Fk_Field_Name")&""
				Rs.MoveNext
			Wend
			Rs.Close
						
			BuildStr=BuildStr&"&&"&"{$ViewId$}||内容ID"
			BuildStr=BuildStr&"&&"&"{$ViewTitle$}||标题"
			BuildStr=BuildStr&"&&"&"{$ViewKeyword$}||关键词"
			BuildStr=BuildStr&"&&"&"{$ViewDescription$}||描述"
			BuildStr=BuildStr&"&&"&"{$ViewPic$}||题图小图"
			BuildStr=BuildStr&"&&"&"{$ViewPicBig$}||题图大图"
			BuildStr=BuildStr&"&&"&"{$ViewPicList$}||题图列表"
			BuildStr=BuildStr&"&&"&"{$ViewContent$}||内容"
			BuildStr=BuildStr&"&&"&"{$ViewUrl$}||内容链接"
			BuildStr=BuildStr&"&&"&"{$ViewClick$}||点击量"
			BuildStr=BuildStr&"&&"&"{$ViewTime$}||添加时间"
			BuildStr=BuildStr&"&&"&"{$ViewPrevTitle$}||上一篇标题"
			BuildStr=BuildStr&"&&"&"{$ViewPrevUrl$}||上一篇链接"
			BuildStr=BuildStr&"&&"&"{$ViewPrevPic$}||上一篇图片"
			BuildStr=BuildStr&"&&"&"{$ViewNextTitle$}||下一篇标题"
			BuildStr=BuildStr&"&&"&"{$ViewNextUrl$}||下一篇链接"
			BuildStr=BuildStr&"&&"&"{$ViewNextPic$}||下一篇图片"
			BuildStr=BuildStr&"&&"&"<script type=&quot;text/javascript&quot; src=&quot;{$SiteDir$}Click.asp?Id={$ViewId$}&quot;></script>||计数JS，配合点击量使用"
			
			TempArr=Split(ModelField,"|FieldList|")
			For Each Temp In TempArr
				If Temp<>"" Then
					Field_Name=FKFun.GetSub(Temp,"Field_Name:","|;|Field_Remark:","")
					Field_Label=FKFun.GetSub(Temp,"Field_Label:","|;|Field_Help:","")
					BuildStr=BuildStr&"&&"&"{$ViewField_"&Field_Label&"$}||"&Field_Name
				End If
			Next
		ElseIf ModuleType=2 Then
			BuildStr=BuildStr&"&&"&"{$MenuId$}||所在菜单ID"
			BuildStr=BuildStr&"&&"&"{$MenuName$}||所在菜单名称"
			BuildStr=BuildStr&"&&"&"{$ModuleFId$}||父栏目ID"
			BuildStr=BuildStr&"&&"&"{$ModuleFName$}||父栏目名称"
			BuildStr=BuildStr&"&&"&"{$ModuleFUrl$}||父栏目链接"
			BuildStr=BuildStr&"&&"&"{$ModuleId$}||栏目ID"
			BuildStr=BuildStr&"&&"&"{$ModuleName$}||栏目名称"
			BuildStr=BuildStr&"&&"&"{$ModuleSubTitle$}||栏目副标题"
			BuildStr=BuildStr&"&&"&"{$ModulePic$}||栏目副标题"
			BuildStr=BuildStr&"&&"&"{$ModuleUrl$}||栏目链接"
			BuildStr=BuildStr&"&&"&"{$ModuleKeyword$}||栏目关键字"
			BuildStr=BuildStr&"&&"&"{$ModuleDescription$}||栏目描述"
			BuildStr=BuildStr&"&&"&"{$ModuleContent$}||内容"
			'信息模型字段
			TempArr=Split(ModelField,"|FieldList|")
			For Each Temp In TempArr
				If Temp<>"" Then
					Field_Name=FKFun.GetSub(Temp,"Field_Name:","|;|Field_Remark:","")
					Field_Label=FKFun.GetSub(Temp,"Field_Label:","|;|Field_Help:","")
					BuildStr=BuildStr&"&&"&"{$ModuleInfoField_"&Field_Label&"$}||"&Field_Name
				End If
			Next
			'菜单项自定义字段
			Sqlstr="Select Fk_Field_Name,Fk_Field_Label From [Fk_Field] Where Fk_Field_Use=2 Order By Fk_Field_Id Asc"
			Rs.Open Sqlstr,Conn,1,1
			While Not Rs.Eof
				BuildStr=BuildStr&"&&"&"{$ModuleField_"&Rs("Fk_Field_Label")&"$}||"&Rs("Fk_Field_Name")&""
				Rs.MoveNext
			Wend
			Rs.Close
		End If
	ElseIf BuildType=101 Then '菜单For
		t_Menu=FKFun.HTMLEncode(Trim(Request.Form("Menu")))
		t_Module=FKFun.HTMLEncode(Trim(Request.Form("Module")))
		t_Level=FKFun.HTMLEncode(Trim(Request.Form("Level")))
		t_Recall=FKFun.HTMLEncode(Trim(Request.Form("Recall")))
		BuildStr=BuildStr&"&&"&"{$For(Nav,Menu:"&t_Menu&";Module:"&t_Module&";Level:"&t_Level&";Recall:"&t_Recall&";)$}||For循环开始"
		BuildStr=BuildStr&"&&"&"{$List.NavNo$}||输出序号"
		BuildStr=BuildStr&"&&"&"{$List.NavId$}||栏目ID"
		BuildStr=BuildStr&"&&"&"{$List.NavName$}||栏目名称"
		BuildStr=BuildStr&"&&"&"{$List.NavSubTitle$}||栏目副标题"
		BuildStr=BuildStr&"&&"&"{$List.NavKeyword$}||栏目关键字"
		BuildStr=BuildStr&"&&"&"{$List.NavDescription$}||栏目描述"
		BuildStr=BuildStr&"&&"&"{$List.NavPic$}||栏目图片"
		BuildStr=BuildStr&"&&"&"{$List.NavType$}||栏目类型"
		BuildStr=BuildStr&"&&"&"{$List.NavUrl$}||栏目链接"
		BuildStr=BuildStr&"&&"&"{$List.NavTarget$}||跳转模块target为弹出窗口"
		BuildStr=BuildStr&"&&"&"{$List.NavSubColCount$}||子栏目数量"
		BuildStr=BuildStr&"&&"&"{$List.NavSub$}||二级菜单ul输出"
		BuildStr=BuildStr&"&&"&"{$List.NavContent$}||信息模块栏目内容输出"
		'菜单项自定义字段
		Sqlstr="Select Fk_Field_Name,Fk_Field_Label From [Fk_Field] Where Fk_Field_Use=2 Order By Fk_Field_Id Asc"
		Rs.Open Sqlstr,Conn,1,1
		While Not Rs.Eof
			BuildStr=BuildStr&"&&"&"{$List.NavField_"&Rs("Fk_Field_Label")&"$}||"&Rs("Fk_Field_Name")&""
			Rs.MoveNext
		Wend
		Rs.Close
		BuildStr=BuildStr&"&&"&"{$Next$}||For循环结束"
	ElseIf BuildType=102 Then '内容For
	    Dim t_Pic
		t_Menu=FKFun.HTMLEncode(Trim(Request.Form("Menu")))
		t_Module=FKFun.HTMLEncode(Trim(Request.Form("Module")))
		t_Recommend=FKFun.HTMLEncode(Trim(Request.Form("Recommend")))
		t_Subject=FKFun.HTMLEncode(Trim(Request.Form("Subject")))
		t_Order=FKFun.HTMLEncode(Trim(Request.Form("Order")))
		t_Count=FKFun.HTMLEncode(Trim(Request.Form("Count")))
		t_Pic=FKFun.HTMLEncode(Trim(Request.Form("Pic")))
		If IsNumeric(t_Module) Then
			t_Module=Clng(t_Module)
			If t_Module>0 Then
				Sqlstr="Select Fk_Module_Type,Fk_Module_Model From [Fk_Module] Where Fk_Module_Id=" & t_Module
				Rs.Open Sqlstr,Conn,1,1
				If Not Rs.Eof Then
					ModuleType=Rs("Fk_Module_Type")
					ModelId=Rs("Fk_Module_Model")
				Else
					ModuleType=1
					ModelId=0
				End If
				Rs.Close
				
				Sqlstr="Select Fk_Model_Field From [Fk_Model] Where Fk_Model_Type=" & ModuleType & " And Fk_Model_Id=" & ModelId
				Rs.Open Sqlstr,Conn,1,1
				If Not Rs.Eof Then
					ModelField=Rs("Fk_Model_Field")
				Else
					ModelField=""
				End If
				Rs.Close
			Else
				ModelField=""
			End If
		Else
			ModuleType=1
			ModelField=""
		End If
		
		If Instr("02345",ModuleType)>0 Then
			Call FKFun.ShowErr("&nbsp;&nbsp;您选择的不是内容栏目！",2)
		End If
		BuildStr=BuildStr&"&&"&"{$For(View,Menu:"&t_Menu&";Module:"&t_Module&";Recommend:"&t_Recommend&";Subject:"&t_Subject&";Order:"&t_Order&";Count:"&t_Count&";Pic:"&t_Pic&";)$}||For循环开始"
		BuildStr=BuildStr&"&&"&"{$List.ViewNo$}||输出序号"
		BuildStr=BuildStr&"&&"&"{$List.ViewPageNo$}||输出序号（带分页）"
		BuildStr=BuildStr&"&&"&"{$List.ViewModuleId$}||所在栏目ID"
		BuildStr=BuildStr&"&&"&"{$List.ViewModuleName$}||所在栏目名称"
		BuildStr=BuildStr&"&&"&"{$List.ViewModuleUrl$}||所在栏目链接"
		BuildStr=BuildStr&"&&"&"{$List.ViewId$}||内容ID"
		BuildStr=BuildStr&"&&"&"{$List.ViewTitle$}||标题"
		BuildStr=BuildStr&"&&"&"{$List.ViewTitleInColor$}||附带颜色的标题"
		BuildStr=BuildStr&"&&"&"{$List.ViewKeyword$}||关键词"
		BuildStr=BuildStr&"&&"&"{$List.ViewDescription$}||描述"
		BuildStr=BuildStr&"&&"&"{$List.ViewPic$}||题图小图"
		BuildStr=BuildStr&"&&"&"{$List.ViewPicBig$}||题图大图"
		BuildStr=BuildStr&"&&"&"{$List.ViewPicList$}||题图列表"
		BuildStr=BuildStr&"&&"&"{$List.ViewContent$}||内容"
		BuildStr=BuildStr&"&&"&"{$List.ViewUrl$}||内容链接"
		BuildStr=BuildStr&"&&"&"{$List.ViewTarget$}||跳转模块target为弹出窗口"
		BuildStr=BuildStr&"&&"&"{$List.ViewStick$}||是否置顶"
		BuildStr=BuildStr&"&&"&"{$List.ViewClick$}||点击量"
		BuildStr=BuildStr&"&&"&"{$List.ViewTime$}||添加时间"
		BuildStr=BuildStr&"&&"&"{$List.ViewNew$}||发布天数"
		TempArr=Split(ModelField,"|FieldList|")
		For Each Temp In TempArr
			If Temp<>"" Then
				Field_Name=FKFun.GetSub(Temp,"Field_Name:","|;|Field_Remark:","")
				Field_Label=FKFun.GetSub(Temp,"Field_Label:","|;|Field_Help:","")
				BuildStr=BuildStr&"&&"&"{$List.ViewField_"&Field_Label&"$}||"&Field_Name
			End If
		Next
		BuildStr=BuildStr&"&&"&"{$Next$}||For循环结束"
	ElseIf BuildType=103 Then '友情链接For
		t_FriendsType=FKFun.HTMLEncode(Trim(Request.Form("FriendsType")))
		t_FriendsShowType=FKFun.HTMLEncode(Trim(Request.Form("FriendsShowType")))
		t_Count=FKFun.HTMLEncode(Trim(Request.Form("Count")))
		If t_FriendsType="" Then
			Call FKFun.ShowErr("&nbsp;&nbsp;请选择友情链接类型！",2)
		End If
		BuildStr=BuildStr&"&&"&"{$For(Friends,FriendsType:"&t_FriendsType&";FriendsShowType:"&t_FriendsShowType&";Count:"&t_Count&";)$}||For循环开始"
		BuildStr=BuildStr&"&&"&"{$List.FriendsNo$}||输出序号"
		BuildStr=BuildStr&"&&"&"{$List.FriendsName$}||站点名称"
		BuildStr=BuildStr&"&&"&"{$List.FriendsAbout$}||站点简介"
		BuildStr=BuildStr&"&&"&"{$List.FriendsUrl$}||站点链接"
		BuildStr=BuildStr&"&&"&"{$List.FriendsLogo$}||LOGO"
		BuildStr=BuildStr&"&&"&"{$Next$}||For循环结束"
	ElseIf BuildType=104 Then '留言For
		t_Menu=FKFun.HTMLEncode(Trim(Request.Form("Menu")))
		t_Module=FKFun.HTMLEncode(Trim(Request.Form("Module")))
		t_State=FKFun.HTMLEncode(Trim(Request.Form("State")))
		t_Count=FKFun.HTMLEncode(Trim(Request.Form("Count")))
		If Not IsNumeric(t_Module) Then
			Call FKFun.ShowErr("&nbsp;&nbsp;请先选择栏目！",2)
		End If
		Sqlstr="Select Fk_Module_Type,Fk_Module_Model From [Fk_Module] Where Fk_Module_Id=" & t_Module
		Rs.Open Sqlstr,Conn,1,1
		If Not Rs.Eof Then
			ModuleType=Rs("Fk_Module_Type")
			ModelId=Rs("Fk_Module_Model")
		Else
			Rs.Close
			Call FKFun.ShowErr("&nbsp;&nbsp;栏目不存在！",2)
		End If
		Rs.Close
		
		If Instr("01245",ModuleType)>0 Then
			Call FKFun.ShowErr("&nbsp;&nbsp;您选择的不是留言栏目！",2)
		End If
		Sqlstr="Select Fk_Model_Default,Fk_Model_Field From [Fk_Model] Where Fk_Model_Id=" & ModelId
		Rs.Open Sqlstr,Conn,1,1
		If Not Rs.Eof Then
			ModelField=Rs("Fk_Model_Field")
		Else
			Rs.Close
			Call FKFun.ShowErr("&nbsp;&nbsp;模型不存在！",2)
		End If
		Rs.Close
		BuildStr=BuildStr&"&&"&"{$For(GBook,Menu:"&t_Menu&";Module:"&t_Module&";State:"&t_State&";Count:"&t_Count&";)$}||For循环开始"
		BuildStr=BuildStr&"&&"&"{$List.GBookNo$}||输出序号"
		BuildStr=BuildStr&"&&"&"{$List.GBookPageNo$}||输出序号（带分页）"
		BuildStr=BuildStr&"&&"&"{$List.GBookModuleId$}||所在栏目ID"
		BuildStr=BuildStr&"&&"&"{$List.GBookModuleName$}||所在栏目名称"
		BuildStr=BuildStr&"&&"&"{$List.GBookId$}||内容ID"
		TempArr=Split(ModelField,"|FieldList|")
		For Each Temp In TempArr
			If Temp<>"" Then
				Field_Name=FKFun.GetSub(Temp,"Field_Name:","|;|Field_Label:","")
				Field_Label=FKFun.GetSub(Temp,"Field_Label:","|;|Field_StrMin:","")
				BuildStr=BuildStr&"&&"&"{$List."&Field_Label&"$}||"&Field_Name
			End If
		Next
		BuildStr=BuildStr&"&&"&"{$List.GBookTime$}||留言时间"
		BuildStr=BuildStr&"&&"&"{$List.GBookReply$}||回复状态"
		BuildStr=BuildStr&"&&"&"{$List.GBookReplyStr$}||回复内容"
		BuildStr=BuildStr&"&&"&"{$List.GBookReplyTime$}||回复时间"
		BuildStr=BuildStr&"&&"&"{$Next$}||For循环结束"
	ElseIf BuildType=105 Then '专题For
		t_Count=FKFun.HTMLEncode(Trim(Request.Form("Count")))
		BuildStr=BuildStr&"&&"&"{$For(Subject,Count:"&t_Count&";)$}||For循环开始"
		BuildStr=BuildStr&"&&"&"{$List.SubjectNo$}||输出序号"
		BuildStr=BuildStr&"&&"&"{$List.SubjectName$}||名称"
		BuildStr=BuildStr&"&&"&"{$List.SubjectPic$}||图片"
		BuildStr=BuildStr&"&&"&"{$List.SubjectUrl$}||链接"
		BuildStr=BuildStr&"&&"&"{$Next$}||For循环结束"
	ElseIf BuildType=106 Then '题图For
		BuildStr=BuildStr&"&&"&"{$For(Pic,List:题图标签;)$}||For循环开始"
		BuildStr=BuildStr&"&&"&"{$List.PicNo$}||输出序号"
		BuildStr=BuildStr&"&&"&"{$List.PicSmall$}||小图"
		BuildStr=BuildStr&"&&"&"{$List.PicBig$}||大图"
		BuildStr=BuildStr&"&&"&"{$List.PicText$}||图片文字"
		BuildStr=BuildStr&"&&"&"{$Next$}||For循环结束"
	ElseIf BuildType=107 Then
		BuildStr=BuildStr&"&&"&"{$For(NumList,1/10)$}||For循环开始"
		BuildStr=BuildStr&"&&"&"{$ListNo$}||序号"
		BuildStr=BuildStr&"&&"&"{$Next$}||For循环结束"
	ElseIf BuildType=108 Then '轮换图片For
		t_Count=FKFun.HTMLEncode(Trim(Request.Form("FocusID")))
		BuildStr=BuildStr&"&&"&"{$For(Focus,FocusID:"&t_Count&";)$}||For循环开始"
		BuildStr=BuildStr&"&&"&"{$List.FocusNo$}||输出序号"
		BuildStr=BuildStr&"&&"&"{$List.FocusText$}||标题"
		BuildStr=BuildStr&"&&"&"{$List.FocusPic$}||轮换图片"
		BuildStr=BuildStr&"&&"&"{$List.FocusUrl$}||轮换链接"
		BuildStr=BuildStr&"&&"&"{$Next$}||For循环结束"	
	ElseIf BuildType=201 Then '轮换代码
		t_Menu=FKFun.HTMLEncode(Trim(Request.Form("Menu")))
		t_Module=FKFun.HTMLEncode(Trim(Request.Form("Module")))
		t_Focus=FKFun.HTMLEncode(Trim(Request.Form("Focus")))
		t_Width=FKFun.HTMLEncode(Trim(Request.Form("Width")))
		t_Height=FKFun.HTMLEncode(Trim(Request.Form("Height")))
		If Not IsNumeric(t_Menu) Then
			Call FKFun.ShowErr("&nbsp;&nbsp;请先选择菜单！",2)
		End If
		If Not IsNumeric(t_Module) Then
			Call FKFun.ShowErr("&nbsp;&nbsp;请先选择栏目！",2)
		End If
		If Not IsNumeric(t_Width) Then
			Call FKFun.ShowErr("&nbsp;&nbsp;宽度必须是数字！",2)
		End If
		If Not IsNumeric(t_Height) Then
			Call FKFun.ShowErr("&nbsp;&nbsp;高度必须是数字！",2)
		End If
		BuildStr=BuildStr&"&&"&"<script type=&quot;text/javascript&quot; src=&quot;{$SiteDir$}Plugin/FlashFocus/"&t_Focus&"/focus.asp?Type=0&Menu="&t_Menu&"&Module="&t_Module&"&Width="&t_Width&"&Height="&t_Height&"&quot;></script>||轮换调用代码"
	End If
	TempArr=Split(BuildStr,"&&")
	For Each Temp In TempArr
		If Temp<>"" Then
			TempArr2=Split(Temp,"||")
%>
<p><input type="text" class="input" size="96" value="<%=TempArr2(0)%>" />&nbsp;<%=TempArr2(1)%></p>
<%
		End If
	Next
End Sub

Call FKFun.PageEnd()
%>
