⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 class.asp

📁 依悠广告管理系统 V1.1 使用帮助 V1.1 更新情况(2008.03.22) ======================= 1.更新图片调用不能显示问题. 2.不能编辑问题
💻 ASP
字号:
<!--#include file="conn.asp" -->
<!--#include file = "mp.asp" -->
<%
Dim ID,menu,title,content,intime,width,height,Rs,P
Set Rs = Server.CreateObject("adodb.recordset")
	menu = Request.QueryString("menu")
	ID = Request.QueryString("ID")
	title = Request.Form("title")
	content = Request.Form("content")
	intime = Request.Form("intime")
	width = Request.Form("width")
	height = Request.Form("height")
	P = CLng(Request("P")) '分页显示 	

Function chkhtm(stra)
   stra = Replace(stra,"<","&lt;")
   stra = Replace(stra,">","&gt;")
   stra = Replace(stra,"'","")
   stra = Replace(stra,"(","(")
   stra = Replace(stra,")",")")
   stra = Replace(stra,";",";")
   stra = Replace(stra,",",",")
   stra = Replace(stra,"%","%")
   stra = Replace(stra,"+","+")
   chkhtm=stra
End Function

Sub list
%>
<table width="100%" border="0" align="center" style="text-align:center" cellpadding="2" cellspacing="1" bordercolor="#C2CEDA">
	<tr align="center">
		<th width="35" height="25">ID</th>
		<th width="255" height="25">广告位置标题及说明</th>
		<th width="110" height="25">广告的尺寸宽*高</th>
		<th width="120" height="25">添加时间</th>
		<th width="120" height="25">广告操作</th>
	</tr>
<%
	Rs.open "select * from tt_ad order by a_id",conn,1,1
	Rs.PageSize =20 '设置一页显示20条记录 
	If Not P >1 Then P = 1 
	PCount = Rs.PageCount
	If P > PCount Then P = PCount 
	Rs.AbsolutePage = P 
	For i=1 To Rs.PageSize 
	If Rs.eof Then Exit For 
%>	
	<tr>
		<td height="25" bgcolor="#fafbfc"><%=Rs("a_id")%></td>
		<td height="25" bgcolor="#fafbfc"><%=Rs("a_title")%></td>		
		<td height="25" bgcolor="#fafbfc"><%=Rs("a_width")%>*<%=rs("a_height")%></td>
		<td height="25" bgcolor="#fafbfc"><%=Rs("a_intime")%></td>
		<td height="25" bgcolor="#fafbfc"><a href="?menu=ADedit&ID=<%=Rs("a_id")%>">编辑</a> | <a href="?menu=del&ID=<%=Rs("a_id")%>" onClick="return window.confirm('确认执行此操作?')">删除</a> | <a href="?menu=dy&ID=<%=Rs("a_id")%>">预览</a></td>
	</tr>
<%
 	Rs.movenext
	Next
	Rs.close
%>
</table>
	<%If P <> 1 Then%> 
		<a href="">首页</a> 
		<a href="">上一页</a>
	<%Else%>
		首页
		上一页
	<%End If%>
	<%If P <> PCount Then%> 
		<a href=''>下一页</a>
		<a href=''>尾页</a>
	<%Else%>
		下一页
		尾页
	<%End If%>
		页次:<%=P%>/<%=PCount%>页  
		<%=Rs.PageSize%>记录/页 转到:
<select name="sel_page" onChange="javascript:location=this.options[this.selectedIndex].value;"> 
<% 
	For j = 1 to PCount 
	If j = P Then%> 
	<option value="?P=<%=j%>" selected><%=j%></option> 
	<%Else%> 
	<option value="?P=<%=j%>"><%=j%></option> 
<% 
	End If 
	Next 
%> 
	</select>页
<%
End Sub

Function finddir(filepath)
	finddir=""
	for i=1 to len(filepath)
	if left(right(filepath,i),1)="/" or left(right(filepath,i),1)="\" then
	  abc=i
	  exit for
	end if
	next
	if abc <> 1 then
	finddir=left(filepath,len(filepath)-abc+1)
	end if
end Function

Sub dy
	If ID > 0 Then
	Rs.Open "select * from tt_ad where a_id="&ID,Conn,1,1
