📄 newscode.asp
字号:
<!--#include file="setup.asp" -->
<html>
<head>
<title>新闻代码生成器</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
.highlighttext{
background-color:yellow;
font-weight:bold;
}
</style>
<link rel="stylesheet" href="style.css" type="text/css">
<script language="javascript">
function makecode(){
var news_location="<%=news_location%>news.asp";
if(form1.num.value!=""){
news_location+= "?num=" + form1.num.value;
}
else{
news_location+= "?num=15";
}
if(form1.cata.value!=""){
news_location+="&cata=" + form1.cata.value;
}
if(form1.showtime.status == true){
news_location+="&showtime=yes";
}
if(form1.showclick.status == true){
news_location+="&showclick=yes";
}
news_location="<"+"script "+"language=\"javascript\" src=\""+news_location+"\"><"+"/script"+">";
form1.code.value=news_location;
}
</script>
</script>
</head>
<body bgcolor="#FFFFFF">
<script language="Javascript">
<!--
/*
Highlight and Copy form element script- By Dynamicdrive.com
For full source, Terms of service, and 100s DTHML scripts
Visit http://www.dynamicdrive.com
*/
//specify whether contents should be auto copied to clipboard (memory)
//Applies only to IE 4+
//0=no, 1=yes
var copytoclip=1
function HighlightAll(theField) {
var tempval=eval("document."+theField)
tempval.focus()
tempval.select()
if (document.all&©toclip==1){
therange=tempval.createTextRange()
therange.execCommand("Copy")
alert("\n新闻代码已经拷贝到你的剪贴板上了!\n\n请按Ctrl+V将其粘贴到适当的位置。");
}
}
//-->
</script>
<form name="form1">
<div align="center"><%=news_title%> - 新闻代码生成器
<table width="88%" border="0">
<tr>
<td>新闻条数:
<input type="text" name="num" size="4" maxlength="3" value="15">
(默认显示15条)</td>
</tr>
<tr>
<td>显示时间:
<input type="checkbox" name="showtime" value="yes">
是 (在新闻标题后面显示时间,默认不显示)</td>
</tr>
<tr>
<td>显示点击:
<input type="checkbox" name="showclick" value="yes">
是 (在新闻标题后面显示点击数目,默认不显示)</td>
</tr>
<tr>
<td>新闻类别:
<select name="cata">
<%
dim rs,sql
set rs=server.createobject("adodb.recordset")
sql="select * from category"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<option value=''>没有分类</option>"
else
response.write "<option value=''>全部新闻</option>"&vbcrlf
response.write "<option value='special'>特别新闻</option>"&vbcrlf
do while not rs.eof
response.write "<option value='"&rs("id")&"'"
if request("cataid")<>"" then
if rs("id")=cint(request("cataid")) then response.write " selected "
end if
response.write ">"&rs("title")&"</option>"&vbcrlf
rs.movenext
loop
end if
rs.close
set rs=nothing
endconnection
%>
</select>
(默认显示全部新闻,也可以只选择某类别新闻)</td>
</tr>
<tr>
<td>
<div align="center">
<hr noshade size="1">
<input type="button" name="Button" value="生成代码" onclick="makecode()">
<input type="button" name="Button" value="选择全部" onclick="form1.code.select()">
<input type="button" name="Submit2" value="复制到剪贴板" onclick="HighlightAll('form1.code')">
<input type="reset" name="Reset" value="默认代码">
<input type="button" name="Button" value="代码演示" onclick="window.open('example.htm')">
<input type="button" name="Button" value="全部清空" onclick="form1.code.value=''">
</div>
</td>
</tr>
<tr>
<td>
<div align="center">
<textarea name="code" cols="72" rows="5"><script language="javascript" src="<%=news_location%>news.asp"></script></textarea>
</div>
</td>
</tr>
<tr>
<td>
<div align="center">[<a href="admin.asp">返回管理</a>] [<a href="default.asp">返回主页</a>]
[<a href="addnews.asp">增加新闻</a>] [<a href="addcata.asp">管理类别</a>]
[<a href="userpass.asp">管理用户</a>]</div>
</td>
</tr>
</table>
</div>
</form>
<script language="JavaScript">
document.write("<hr width='80%' size='1'>");
document.write("<div align='center' style=fontsize:9pt;><font face='Verdana, Arial, Helvetica, sans-serif'>");
document.write("<a href=<%=homepage_link%> target=_blank><font color=red><%=homepage_title%></font></a> - <a href=<%=news_location%>\default.asp><font color=black><%=news_title%></font></a><br>");
document.write("<font face='Verdana, Arial, Helvetica, sans-serif' color='#000000'>");
document.write("Copyright</font><font face='Verdana, Arial, Helvetica, sans-serif' color='#FF0000'> ");
document.write("<font color='#0000FF'>©</font></font>");
document.write("<font face='Verdana, Arial, Helvetica, sans-serif' color='#000000'>By ");
document.write("<a href=http://www.qbtrade.com target=_blank>QBTrade<font color='#0000FF'>™</font> Group</a>, 2000.8.30</font><font face='Verdana, Arial, Helvetica, sans-serif'>");
document.write("<br><font color='#000000'>All rights Reserved</font>");
</script>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -