SoFunction
Updated on 2025-04-13

Collection of function libraries commonly used in asp production


When you click on the link of the corresponding article, you will enter the processing page of this article:

   
  < % 
  articleid=request("articleid") 
  boardid=request("boardid") 
  if session("beenthere")< >boardidthen  "" 
  Set conn = ("") 
   "driver={Microsoft AccessDriver (*.mdb)};dbq=" & ("") 
  Set cmd = ("") 
  Set  = conn 
= "Check articles by id"
  ReDim param(0) 
param(0)= CLng(articleid)//Note: Clng cannot be ignored
  Set rs = ( ,param ) 
author=rs("authorid")
title=rs("Title")
data=rs("date")
rate=rs("recommended")
boardid=rs("Kanban id")
topicid=rs("topicid")
boardname=rs("Kanban name")
topicname=rs("topic name")
content=rs("content")
  content=replace(content,vbCrlf,"</p>< p>") 
  content="< p>" & content& "< /p>" 
  set cmd=nothing 
  %> 
  < html> 
  < head> 
  < title>Untitled Document< /title> 
  < meta http-equiv="Content-Type"content="text/html; charset=GB2312"> 
  < /head> 
  < body bgcolor="#E9E9E4"> 
  < table width="89%" border="0"cellspacing="0" cellpadding="0"align="center"> 
  < tr bgcolor="#CCCCCC"> 
< td>Author: < font color="#FF3366"><a href="?author=< %=author%>">< %=author%> < /a>< /font>Date of publication: < font color="#FF3333"><%=data%>< /font>
Kanban: < font color="#FF3333"><a href="?boardid=< %=boardid%>">< %=boardname%>< /a>< /font> Recommended by the board owner: < font color="#FF3333">#rate#</font>< /td>
  < /tr> 
  < tr bgcolor="#CCCCCC"> 
< td>Title: < font color="#FF3333"><%=title%>
Topic: < a href="?topicid=<%=topicid%>"> < %=topicname%>< /a> < /font>< /td>
  < /tr> 
  < tr valign="top"> 
  < td> 
  < hr> 
< font color="#FF3366">Article content: < /font>< br>
  < br> 
  < font color=blue>< %%>< /font> 
  < br> 
  < hr> 
  < /td> 
  < /tr> 
  < tr valign="top"> 
  < form method="post" action=""> 
  < td height="18"> 
  < table width="100%" border="1"cellspacing="1" cellpadding="1"> 
  < tr> 
  < td width="29%"> 
  < div align="right"> 
  < input type="hidden" name="boardid"value="< %=boardid%>"> 
  < input type="hidden" name="topicid"value="< %=topicid%>"> 
  < input type="hidden" name="articleid"value="< %=articleid%>"> 
Article processing: < /div>
  < /td> 
< td width="12%" bordercolor="#006666">Delete:
  < input type="radio" name="manage"value=1> 
  < /td> 
< td width="30%" bordercolor="#006666">Published:
  < input type="radio" name="manage"value=2> 
Recommended level
  < select name="select"> 
  < option value="1">1</option> 
  < option value="2">2</option> 
  < option value="3" selected>3</option> 
  < option value="4">4</option> 
  < option value="5">5</option> 
  < /select> 
  < /td> 
< td width="20%" bordercolor="#006666">Add to the future:
  < input type="radio" name="manage"value=3> 
  < /td> 
  < td width="9%"> 
< input type="submit" name="Submit"value="OK">
  < /td> 
  < /tr> 
  < /table> 
  < /td> 
  < /form> 
  < /tr> 
  < /table> 
  < /body> 
  < /html> 
  < % 
  set rs=nothing 
   
  set conn=nothing 
  %> 

   
Note: This page is basically the same as the one in the article display module. It only adds more forms processed by moderators, so I won’t talk about them here.

Next, the corresponding part of the database should be repaired according to the moderator's processing process.

   
  < %=true%> 
  < html> 
  < head> 
< title>Article processing< /title>
  < meta http-equiv="Content-Type"content="text/html; charset=GB2312"> 
  < /head> 
  < body bgcolor="#E9E9E4"> 
  < % 
  articleid=request("articleid") 
  boardid=request("boardid") 
  topicid=request("topicid") 
  manage=request("manage") 
'Accept the form content
manage 'Show Bamboo ID
  if session("beenthere")< >boardidthen  "" 
  Set conn = ("") 
   "driver={Microsoft AccessDriver (*.mdb)};dbq=" & ("") 
According to the moderator's operations on the previous page, the corresponding processing will be performed below.
  if CLng(request("manage"))=1 then 
sql="delete from Content Table where < h1>The article has been deleted</h1>"
   "< a href=>back</a>" 
  elseif CLng(request("manage"))=2then 
sql="update Content Table set Publish=true whereupdate Topic Table set Number of articles=Number of articles+1where < h1>Article has been published</h1>"
   "< a href=>back</a>" 
  else 
   
   "?boardid="& boarded 
  end if 
  %> 
  < /body> 
  < /html> 
  < % 
   
  set conn=nothing 
  %> 

After the above steps, all the parts have been basically completed. Of course, they cannot be used at this time and cannot be placed on the table. If you want to be able to produce it, you also need to work hard on layout design, client data verification, etc. But that's all HTML content and has little to do with ASP, so I won't talk about it here.