I just wrote a function for this. I put it through a few test, and it seems to work fine. The problem with it is, a nonmember can still see the content in "Reply with Quote". I can write a function to deal with this, but I just can't think of a good way to do it.
a. Remove the hidden content for nonmembers and leave the hide tags visible to members. (Problems: members may remove one or more hide tags before posting)
b. Remove hidden content for everyone. (Problem: Member could still cut and paste.)
c. ?
On the other hand this would work great on locked topics.
Here's the code if you want to test it.
inc_func_common.asp
around line 116 find these lines
function FormatStr(fString)
on Error resume next
add this line under that
if DoHide = true then fString = ReplaceHideTags(fString)
around line 150 find these lines
if strAllowForumCode = "1" then
fString = extratags(fString)
end if
FormatStr = fString
on Error goto 0
end function
Add this code under that
Function ReplaceHideTags(fString)
Dim regEx
Dim strMsg
Set regEx = New RegExp
regEx.IgnoreCase = True
regEx.Global = True
regEx.MultiLine = True
'## Message to none members.
'## Use html not forum code.
'## No message __ strMsg = ""
strMsg = "<b><u>You Must Be Logged In to View This Content.</u></b>"
if mLev > 0 then
regEx.Pattern = "\[HIDE\]([\s\S]*?)\[/HIDE\]"
fString = regEx.Replace(fString,"$1")
else
regEx.Pattern = "\[HIDE\][\s\S]*?\[/HIDE\]"
fString = regEx.Replace(fString,strMsg)
end if
Set regEx = Nothing
ReplaceHideTags = fString
End Function
topic.asp
around line 35 find these lines
%>
<!--#INCLUDE FILE="config.asp"-->
<%
Add this line under that
DoHide = true
Thats it
hide tags - [hide] - [/hide] upper or lower case<