if someone use the You must be a registered member and post a reply in this topic to view the hidden content within this post! ,then viewer can read it only after post a reply follow it.
I found even administrator and Moderator should reply to read the hides.
so i modified it to let admin and Moderator of this forum should not have to post reply to read it. Only The red code is mine.
Just following:
1、functions_format_post.asp
after this :
'Return the function WYSIWYGFormatPost = strMessage
End Function
and before this:
'****************************************** '*** Format Post Function ***** '******************************************
add this:
'****************************************** '*** Format Hide Block *** '******************************************
'This function formats the hide blocks Function formatHideCode(strMessage,lngTopicID,lngLoggedInUserID)
Dim strHideMessage Dim lngStartPos Dim lngEndPos Dim strBuildHideBlock Dim strOriginalHideBlock Dim rsKontrol Dim strSQL Dim MsjWAER
Set rsKontrol = Server.CreateObject("ADODB.Recordset")
if rsKontrol.Eof Then MsjWAER = False else MsjWAER = True end if
rsKontrol.Close Do While InStr(1, strMessage, " You must be a registered member and post a reply in this topic to view the hidden content within this post! ", 1) > 0 lngStartPos = InStr(1, strMessage, " You must be a registered member and post a reply in this topic to view the hidden content within this post! ", 1) If lngEndPos < lngStartPos Then lngEndPos = lngStartPos + 6 If lngEndPos > lngStartPos Then
if MsjWAER OR blnAdmin or blnModerator Then strHideMessage = Trim(Mid(strMessage, lngStartPos, lngEndPos-lngStartPos)) Else
strHideMessage = "<center><b>Follow be Hidden</b><font color=""#FF0000""><b><br>You can read it after you post reply !</font></b></center>" End if
lngStartPos = InStr(1, strMessage, " You must be a registered member and post a reply in this topic to view the hidden content within this post! ", 1) + 7 If lngEndPos < lngStartPos Then lngEndPos = lngStartPos + 6 strOriginalHideBlock = Trim(Mid(strMessage, lngStartPos, lngEndPos-lngStartPos)) If strBuildHideBlock <> "" Then strMessage = Replace(strMessage, strOriginalHideBlock, strBuildHideBlock, 1, -1, 1) Else strMessage = Replace(strMessage, strOriginalHideBlock, Replace(strOriginalHideBlock, "[", "[", 1, -1, 1), 1, -1, 1) End If Loop
formatHideCode = strMessage End Function
2、forum_posts.asp
afte this :
'If the post contains a quote or code block then format it If InStr(1, strMessage, "
, 1) > 0 AND InStr(1, strMessage, [/QUOTE wrote:
", 1) > 0 Then strMessage = formatUserQuote(strMessage) If InStr(1, strMessage, "
", 1) > 0 AND InStr(1, strMessage, "
", 1) > 0 Then strMessage = formatUserQuote(strMessage) If InStr(1, strMessage, "[QUOTE]", 1) > 0 AND InStr(1, strMessage, "
", 1) > 0 Then strMessage = formatQuote(strMessage) If InStr(1, strMessage, "
", 1) > 0 AND InStr(1, strMessage, "
", 1) > 0 Then strMessage = formatCode(strMessage)
add this:
If InStr(1, strMessage, " You must be a registered member and post a reply in this topic to view the hidden content within this post! ", 1) > 0 Then strMessage = formatHideCode(strMessage,lngTopicID,lngLoggedInUserID)
'If the poster is a guest see if they have entered their name in the GuestName table and get it If lngUserID = 2 AND strGuestUsername <> "" Then strUsername = strGuestUsername
'If the post contains a quote or code block then format it If InStr(1, strMessage, "
, 1) > 0 AND InStr(1, strMessage, [/QUOTE wrote:
", 1) > 0 Then strMessage = formatUserQuote(strMessage) If InStr(1, strMessage, "
", 1) > 0 AND InStr(1, strMessage, "
", 1) > 0 Then strMessage = formatUserQuote(strMessage) If InStr(1, strMessage, "[QUOTE]", 1) > 0 AND InStr(1, strMessage, "
", 1) > 0 Then strMessage = formatQuote(strMessage) If InStr(1, strMessage, "
", 1) > 0 AND InStr(1, strMessage, "
", 1) > 0 Then strMessage = formatCode(strMessage) If InStr(1, strMessage, " You must be a registered member and post a reply in this topic to view the hidden content within this post! ", 1) > 0 Then strMessage = formatHideCode(strMessage,lngTopicID,lngLoggedInUserID)
'If the post contains a flash link then format it If blnFlashFiles Then If InStr(1, strMessage, "[FLASH", 1) > 0 AND InStr(1, strMessage, "[/FLASH]", 1) > 0 Then strMessage = formatFlash(strMessage) If InStr(1, strAuthorSignature, "[FLASH", 1) > 0 AND InStr(1, strAuthorSignature, "[/FLASH]", 1) > 0 Then strAuthorSignature = formatFlash(strAuthorSignature) End If
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum
Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.
Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.