Publisher: Wizard
Patch: junk reference defense patch
Release date: 2007-1-4
Version no.: Version 3rd
Applicable version: PJblog 2.6
Original Author: Wizard
Demo address: http://www.hljsh.com/
: Http://bbs.pjhome.net/attachment.php? Aid = 2143.
Plug-In Introduction: effectively prevents spam references. Encrypted submission address. KEY verification is added for version 2nd and the key is automatically changed every hour.
The current version does not modify the database, only four files are modified, and the static page mode is supported!
Effect
Reference announcement address: trackback. asp? TbID = JNKRQOF8 & key = JOKNPNKOQPMPPMC0
The installation method is as follows:
========================================================== ==============================
File trackback. asp
Search
TbID = CheckStr (Request. QueryString ("tbID "))
Replace
TbID = Decrypt (CheckStr (Request. QueryString ("tbID ")))
Search
If Not (IsInteger (Request. QueryString ("tbID") AND IsInteger (Request. QueryString ("logID") Then
Replace
If Not IsInteger (Decrypt (Request. QueryString ("tbID") AND IsInteger (Request. QueryString ("logID") Then
Search
Where blog_ID = "& logID &" AND tb_ID = "& CheckStr (Request. QueryString (" tbID "))
Replace
Where blog_ID = "& logID &" AND tb_ID = "& Decrypt (CheckStr (Request. QueryString (" tbID ")))
** There are two
Search
'========================================
'Reference announcement processing page
'Update time: 2006-6-1
'========================================
Add
Dim keys, keys1
Keys = Request. QueryString ("key ")
Keys1 = Encrypt (year (now) & (Month (now) & (day (now) & hour (now ()))
If keys <> keys1 then
Response. c
Response. write "<? Xml version = "" 1.0 "" encoding = "" UTF-8 ""?> <? Xml-stylesheet type = "" text/xsl "" href = "" tb. xsl ""?> "
%>
<Response> <error> 1 </error> <message> the information you submitted has expired. Please check... </message> </response>
<%
Else
Dim strget
Strget = trim (Request. QueryString ("tbID "))
If len (strget)> 8 then
Response. c
Response. write "<? Xml version = "" 1.0 "" encoding = "" UTF-8 ""?> <? Xml-stylesheet type = "" text/xsl "" href = "" tb. xsl ""?> "
%>
<Response> <error> 1 </error> <message> the information you submitted is incorrect. Check... </message> </response>
<%
Else
Dim tbIDs
TbIDs = Decrypt (CheckStr (Request. QueryString ("tbID ")))
If tbIDs <1 then
Response. c
Response. write "<? Xml version = "" 1.0 "" encoding = "" UTF-8 ""?> <? Xml-stylesheet type = "" text/xsl "" href = "" tb. xsl ""?> "
%>
<Response> <error> 1 </error> <message> the information you submitted is incorrect. Check... </message> </response>
<%
Else
Search
'Trackback response function added above
End if
End if
End if
***********
Search
Response. Redirect ("search. asp? SearchType = trackback ")
Replace
Response. c
Response. write "<? Xml version = "" 1.0 "" encoding = "" UTF-8 ""?> <? Xml-stylesheet type = "" text/xsl "" href = "" tb. xsl ""?> "
%>
<Response> <error> 1 </error> <message> log ID error. Check... </message> </response>
<%
Search
<Response> <error> 1 </error> <message> the log is not referenced. </message> </response>
Replace
<Response> <error> 1 </error> <message> the log (ID = <% Response. write tbID %>) is not referenced. </message> </response>
***********
========================================================== ==============================
File class \ cls_article.asp
Search
Reference announcement URL: <a href = "<% = (SiteURL &" trackback. asp? TbID = "& id) %>" target = "_ blank"> <% = (SiteURL & "trackback. asp? TbID = "& id) %> </a>
Replace
Reference announcement URL: <a href = "<% = (SiteURL &" trackback. asp? TbID = "& Encrypt (id) &" & key = "& Encrypt (year (now) & (Month (now) & (day (now )) & hour (now () %> "target =" _ blank "> <% = (SiteURL &" trackback. asp? TbID = "& Encrypt (id) &" & key = "& Encrypt (year (now) & (Month (now) & (day (now )) & hour (now () %> </a>
Search
Sub ShowComm (LogID, comDesc, DisComment)
Add
Dim k1
K1 = Encrypt (year (now) & (Month (now) & (day (now) & hour (now ()))
Search
Href = "" trackback. asp? Action = deltb & tbID = "& commArr (6, Pcount) &" & logID = "& LogID &"""
Replace
Href = "" trackback. asp? Action = deltb & tbID = "& Encrypt (commArr (6, Pcount) &" & logID = "& LogID &" & key = "& k1 &"""
Search
TempArticle = Replace (TempArticle, "<" & "% ST (A) %" & "> ","")
Replace
Dim k1
K1 = Encrypt (year (now) & (Month (now) & (day (now) & hour (now ()))
TempArticle = Replace (TempArticle, "<" & "% ST (A) %" & "> ","")
TempArticle = Replace (TempArticle, "<" & "% ST (KEY) %" & ">", k1) ========================================================== ==============================
File class \ cls_logAction.asp
Search
Temp1 = Replace (Temp1, "<$ trackback $>", SiteURL & "trackback. asp? TbID = "& LogID)
Replace
Temp1 = Replace (Temp1, "<$ trackback $>", SiteURL & "trackback. asp? TbID = "& Encrypt (LogID) &" & key = "&" <"&" % ST (KEY) % "&"> ") ========================================================== ==============================
File common \ function. asp
At the end of the file, add
Function Encrypt (theNumber)
On Error Resume Next
Dim n, szEnc, t, HiN, LoN, I
N = CDbl (theNumber + 1570) ^ 2-7 * (theNumber + 1570)-450)
If n <0 Then szEnc = "R" Else szEnc = "J"
N = CStr (abs (n ))
For I = 1 To Len (n) step 2
T = Mid (n, I, 2)
If Len (t) = 1 Then
SzEnc = szEnc & t
Exit
End If
HiN = (CInt (t) And 240)/16
LoN = CInt (t) And 15
SzEnc = szEnc & Chr (Asc ("M") + HiN) & Chr (Asc ("C") + LoN)
Next
Encrypt = szEnc
End Function
Function Decrypt (theNumber)
On Error Resume Next
Dim e, n, sign, t, HiN, LoN, NewN, I
E = theNumber
If Left (e, 1) = "R" Then sign =-1 Else sign = 1
E = Mid (e, 2)
NewN = ""
For I = 1 To Len (e) step 2
T = Mid (e, I, 2)
If Asc (t)> = Asc ("0") And Asc (t) <= Asc ("9") Then
NewN = NewN & t
Exit
End If
HiN = Mid (t, 1, 1)
LoN = Mid (t, 2, 1)
HiN = (Asc (HiN)-Asc ("M") * 16
LoN = Asc (LoN)-Asc ("C ")
T = CStr (HiN or LoN)
If Len (t) = 1 Then t = "0" & t
NewN = NewN & t
Next
E = CDbl (NewN) * sign
Decrypt = CLng (7 + sqr (49-4 * (-450-e)/2-1570)
End Function
========================================================== ==========
Demonstrate to my BLOG. My network is slow. Please be patient.
Users who have not modified these four files can download the following overwrites.
========================================================== ==========
To use static pages, you need to create new diaries in the background.
I don't know what else is wrong. I hope you can test and make a brick.
Click to download this file