<%
'=================================================
'XYCMS企业建站系统 版权所有 技术支持QQ：364500483
'=================================================
if on_run=1 then
response.Write off_dc
response.End()
end if
'=================================================
'函数名：xycms_menu
'功能：导航菜单内容调用
'调用参数：xyview,是否显示；xytid,菜单位置
'=================================================
function xycms_menu(xyview)
dim menu
set menu=server.CreateObject("adodb.recordset")
menu.open "select * from menu where view="&xyview&" and Pid=0 order by pl_id asc",conn,1,1
while not menu.eof %>
<li class="nav_li"><a href="<%=menu("url")%>" target="<%=menu("open_m")%>" class="menu" title="<%=menu("title")%>"><%=menu("title")%></a>
<% set menu1=server.CreateObject("adodb.recordset")
  menu1.open "select * from menu where view=1 and Pid="&menu("id")&" order by pl_id asc",conn,1,1
  if menu1.eof or menu1.bof then
  response.Write("</li>")
  else
   %>
<ul class="sub_nav">
  <% do while not menu1.eof %>
  <li><a href="<%=menu1("url")%>" target="_self"><%=menu1("title")%></a></li>
<%
menu1.movenext
loop
%>
</ul>
<% end if%>
</li>
<% menu.movenext
wend
menu1.close
set menu1=nothing
menu.close
set menu=nothing
end function

