<% Response.Expires = -1000 Response.AddHeader "pragma","no-cache" Response.AddHeader "cache-control","private" Response.CacheControl="no-cache" %>
Administration Mode

<% Sub GAGB_Logon(GAGB_flag, GAGB_message, GAGB_color) %>

<%= GAGB_message %>

Admin ID:  
Password:

<% End Sub If len(request.form("C1")) > 0 then For each GAGB_ID in request("C1") GAGB_strID = GAGB_strID & "ID = " & GAGB_ID & " OR " Next GAGB_strID = Left(GAGB_strID, Len(GAGB_strID) - 3) Select Case Request("act") Case "archive" GAGB_objConn.Execute("UPDATE " & GAGB_strtbl & "Record SET archive = 1 WHERE (" & GAGB_strID & ");") Case "restore" GAGB_objConn.Execute("UPDATE " & GAGB_strtbl & "Record SET archive = 0 WHERE (" & GAGB_strID & ");") Case Else GAGB_strSQL = "SELECT " & GAGB_strtbl & "Record.comment FROM " & GAGB_strtbl & "Record WHERE (" & GAGB_strID & ");" Set GAGB_rs = GAGB_objConn.Execute(GAGB_strSQL) Set GAGB_regEx = New RegExp GAGB_regEx.Pattern = "(\[img\])(.*)(\[/img\])" GAGB_regEx.IgnoreCase = True GAGB_regEx.Global = True If not GAGB_rs.EOF then Do while not GAGB_rs.EOF GAGB_body = GAGB_rs(0) GAGB_iRet = GAGB_regEx.Test(GAGB_body) If GAGB_iRet then Set GAGB_Matches = GAGB_regEx.Execute(GAGB_body) Set GAGB_iMatch = GAGB_Matches(0) GAGB_iFile = GAGB_iMatch.SubMatches(1) On Error Resume Next GAGB_iFile = Server.Mappath(GAGB_upload & GAGB_iFile) If GAGB_objFile.FileExists(GAGB_iFile) then GAGB_objFile.DeleteFile(GAGB_iFile) End If On Error Goto 0 End If GAGB_rs.MoveNext Loop GAGB_rs.close GAGB_objConn.Execute("DELETE FROM " & GAGB_strtbl & "Record WHERE (" & GAGB_strID & ");") Else: GAGB_rs.close End If End Select GAGB_Close_Connection Response.Redirect GAGB_admin_page End If Dim GAGB_PerPage, GAGB_nPage, GAGB_totalRecords, GAGB_displayRecords If GAGB_Sess_Array(10) <> Session.SessionID then GAGB_flag = Request.form("flag") If GAGB_flag = 0 then GAGB_flag = 1 GAGB_message = "Type Admin ID and Password to Logon" Call GAGB_Logon(GAGB_flag, GAGB_message, "#000000") ElseIf GAGB_flag = 1 then GAGB_storelogon = Trim(Request.form("UserID")) & Trim(Request.form("Password")) GAGB_storelogon = GAGB_CryptText(GAGB_storelogon, GAGB_key, False) GAGB_strSQL = "SELECT " & GAGB_strtbl & "Config.admin FROM " & GAGB_strtbl & "Config;" GAGB_rs.Open GAGB_strSQL, GAGB_strConn If not GAGB_rs.EOF then GAGB_getLogon = GAGB_rs(0) End If GAGB_rs.close If Not GAGB_storelogon = GAGB_getLogon then GAGB_flag = 1 GAGB_Sess_Array(10) = Empty GAGB_message = "Admin ID or Password is invalid!" Call GAGB_Logon(GAGB_flag, GAGB_message, "#FF0000") Else GAGB_removeOrphan GAGB_Sess_Array(10) = Session.SessionID Set GAGB_TypeLibG = CreateObject("Scriptlet.TypeLib") GAGB_grcontrol = Left(GAGB_TypeLibG.Guid, 38) set GAGB_re = new RegExp GAGB_re.global = true GAGB_re.ignoreCase = true GAGB_re.Pattern = "[^a-zA-Z0-9]" GAGB_grcontrol = GAGB_re.replace(GAGB_grcontrol, "") Response.Cookies("gagbnetcontrol") = GAGB_grcontrol Response.Cookies("gagbnetcontrol").Path = "/" Set GAGB_TypeLibG = Nothing GAGB_Close_Connection Response.Redirect GAGB_admin_page End If End If End If If GAGB_Sess_Array(10) = Session.SessionID then If GAGB_Sess_Array(0) = Empty then GAGB_Sess_Array(0) = 20 GAGB_PerPage = 20 Else: GAGB_PerPage = CInt(GAGB_Sess_Array(0)) End If GAGB_strSQL = "SELECT " & GAGB_strtbl & "Record.* FROM " & GAGB_strtbl & "Record WHERE moderate = 0 ORDER BY pdate DESC;" GAGB_rs.PageSize = GAGB_PerPage GAGB_rs.CursorLocation = 3 GAGB_rs.Open GAGB_strSQL, GAGB_strConn, 0, 1 If GAGB_rs.EOF then GAGB_noEntry Else If GAGB_Sess_Array(11) = Empty then GAGB_Sess_Array(11) = 1 GAGB_nPage = 1 Else: GAGB_nPage = CInt(GAGB_Sess_Array(11)) End If GAGB_URLlink = GAGB_admin_page GAGB_pageType = 1 GAGB_strPaging = GAGB_buildPages(GAGB_nPage, GAGB_URLlink, GAGB_pageType) '## paging built in libraries.asp With Response .Write "" .Write vbcrlf & "
" .Write "" .Write "" .Write "" .Write "" .Write "
Messages:" & GAGB_totalRecords & "" & GAGB_strPaging & "" .Write "
" & vbcrlf For GAGB_J = 1 to GAGB_displayRecords If GAGB_rs.EOF Then Exit For Else GAGB_ID = GAGB_rs(0) GAGB_pdate = GAGB_rs(1) GAGB_Name = GAGB_rs(2) & " (IP: " & GAGB_rs(6) & ")" GAGB_Email = GAGB_rs(3) GAGB_Url = GAGB_rs(4) GAGB_Comment = GAGB_rs(5) GAGB_Comment = GAGB_encodeURL(GAGB_Comment) GAGB_Comment = GAGB_InsertSmiley(GAGB_Comment) GAGB_Custom1 = GAGB_convertNull(GAGB_rs(7)) GAGB_Custom2 = GAGB_convertNull(GAGB_rs(8)) GAGB_Custom3 = GAGB_convertNull(GAGB_rs(13)) GAGB_Custom4 = GAGB_convertNull(GAGB_rs(14)) GAGB_Topic = GAGB_convertNull(GAGB_rs(12)) Response.Write GAGB_hrline %>
<% If GAGB_AllowTopic And Len(GAGB_Topic) > 0 Then .Write "" & vbcrLf & vbcrlf End If %> " .Write "" If GAGB_chkOpt1 = "checked" and GAGB_Custom1 <> "" then .Write "" .Write "" End If If GAGB_chkOpt2 = "checked" and GAGB_Custom2 <> "" then .Write "" .Write "" End If If GAGB_chkOpt3 = "checked" and GAGB_Custom3 <> "" then .Write "" .Write "" End If If GAGB_chkOpt4 = "checked" and GAGB_Custom4 <> "" then .Write "" .Write "" End If %>
 " .Write GAGB_Topic & "
Name:  <%= GAGB_Name %>  <% If not GAGB_Email = "" Then .Write "" & GAGB_Email & "" If not GAGB_URL = "" Then .Write "" & GAGB_URL & "" If GAGB_rs(10) = 1 then .Write "Private" If GAGB_rs(11) = 1 then .Write "
" & GAGB_fieldName1 & ": " & GAGB_Custom1 & "
" & GAGB_fieldName2 & ": " & GAGB_Custom2 & "
" & GAGB_fieldName3 & ": " & GAGB_Custom3 & "
" & GAGB_fieldName4 & ": " & GAGB_Custom4 & "
Comment:
 <%= GAGB_pdate %>  Edit Comment Reply to Comment Take Comment Offline

<%= GAGB_Comment %>

<% GAGB_rs.MoveNext End If Next .Write vbcrlf & "
" .Write "" .Write "" .Write "" .Write "" .Write "
Messages:" & GAGB_totalRecords & "" & GAGB_strPaging & "" .Write "
" & vbcrlf %>
Select All:
<% End With End If Response.Write "" End If Sub GAGB_noEntry() response.write "

No records found in database.

" End Sub Sub GAGB_removeOrphan() GAGB_baseDate = GAGB_ConvDate(DateAdd("n", -1, Now)) GAGB_sdd = GAGB_dd(GAGB_objConn) GAGB_strSQL = "SELECT " & GAGB_strtbl & "Temp.tempimg FROM " & GAGB_strtbl & "Temp WHERE tdate < " & GAGB_sdd & GAGB_baseDate & GAGB_sdd & ";" Set GAGB_rsTemp = GAGB_objConn.Execute(GAGB_strSQL) If not GAGB_rsTemp.EOF then On Error Resume Next Do While Not GAGB_rsTemp.EOF GAGB_nextImage = GAGB_rsTemp(0) GAGB_objFile.DeleteFile(Server.MapPath(GAGB_upload & GAGB_nextImage)) GAGB_rsTemp.MoveNext Loop On Error Goto 0 GAGB_objConn.Execute("DELETE FROM " & GAGB_strtbl & "Temp WHERE tdate < " & GAGB_sdd & GAGB_baseDate & GAGB_sdd & ";") End If GAGB_rsTemp.close Set GAGB_rsTemp = Nothing End Sub %>