showpic.asp
来自「本系统是一套开源WEB的网站管理系统」· ASP 代码 · 共 263 行
ASP
263 行
<!--#include file="include/ms_setting.asp"-->
<%
'==============================================================
'程序名称:茂盛网站管理系统(Maoin CSM)
'当前版本:Maosin CMS Version 1.1 Powered by maosin.com
'程序作者:阿茂(李胜茂)
'网站地址:www.maosin.com www.maosin.net
' QQ:57861417
'电子邮箱:maosin@163.com maosin@maosin.com
'--------------------------------------------------------------
'Copyright (C) 2006 maosin.com All Rights Reserved.
'免费版本请在程序首页保留(Powered by:Maosin CMS)版权链接信息;
'您可以对此版本进行修改,美化,但请保留此ASP文件内的版权信息;
'茂盛设计网保留此软件的法律追究权利
'==============================================================
dim idnumeric,iderror
id=request.queryString("id")
if isNumeric(id) and id<>"" then
idnumeric=true
sql="select * from ms_pic as p,ms_pic_class as c,ms_pic_cat as cat where p.classID=c.classID and p.catID=cat.catID and p.id="&id&" and pass=true"
Set rs=Server.CreateObject("ADODB.RecordSet")
rs.Open sql,connstr,1,3
if not rs.eof and not rs.bof then
dim popedom,jifen,money,keyword,isbuy
isbuy=0
keyword=rs("pic_keyword")
popedom=cint(rs("popedom"))
jifen=csng(rs("jifen"))
money=csng(rs("money"))
buyUser=rs("buyUser")
if session(userVar)=userVal then
userInfo=session("userinfo")
if getBuyUser(buyUser,userInfo(1))=true then
isbuy=1
else
isbuy=0
end if
if Request("pay")="yes" then
if cint(userInfo(2))=2 and popedom=2 and csng(userInfo(4))>=money and isbuy=0 then
rs("buyUser")=rs("buyUser")&","&userinfo(1)
rs.update
conn.execute("update ms_user set user_money=user_money-"&money&" where user_id="&userinfo(0))
userInfo(4)=csng(userInfo(4))-money
userInfo(4)=replace(FormatNumber(userInfo(4),2,-1),",","")
session("userinfo")=userInfo
userInfo=session("userinfo")
end if
end if
end if
popedom=cint(rs("popedom"))
jifen=csng(rs("jifen"))
money=csng(rs("money"))
buyUser=rs("buyUser")
catTitle="图片索材→"&rs("class")&"→"&rs("pic_title")
iderror=true
else
catTitle="图片索材→出错信息"
iderror=false
end if
else
idnumeric=false
end if
%>
<!--#include file="ms_start.asp"-->
<!--页面主体开始-->
<script language="JavaScript" src="include/wisdom.js"></script>
<table width="100%" align="center" border="0" cellpadding="0" cellspacing="0" class="mainMiddle_tdble"><tr>
<td valign="top" width="*">
<%
if idnumeric then
if iderror then
pltype="pic"
Call showPicBody()
conn.execute("UPDATE ms_pic SET pic_clicks=pic_clicks+1 WHERE id="&id)
else
showmsg "<li>您所查找的图片ID并不存在或者已经被删除了</li>","系统提示信息"
end if
else
showmsg "<li>您输入的参数不是数字型参数,请输入一个数字型参数</li>","系统提示信息"
end if
%>
</td></tr></table>
<!--#include file="ms_end.asp"-->
<%
'============================================
Sub showpicbody()%>
<table cellspacing="0" class="naviTable"><tr><td class="naviL"></td><td class="naviM"><span class="rtt">当前位置:<a class="classNavig" href="index.asp">本站首页</a>→<a class="classNavig" href="pic.asp">图片索材</a>→<a class="classNavig" href="pic.asp?catID=<%=rs("p.catID")%>"><%=rs("catName")%></a>→<a class="classNavig" href="pic.asp?catID=<%=rs("p.catID")%>&classID=<%=rs("p.classID")%>"><%=rs("class")%></a>→<a class="classNavig"><%=rs("pic_title")%></a></span></td><td class="naviR"></td></tr></table>
<table width="100%" cellpadding="4" cellspacing="6" align="center"><tr><td height="50" valign="middle" align="center" width="100%" class="bb" style="font-size:15px;"><b><font color="<%=rs("titlecolor")%>"><%=rs("pic_title")%></font></b></td></tr></table>
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="word-break:break-all;table-layout:fixed;">
<tbody>
<tr>
<td valign="top" align="center" class="showpic">
<%
if popedom>0 then
if session(userVar)=userVal then'是否登录
userInfo=session("userInfo")
if popedom=1 then'会员以上
if cint(userInfo(2))>=1 then
if csng(userInfo(3))<jifen then
response.write("<div class=""buyMsg"">很遗憾,您的"&pointName&"不够,阅读此需要"&pointName&" <font color=""#ff0000"">"&jifen&"</font> "&pointUnits&"以上,目前您的"&pointName&"为<font color=""#ff0000"">"&userInfo(3)&"</font></div>")
else
response.write("<img onmousewheel=""return cgimg(this);"" onload=""javascript:DrawImage(this);"" onclick=""window.open(this.src)"" src="""&rs("pic_url")&""" title=""点击图片在新窗口中打开"">")
end if
else
response.write("<div class=""buyMsg"">·此图片为会员图片,需要"&pointName&"为 <font color=""#ff0000"">"&rs("jifen")&"</font> 以上的会员级别才能查看,查看消费 <font color=#ff0000>"&rs("money")&"</font> "&moneyUnits&moneyname&"<BR>·如果你还没注册,请<a href=""user_reg.asp""><font color=#ff0000>点此注册</font></a>!<br>·如果你已经注册但还没登录,请<a href=""logon.asp"" target=""_blank""><font color=#ff0000>点此登录</font></a> !</div>")
end if
elseif popedom=2 then'VIP以上
if cint(userInfo(2))>=2 then
if getBuyUser(buyUser,userInfo(1))=true then
isbuy=1
else
isbuy=0
end if
if isbuy=0 and money>0 then
if csng(userInfo(4))<money then
response.write("<div class=""buyMsg"">很遗憾,您的"&moneyName&"不足,查看此图需要消费<font color=""#ff0000"">"&money&"</font> "&moneyUnits&moneyName&",目前您有<font color=""#ff0000"">"&userInfo(4)&"</font> "&moneyUnits&moneyName&"</div>")
else
response.write("<div class=""buyMsg"">此图片为VIP会员图片,需要"&pointName&"为 <font color=""#ff0000"">"&rs("jifen")&"</font> 以上的VIP会员级别才能查看,查看消费 <font color=#ff0000>"&rs("money")&"</font> "&moneyUnits&moneyName&"<BR>您是否愿意花费<font color=""#ff0000"">"&money&"</font> "&moneyUnits&moneyName&"购买<p style=""word-spacing:20px;text-align:center;""><a href=""?pay=yes&id="&rs("id")&""">我愿意购买</a> <a href=""javascript:"" onclick=""window.history.go(-1)"">我不愿意</a></p></div>")
end if
else
response.write("<img onmousewheel=""return cgimg(this);"" onload=""javascript:DrawImage(this);"" onclick=""window.open(this.src)"" src="""&rs("pic_url")&""" title=""点击图片在新窗口中打开"">")
end if
else
response.write("<div class=""buyMsg"">·此图片为VIP会员图片,需要"&pointName&"为 <font color=""#ff0000"">"&rs("jifen")&"</font> 以上的VIP会员级别才能查看,查看消费 <font color=#ff0000>"&rs("money")&"</font> 个"&moneyUnits&moneyname&"<BR>·如果你还没注册,请<a href=""user_reg.asp""><font color=#ff0000>点此注册</font></a>!<br>·如果你已经注册但还没登录,请<a href=""logon.asp"" target=""_blank""><font color=#ff0000>点此登录</font></a> !</div>")
end if
end if
else'没有登陆
response.write("<div class=""buyMsg"">·此图片为会员图片,需要"&pointName&"为 <font color=""#ff0000"">"&rs("jifen")&"</font> 以上的会员级别才能查看,查看消费 <font color=#ff0000>"&rs("money")&"</font> 个"&moneyUnits&moneyname&"<BR>·如果你还没注册,请<a href=""user_reg.asp""><font color=#ff0000>点此注册</font></a>!<br>·如果你已经注册但还没登录,请<a href=""logon.asp"" target=""_blank""><font color=#ff0000>点此登录</font></a> !</div>")
end if
else
response.write("<img onmousewheel=""return cgimg(this);"" onload=""javascript:DrawImage(this);"" onclick=""window.open(this.src)"" src="""&rs("pic_url")&""" title=""点击图片在新窗口中打开"">")
end if%>
</td>
</tr>
</tbody>
</table>
<table width="750" border="0" cellpadding="0" cellspacing="0" align="center">
<tr><td height="5"></td></tr>
<tr>
<td valign="top" class="picInfo">
图片名称: <%=rs("pic_title")%><br>
所属分类: <%=rs("catName")&" | "&rs("class")%><br>
图片尺寸:<%=rs("WHsize")%><br>
图片大小:<%=rs("pic_size")%><br>
浏览次数: <%=rs("pic_clicks")%><br>
图片作者: <%=rs("pic_authors")%> 发布会员: <%=rs("post_member")%><br>
添加时间: <%=rs("pic_date")%><br>
图片简介: <%=rs("pic_content")%><br></td>
</tr>
<tr><td height="7"></td></tr>
<tr>
<td height="30" valign="middle" align="center" class="text">
<%
sql="select min(id) as minid,max(id) as maxid from ms_pic where pass=true"
set bers=conn.execute(sql)
if not bers.eof and not bers.bof then
btitle="图片库首"
etitle="图片库尾"
btitle="<a href=showpic.asp?id="&bers("minid")&" title=""图片库首""><img src=""images/button_begin.gif"" width=""15"" height=""15"" border=""0"" align=""absmiddle"">图库首 </a>"
etitle="<a href=showpic.asp?id="&bers("maxid")&" title=""图片库尾""><img src=""images/button_end.gif"" width=""15"" height=""15"" border=""0"" align=""absmiddle"">图库首 </a>"
else
btitle="<a title=""已经没有了"" onmouseover=""this.style.cursor='hand';""><img src=""images/button_begin.gif"" width=""15"" height=""15"" border=""0"" align=""absmiddle"">图库首 </a>"
etitle="<a title=""已经没有了"" onmouseover=""this.style.cursor='hand';""><img src=""images/button_end.gif"" width=""15"" height=""15"" border=""0"" align=""absmiddle"">图库首 </a>"
end if
bers.close
sql="select top 1 id,pic_title from ms_pic where id<"&id&" and pass=true order by id desc"
set nrs=conn.execute(sql)
if not nrs.eof and not nrs.bof then
ntitle="<a href=""showpic.asp?id="&nrs("id")&""" title="""&nrs("pic_title")&"""><img src=""images/button_prv.gif"" border=""0"" align=""absmiddle"">上一张 </a>"
else
ntitle="<a title=""没有上一张"" onmouseover=""this.style.cursor='hand';""><img src=""images/button_prv.gif"" border=""0"" align=""absmiddle"">上一张 </a>"
end if
nrs.close
set prs=conn.execute("select top 1 id,pic_title from ms_pic where id>"&id&" and pass=true order by id asc")
if not prs.eof and not prs.bof then
ptitle="<a href=""showpic.asp?id="&prs("id")&""" title="""&prs("pic_title")&"""><img src=""images/button_next.gif"" border=""0"" align=""absmiddle"">下一张 </a>"
else
ptitle="<a title=""没有下一张"" onmouseover=""this.style.cursor='hand';""><img src=""images/button_next.gif"" border=""0"" align=""absmiddle"">下一张 </a>"
end if
prs.close
response.write(btitle&ntitle&ptitle&etitle)
%>
<a href="pic.asp?catID=<%=rs("cat.catID")&"&classID="&rs("c.classID")%>"><img src="images/button_list.gif" width="15" height="15" border="0" align="absmiddle">目录 </a>
<a href="#" onClick="javascript:window.open('<%=rs("pic_url")%>')" title="原图大小"><img src="images/button_yt.gif" width="15" height="15" border="0" align="absmiddle">原图 </a>
<a onmouseover="this.style.cursor='hand'" onClick="copyurl()"><img src="images/button_friend.gif" border="0" align="absmiddle">发给好友 </a>
<a href="#" onClick="window.close()"><img src="images/button_close.gif" width="15" height="15" border="0" align="absmiddle">关闭</a>
</td>
</tr>
</table>
<%
sql="select * from ms_pic_pl where id="&rs("id")&" order by pl_date desc"
Set plrs=Server.CreateObject("ADODB.RecordSet")
plrs.Open sql,connstr,1,1
plrs.pagesize=picPlNum
%>
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td class="aboutTitle">∷相关搜索∷</td>
</tr>
<tr>
<td class="aboutLine"> <div><img src="images/zhongsou.gif">搜索更多“<a id="searhKey" style="color:#ff0000;" href="http://p.zhongsou.com/p?w=<%=rs("pic_title")%>&k=zhongsouskeyword&aid=B0100128025"><%=rs("pic_title")%></a>”相关内容</div> <div><img src="images/baidu.gif">搜索更多“<a id="searhKey" style="color:#ff0000;" href="http://www.baidu.com/s?wd=<%=rs("pic_title")%>&tn=ibaidukeysword"><%=rs("pic_title")%></a>”相关内容</div>
</td>
</tr>
<tr>
<td class="aboutTitle">∷相关图片文章∷</td>
</tr>
<tr>
<td class="aboutLine">
<%if rs("pic_keyword")<>"" then
sql="select top "&picAboutNum&" * from ms_art where art_keyword in ("""&rs("pic_keyword")&""") or art_keyword like ""%"&rs("pic_keyword")&"%"" and picart=1"
Set aArt=conn.Execute(sql)
If Not aArt.Eof And Not aArt.Bof Then
Do While Not aArt.Eof
Response.Write("<span>☉<a href=showart.asp?id="&aArt("id")&">"&aArt("art_title")&"</a></span><BR>")
aArt.MoveNext
Loop
Else
Response.Write("<font color=#777777>☉没有相关文章</font>")
End If
aArt.close
else
Response.Write("<font color=#777777>☉没有相关文章</font>")
end if
%>
</td>
</tr>
<%if rs("allow_pl") then%>
<tr>
<td class="aboutTitle">∷相关评论∷(共<font color="#ff0000"><%=plrs.recordcount%></font>条 显示最新<font color="#ff0000"><%=picPlNum%></font>条。评论内容只代表网友观点,与本站立场无关!) </td>
</tr>
<tr>
<td height="30" class="plContent">
<%
If Not plrs.Eof And Not plrs.Bof Then
line=1
Do While Not plrs.Eof and line<=plrs.pagesize
Response.Write("<span><img src=images/pl_1.gif align=absmiddle>"&plrs("pl_name")&" 打分:<font color=""#ff0000"">"&plrs("pl_fen")&"</font> 发表时间:"&plrs("pl_date")&" [来自:"&plrs("pl_ip")&"]</span><BR>")
Response.write("<span class='plLine'>"&plrs("pl_content")&"</span><BR>")
plrs.MoveNext
line=line+1
Loop
Response.write("<div class='plall'><a href=pl.asp?pltype=pic&id="&id&"&title="&rs("pic_title")&">查看全部评论</a></div>")
Else
Response.Write("<font color=#777777>暂时没有相关评论!</font>")
End If
plrs.close
%>
</td>
</tr>
<tr>
<td class="aboutTitle">∷发表评论∷</td>
</tr>
<tr>
<td><%Call plModule()%></td>
</tr>
<%else%>
<tr>
<td height="25" valign="middle" align="center"><div class="plClose">【此图片评论已关闭】</div></td>
</tr>
<%end if%>
</table>
<%End Sub%>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?