<%@LANGUAGE="VBSCRIPT"%> <% Response.Buffer = true %> <% Function StandardDate(mDate) mDate = CDate(mDate) StandardDate = Day(mDate) & "/" & Month(mDate) & "/" & Year(mDate) End Function Function nz(mData) ' avoid saving null values If len(mData) = 0 then nz = " " Else nz = mData End if End Function Function ReplaceChar(mChar,mData) If Instr(mData,chr(mChar)) > 0 Then DataLength = len(mData) Pointer = 1 Do While Pointer <= DataLength Char = Mid(mData,Pointer,1) If Char = chr(mChar) then mData = Left(mData,Pointer-1) & " " & Mid(mData,Pointer+1) End If Pointer = Pointer + 1 Loop ' next char in string End If ReplaceChar = mData End Function Function FixApostrophe(mData) If Instr(mData,"'") > 0 Then DataLength = len(mData) Pointer = 1 Do While Pointer <= DataLength Char = Mid(mData,Pointer,1) If Char = "'" then If Mid(mData,Pointer,2) <> "''" then mData = Left(mData,Pointer) & "'" & Mid(mData,Pointer+1) Pointer = Pointer + 1 DataLength = DataLength + 1 End If End If Pointer = Pointer + 1 Loop ' next char in string End If FixApostrophe = mData End Function function WriteSelectCodeSingle(mReq,mText) response.write("") end function function WriteSelectCode(mReq,mTag,mText) response.write("") end function Function ReFormatted(Str) on Error resume next Str=Replace(Str, CHR(13), "") Str=Replace(Str, CHR(10) & CHR(10),"

") Str=Replace(Str, CHR(10), "
") ReFormatted = "

" & Str & "

" End Function Function VetInput(cTestString) ' checks for HTML or profanities in a string ' each 'library!' word is searched for in the string ' if any of the library words are surrounded with text, then the word is passed (eg 'scunthorpe') ' if the word is at the beginning or end of another word, then it is blocked. VetInput = "OK" If (Instr(cTestString,"<") > 0 and Instr(cTestString,"<") > 0) then VetInput = "html" Else Dim aProf,Profanity, Suffix, Prefix,pointer, offset, alphachars aProf = Array("bum","tit","crap","fuck","phuck","tosser","fuk","bollo","cunt","bastard","wank","shit","wank","wog","coon","arse") Profanity = "" alphachars = "abcdefghijklmnopqrstuvwxyzABSDEFGHIJKLMNOPQRSTUVWXYZ" cTestString = " " & cTestString & " " ' insert a space at each end of the string For pointer = 0 To UBound(aProf) - 1 offset = InStr(UCase(cTestString), UCase(aProf(pointer))) If offset > 0 Then Prefix = Mid(cTestString, offset - 1, 1) Suffix = Mid(cTestString, offset + Len(aProf(pointer)), 1) If InStr(alphachars, Prefix) > 0 And InStr(alphachars, Suffix) > 0 Then ' it's embedded in another word, so we'll take a chance Else Profanity = Mid(cTestString, offset, Len(aProf(pointer))) Exit For End If End If Next If Len(Profanity) > 0 Then VetInput = "suspect" 'VetInput = "sorry, your entry contained the word " & Profanity & " and cannot be saved." End If End If End Function %> <% if len(request("testpass")) > 0 then SQLString = "SELECT * from tbl_Pages where password = '"&request("testpass")&"'" OpenOleConn(datadir&"npc.mdb") Set rs = objConn.execute(SQLString) if rs.eof then %>

Sorry, the password entered did not match any current Test Pages. <%response.end else response.redirect("test.asp?testpage="&mid(rs("pagename"),5)) end if end if if len(request("testpage")) = 0 and len(request("pmode")) = 0 then %>

<%if editor or master then %> <%for n=1 to 10 %> <%next %> <%end if %>
Test/Development Pages

 

We have a number of Test pages that enable us to develop and proof our new site content before we make it openly visible to NPC members or the General Public.

If you have been authorised by us to view one of these pages, please enter the relevant page password that you have been given (not your NPC membership password).


(The text above shows the member's view of this page, but you are logged in as an administrator/editor,
so you also have direct access to any test page by clicking on the appropriate link below: )

Test <%=n%>
When ordinary users (members or the public), access this page, they can only see the text content down as far as the password box. They are able to view any test page that they know the current password for.
You can therefore edit any particular test page, give it specific password, and then invite a group of users to test view the content. When they visit this test page, by entering that password, they will be taken automatically to that test page. After the test is concluded, you can then reuse that page for something else, and either change the password, or leave it as it is, depending on whether you want the same pool of testers.
Ten independent pages are provided, to allow simultaneous testing.
The passwords can be changed at any time, and take immediate effect.
Administrators can edit and view all of the content without needing to know the passwords, but their efforts are auto datestamped.
<%else pagename = "test"&request("testpage") pagefile = "/test/test.asp" pagetitle = "Test Page "&request("testpage") %> <%if members_only and not (member or editor or master) then response.redirect("/common/members_only.asp") end if %> <%=SiteName%> <% datafile = "npc.mdb" datatable = "tbl_Pages" OpenOleConn(datadir&datafile) pMode = request("pmode") if not (editor or master) then pMode = "" ' stop any parameter hacking ! select case pMode case "edit" set rs = objConn.execute("SELECT * from "&datatable&" where ID = " & Request("ID")) if left(pagetitle,4) ="Test" then pagetitle = rs("pagename") %>
<%=pagetitle%> (editing)

Edit the text in the window as required, or you can 'cut and paste' html from an html editor program if you prefer.

"> password (currently only needed for read access of Test Pages)



">

Alternatively, simple formatting can be achieved with the following HTML'tags':

The tags can be used in combination, eg <b><i> bold italics </i></b>

The default font is already set to Arial, 13px ('size 2'), but if you insert a table, you then need to add class="ar" into the <table> tag.

<b> text to be in bold face </b>
<i> text to be in italics </i>
<u> text to be underlined </u>
<p> new paragraph </p>
<br> starts new line (just the one tag needed)
<hr> inserts a horizontal line
<% case "save changes" set rs = Server.CreateObject("ADODB.Recordset") rs.Open "select * from "&datatable&" where id=" & request.form("id"), objConn, 2, 3 rs("textcontent") = nz(Request.form("textcontent")) rs("password") = request.form("tpassword") rs("datestamp") = now() rs("author") = session("username") rs.update CloseData() if len(mtestpass) > 0 then response.redirect(pagefile&"?testpass="&mtestpass) else response.redirect(pagefile) end if case else Set rs = objConn.execute("SELECT * from "&datatable&" where pagename = '" & PageName & "'") %>
<%if rs.eof then %> <%else %> <%end if %>




no page content available at present

    (works with Internet Explorer only)

   <%=pagetitle%> <%If editor or master then%> &testpass=<%=mtestpass%>">edit this page   (last updated on <%=rs("datestamp")%> by <%=rs("author")%>) <%else if len(rs("datestamp"))>0 then%>   (last updated on <%=formatdatetime(rs("datestamp"),1)%>) <%end if End if %>

<%=rs("textcontent")%>
<%end select %> <%CloseData() %> <%end if %>