%>
<br />
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1">
<tr><th>广告代码调用</th></tr>
<tr><td  bgcolor="#fafbfc">
<textarea onmouseover=this.select(); onClick="this.select();js=this.createTextRange();js.execCommand('Copy');alert('代码复制成功,直接在需要插入广告的地方粘贴');" cols="100" rows="4">&lt;script src='<%=finddir(request.servervariables("URL"))%>dy.asp?id=<%=id%>&amp;menu=js' language='JavaScript' charset='gb2312'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;iframe name='ad<%=id%>' src='<%=finddir(request.servervariables("URL"))%>dy.asp?id=<%=id%>&amp;menu=htm' marginwidth=1 marginheight=1 width='<%=Rs("a_width")%>' height='<%=Rs("a_height")%>' scrolling='no'border='0' frameborder='0'&gt;&lt;/iframe&gt;&lt;/noscript&gt;</textarea>
</td></tr>
<tr><th>代码内容预览</th></tr>
<tr><td  bgcolor="#fafbfc">
<div style="width:760px; height:auto; margin:auto; overflow:auto;"><%=Rs("a_content")%></div>
</td></tr>
</table>
<%
	End If
	Rs.close
End Sub

Sub ADedite
	If ID > 0 Then
	Rs.Open "select * from tt_ad where a_id="&ID,Conn,1,3
	If Not Rs.eof Then
		Rs("a_title") = title
		Rs("a_content") = content
		Rs("a_intime") = intime
		Rs("a_width") = width
		Rs("a_height") = height
	Rs.update
	Rs.close
	Response.Write "<script>alert('更新成功');document.location.href=""admin.asp"";</script>"
	End If
	End If
End Sub

Sub ADedit
	If id > 0 Then
		Rs.Open "tt_ad where a_id="&ID,Conn,1,1
		If Not Rs.eof Then
%>
<TABLE width="100%" border="0" align="center"  cellpadding="2" cellspacing="1">
<tr><th>编辑广告</th></tr>
<TR><TD bgcolor="#fafbfc">
<form method="post" action="?menu=ADedite&ID=<%=Rs("a_ID")%>">
<p align="left">广告位标题及说明:<input name="title" type="text" value="<%=Rs("a_title")%>" size="30"/></p>
<p align="left">添加时间:<input name="intime" type="text" value="<%=Rs("a_intime")%>" size="18"/>
 宽度:<input name="width" type="text" size="15" value="<%=Rs("a_width")%>" maxlength="10"/>
 高度:<input name="height" type="text" size="15" value="<%=Rs("a_height")%>" maxlength="10"/></p>
<p align="left">广告内容代码:</p>
<p align="left"><textarea name="content" id="content" style="width:700px; height:100px;"> <%=Rs("a_content")%></textarea></p>	  
<p align="center"><div style="margin:auto; text-align:center;"> <input type="submit" align="middle" value=" 编 辑 "/>   <input type="reset" align="middle" value=" 重 填 "/> </div></p>
</form></TD></TR></TABLE>
<%
	End If
	Rs.close
	End If
End Sub

Sub ADdel
	Rs.open "select * from tt_ad where a_id="&ID,conn,1,3
	Rs.delete
	Rs.close
	Response.Write "<script>alert('删除成功');document.location.href=""admin.asp"";</script>"
End Sub

Sub ADadde
	Rs.open "select * from tt_ad",conn,3,2
	Rs.addnew
	Rs("a_title") = title
	Rs("a_content") = content
	Rs("a_intime") = intime
	Rs("a_width") = width
	Rs("a_height") = height
	Rs.update
	Rs.close
	Response.Write "<script>alert('添加成功');history.go(-1);</script>"
End Sub

Sub ADadd
%>
<TABLE width="100%" border="0" align="center"  cellpadding="2" cellspacing="1">
<tr><th>添加广告</th></tr>
<TR><TD bgcolor="#fafbfc">
<form method="post" action="?menu=ADadde">
<p align="left">广告位标题及说明:<input name="title" type="text" size="30"/></p>
<p align="left">添加时间:<input name="intime" type="text" value="<%=date()%>" size="18"/>
 宽度:<input name="width" type="text" size="15" maxlength="10"/>
 高度:<input name="height" type="text" size="15" maxlength="10"/></p>
<p align="left">广告内容代码:</p>
<p align="left"><textarea name="content" id="content" style="width:700px; height:100px;"></textarea></p>	  
<p align="center"><div style="margin:auto; text-align:center;"> <input type="submit" align="middle" value=" 确 定 "/>   <input type="reset" align="middle" value=" 重 填 "/> </div></p>
</form></TD></TR></TABLE>
<%
End Sub