'=================================================
'函数名：xycms_flash
'功能：焦点图调用
'调用参数：xypicw,长度；xypich,宽度
'=================================================
function xycms_flash(xypicw,xypich,ssfl) %>
<script type="text/javascript">
	var swf_width=<%=xypicw%>;
	var swf_height=<%=xypich%>;
	//-- 标签调用设置 焦点图片自动播放时间(秒)|文字颜色|文字背景色|文字背景透明度|按键数字颜色|当前按键颜色|普通按键色彩 XYCMS --
	var config='5|0xffffff|0x97210a|40|0xffffff|0x666666|0x000000';
	var files='',links='', texts='';
	<% Set xy_rs = server.CreateObject("adodb.recordset")
          xy_sql = "select * from [news] where len(img)>4 and ssfl="&ssfl&" and tuijian=1 order by id desc"
       xy_rs.Open xy_sql, conn, 1, 1
       do while not xy_rs.EOF
       response.Write("files+='|"&xy_rs("img")&"';links+='|news_detail.asp?id="&xy_rs("id")&"';texts+='|"&xy_rs("title")&"';")
       xy_rs.moveNext
       loop
       xy_rs.Close
       set xy_rs = nothing %>
	   files=files.substring(1);
	   links=links.substring(1);
	   texts=texts.substring(1);
	   document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"                codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ swf_width +'" height="'+ swf_height +'">');
	   document.write('<param name="movie" value="images/xy_cms.swf" />');
	   document.write('<param name="quality" value="high" />');
       document.write('<param name="menu" value="false" />');
	   document.write('<param name=wmode value="opaque" />');
	   document.write('<param name="FlashVars" value="config='+config+'&bcastr_flie='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'" />');
	   document.write('<embed src="images/xy_cms.swf" wmode="opaque" FlashVars="config='+config+'&bcastr_flie='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'& menu="false" quality="high" width="'+ swf_width +'" height="'+ swf_height +'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	   document.write('</object>');
</script> 
<% end function

'=================================================
'函数名：xycms_commonlist
'功能：简介分类
'调用参数：无
'=================================================
function xycms_commonlist()
set commonlist=server.CreateObject("adodb.recordset")
commonlist.open "select * from [common] order by id asc",conn,1,1
if commonlist.eof and commonlist.bof then
response.Write("&nbsp;暂无记录 !")
end if
while not commonlist.eof
response.Write("<li><a href=""common.asp?id="&commonlist("id")&""" title=""" & commonlist("title") &""">"  & commonlist("title") & "</a></li>")
commonlist.movenext
wend
commonlist.close
set commonlist=nothing
end function

'=================================================
'函数名：xycms_link
'功能：友情链接
'调用参数：无
'=================================================
function xycms_link()
set link=server.CreateObject("adodb.recordset")
link.open "select * from [link] order by pl_id asc",conn,1,1
if link.eof and link.bof then
response.Write("&nbsp;暂无记录 !")
end if
while not link.eof 
response.Write("<option value="""&link("url")&""" style=""text-align:center;"">"&link("title")&"</option>")
link.movenext
wend
link.close
set commonlist=nothing
end function

'=================================================
'函数名：xycms_nlist
'功能：信息列表
'调用参数：
'=================================================
function xycms_nlist(topnum,id)
set nlist=server.createobject("adodb.recordset") 
sql="select top "&topnum&" * from [news] where ssfl="&id&" order by id desc"
nlist.open sql,conn,1,1
if nlist.eof and nlist.bof then
response.Write("<li>暂无信息记录 !</li>")
else
do while not nlist.eof
response.Write("<li><a href=""news_detail.asp?id="&nlist("id")&""" title="""&nlist("title")&""" target=""_blank"">"&left(nlist("title"),18)&"</a></li>")
nlist.movenext
loop
end if
nlist.close
set nlist=nothing
end function

'=================================================
'函数名：xycms_news
'功能：新闻内容
'调用参数：xytop,调用条数；xytitle,标题字数；xyfl，新闻分类；xytj，是否推荐；xyorder，排列顺序
'=================================================
function xycms_news(xytop,xytitle,xyfl,xytj,xyorder)
Dim xycms_fl,xycms_tj,xycms_order
select case xyfl
       case 0
	   xycms_fl=""
	   case else
	   xycms_fl="and ssfl="&xyfl&""
end select
select case xytj
       case 0
	   xycms_tj=""
	   case 1
	   xycms_tj="and tuijian=1"
	   case else
	   xycms_tj=""
end select
select case xyorder
       case 0
	   xycms_order="order by id desc"
	   case 1
	   xycms_order="order by hit desc"
	   case else
	   xycms_order=""
end select
set news=server.CreateObject("adodb.recordset")
  sql="select top "&xytop&" * from [news] where passed=1 "&xycms_fl&" "&xycms_tj&" "&xycms_order&""
news.open sql,conn,1,1
if news.eof and news.bof then
response.Write("&nbsp;暂无该新闻内容 !")
else
while not news.eof
dim url,color
if IsNull(news("url")) or trim(news("url")&"")="" then
url="news_detail.asp?id="&news("id")&""
else
url=""&news("url")&""
end if
if IsNull(news("color")) or trim(news("color")&"")="" then
color="#4D4D4D"
else
color=""&news("color")&""
end if 
%>
<li><span>[<%=formatdatetime(news("data"),2)%>]</span><a href="<%=url%>" style="color:<%=color%>;" title="<%=news("title")%>"><%=left(news("title"),xytitle)%></a></li>
<% news.movenext
wend
news.close
set news=nothing
end if
end function 


'=================================================
'函数名：xycms_newsfllist
'功能：新闻分类
'=================================================
function xycms_newsfllist()
set newsfl=server.CreateObject("adodb.recordset")
newsfl.open "select * from [news_fl] order by id asc",conn,1,1
if newsfl.eof and newsfl.bof then
response.Write("<li>&nbsp;暂无信息记录 !</li>")
end if
while not newsfl.eof
response.Write("<li><a href=""news.asp?id="&newsfl("id")&""" title=""" & newsfl("title") &""">"  & newsfl("title") & "</a> </li>")
newsfl.movenext
wend
newsfl.close
set newsfl=nothing
end function

'=================================================
'函数名：xycms_xyfg
'=================================================
function xycms_xyfg()
set xyfg=server.CreateObject("adodb.recordset")
xyfg.open "select * from [xyfg] order by id desc",conn,1,1
if xyfg.eof and xyfg.bof then
response.Write("<li>&nbsp;暂无信息记录 !</li>")
end if
while not xyfg.eof %>
<li>
                  <a href="show_detail.asp?id=<%=xyfg("id")%>" title="<%=xyfg("title")%>"><img src="<%=xyfg("img")%>" width='144' height='112' alt="<%=xyfg("title")%>"></a>
                  <p class="Blue"><a href="show_detail.asp?id=<%=xyfg("id")%>" title="<%=xyfg("title")%>"><%=left(xyfg("title"),10)%></a></p>
                </li>
<%                
xyfg.movenext
wend
xyfg.close
set xyfg=nothing
end function

'=================================================
'函数名：xycms_teamimg
'功能：首页师资团队
'调用参数：xytop,调用条数；xytitle,标题字数
'=================================================
function xycms_teamimg()
set teamimg=server.createobject("adodb.recordset") 
exec="select * from  [tech_zr] where len(img)>4 order by id desc  " 
teamimg.open exec,conn,1,1 
if teamimg.eof and teamimg.bof then
response.Write("<li>暂无信息记录!</li>")
else
do while not teamimg.eof
%>
              <td>
                <div class="s">
                  <div class="pics"><a <a href="team_detail.asp?id=<%=teamimg("id")%>"><img src="<%=teamimg("img")%>" alt="<%=teamimg("szname")%>" width="116" height="140" /></a></div>
                  <div class="infos">
                    <p><span class="item">姓名：</span><a href="team_detail.asp?id=<%=teamimg("id")%>"><span class="position"><%=teamimg("szname")%></span></a></p>
                    <p><span class="item">简介：</span><%=teamimg("jianjie")%></p>
                  </div>
                </div>
              </td> 
<%
teamimg.movenext 
loop 
end if
teamimg.close
set teamimg=nothing
end function
%>