Sub Help
%>
<TABLE width="100%" border="0" align="center"  cellpadding="2" cellspacing="1">
<tr><th>使用帮助</th></tr>
<TR><TD bgcolor="#fafbfc">
<div style="padding:0 20px 0 0;">
<p>依悠广告管理系统 V1.1 使用帮助<br />
帮助你把网站上的所有广告按照广告大小或位置进行分类管理,然后用本系统分配的固定Scrip代码调用设置广告,获取代码请点广告管理的预览。<br>
把做好的广告代码添加进数据库里,点广告操作里的预览获取系统自动分配的Script代码!<br></p>
<ol>
	<li><b>插入文字广告链接的代码:</b><br>&lt;a href=&quot;<font color="#FF0000">文字链接</font>&quot; target=&quot;_blank&quot;&gt;<font color="#FF0000">文字</font>&lt;/a&gt;</li>
	<li><b>插入图片广告链接的代码:</b><br>&lt;a href=&quot;<font color="#FF0000">图片链接地址</font>&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;<font color="#FF0000">图片地址</font>&quot; width=&quot;<font color="#FF0000">图片宽度</font>&quot; height='<font color="#FF0000">图片高度</font>' border=&quot;0&quot;&gt;&lt;/a&gt;</li>
	<li><b>插入Flash广告链接的代码:</b><br>&lt;param name='movie' value='<font color="#FF0000">Flash地址</font>'&gt;&lt;param name='quality' value='high'&gt;&lt;embed src='<font color="#FF0000">Flash地址</font>' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='<font color="#FF0000">Flash宽度</font>' height='<font color="#FF0000">Flash高度</font>'&gt;&lt;/embed&gt;&lt;/object&gt;
	</li>
	<li><b>插入联盟广告的代码如google:</b><br>&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--<br>
	google_ad_client = &quot;pub-6889026634863845&quot;;<br>
	/* 728x90, 创建于 08-3-20 */<br>
	google_ad_slot = &quot;1893250107&quot;;<br>
	google_ad_width = 728;<br>
	google_ad_height = 90;<br>
	//--&gt;<br>
	&lt;/script&gt;<br>
	&lt;script type=&quot;text/javascript&quot;<br>
	src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;<br>
	&lt;/script&gt;</li>
</ol>

<p>

作者:双鱼 QQ:125047083 技术支持:<a href="http://www.yiuu.net/" target="_blank">http://www.yiuu.net/</a> 
Powered by <a href="http://www.yiuu.net/" target="_blank">依悠广告管理系统 V1.1</a> &copy; 2006-2008
<a target="_blank" href="http://www.yiuu.net">YIUU Inc.</a><br>

</p>
</div>  
</TD></TR></TABLE>
<%
End Sub

Sub MA
Rs.open "select * from tt_admin",conn,1,1
%>
<TABLE width="100%" border="0" align="center"  cellpadding="2" cellspacing="1">
<tr><th>修改密码</th></tr>
<tr bgcolor="#fafbfc"><td>
<form name="form2" method="post" action="?menu=MAsave">
<p align="center">管理员名:<input name="admin" type="text" id="admin" value="<%=Rs("a_admin")%>" size="20"></p>
<p align="center">密  码:<input name="pass1"type="password" id="password" value="<%=rs("a_pass")%>" size="20"></p>
<p align="center">密码确认:<input name="pass2"type="password" id="password2" value="<%=rs("a_pass")%>" size="20"></p>
<p align="center">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" name="Submit35" value=" 修 改 ">
<input type="submit" name="Submit5235" value=" 取 消 " onClick="javascript:history.go(-1)"></p>
	</td></tr>
</form>
</table>
<%
Rs.close
End Sub

Sub MAsave
admin = Request.Form("admin")
p1 = Request.Form("pass1")
p2 = Request.Form("pass2")
If admin = "" Then
	Response.Write "<script language='javascript'>alert('请填入管理员名称!');history.go(-1);</script>"
	Response.End
End If

If p1 = "" or p2 = "" Then
	Response.Write "<script language='javascript'>alert('请填入密码');history.go(-1);</script>"
	Response.End
End If

If p1 <> p2 Then
	Response.Write "<script language='javascript'>alert('填入的密码不一致,请重新输入一遍!');history.go(-1);</script>"
	Response.End
End If
	Rs.open "select * from tt_admin",conn,1,3
	Rs("a_admin") = admin
	Rs("a_pass") = md5(p1)
	Rs.Update
Response.Write "<script language='javascript'>alert('修改管理员资料成功!');history.go(-2);</script>"
End Sub
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -