Print Page | Close Window

About [hide][/hide] block

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums Modifications
Forum Description: Mod's and Add-on's for Web Wiz Forums.
URL: https://forums.webwiz.net/forum_posts.asp?TID=20790
Printed Date: 29 March 2026 at 4:24pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: About [hide][/hide] block
Posted By: jsaren
Subject: About [hide][/hide] block
Date Posted: 24 July 2006 at 9:02am
Here is a mod from http://www.webariza.net/ - http://www.webariza.net/  .
it has this feature:
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")
 strSQL = "SELECT  " & strDbTable & "Thread.* "
 strSQL = strSQL & "FROM " & strDbTable & "Thread "
 strSQL = strSQL & "WHERE Author_ID = " & lngLoggedInUserID & " and Topic_ID = "&lngTopicID
 
rsKontrol.Open strSQL, adoCon, 1, 3

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
 
   strBuildHideBlock = "<table width=""95%"" border=""0"" align=""center"" cellpadding=""0"" cellspacing=""0"">"
   strBuildHideBlock = strBuildHideBlock & vbCrLf & "<tr><td class=""bold"">Follow is hidden:<br>"
   strBuildHideBlock = strBuildHideBlock & vbCrLf & "   <table width=""100%"" border=""0"" cellpadding=""0"" cellspacing=""0"" class=""BBquote"">"
   strBuildHideBlock = strBuildHideBlock & vbCrLf & "    <tr>"
   strBuildHideBlock = strBuildHideBlock & vbCrLf & "       <td class=""text"" style=""font-family: Courier New, Courier, mono;"">" & strHideMessage & "</td>"
   strBuildHideBlock = strBuildHideBlock & vbCrLf & "      </tr>"
   strBuildHideBlock = strBuildHideBlock & vbCrLf & "  </table></td>"
   strBuildHideBlock = strBuildHideBlock & vbCrLf & "</tr>"
   strBuildHideBlock = strBuildHideBlock & vbCrLf & "</table>"
  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, "[", "&#91;", 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, "
Originally posted by , 1) > 0 AND InStr(1, strMessage, [/QUOTE , 1) > 0 AND InStr(1, strMessage, [/QUOTE wrote:

", 1) > 0 Then strMessage = formatUserQuote(strMessage)
  If InStr(1, strMessage, "
Quote ", 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)
 
only this!
 



Replies:
Posted By: jsaren
Date Posted: 24 July 2006 at 9:38am
Tips:
perhaps you can not read correct code, you can use  the butten"quote" or "reply " of the first post.
understand?


Posted By: asplearning
Date Posted: 26 July 2006 at 2:17am
Hi jsaren,
    I am a newie here.  I tried your instruction above but it did not work.  Can you please help me?

Microsoft OLE DB Provider for SQL Server error '80040e14'

Line 1: Incorrect syntax near ' '.

/forum/functions/functions_format_post.asp, line 132


Thanks




Posted By: asplearning
Date Posted: 26 July 2006 at 2:20am
Here is a functions_format_post.asp file

<%
'****************************************************************************************
'**  Copyright Notice   
'**
'**  Web Wiz Forums
'**  http://www.webwizforums.com
'**                                                             
'**  Copyright ©2001-2006 Web Wiz. All Rights Reserved.  
'** 
'**  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS UNDER LICENCE FROM 'WEB WIZ'.
'** 
'**  IF YOU DO NOT AGREE TO THE LICENCE AGREEMENT THEN 'WEB WIZ' IS UNWILLING TO LICENCE
'**  THE SOFTWARE TO YOU, AND YOU SHOULD DESTROY ALL COPIES YOU HOLD OF 'WEB WIZ' SOFTWARE
'**  AND DERIVATIVE WORKS IMMEDIATELY.
'** 
'**  If you have not received a copy of the licence with this work then a copy of the latest
'**  licence contract can be found at:-
'**
'**  http://www.webwiz.net/licence
'**
'**  For more information about this software and for licensing information please contact
'**  'Web Wiz' at the address and website below:-
'**
'**  Web Wiz, Unit 10E, Dawkins Road Industrial Estate, Poole, Dorset, BH15 4JD, England
'**  http://www.webwiz.net
'**
'**  Removal or modification of this copyright notice will violate the licence contract.
'**
'****************************************************************************************




'******************************************
'***    Strip entites from RTE posts   *****
'******************************************

Private Function WYSIWYGFormatPost(ByVal strMessage)

    'Format messages that use the WYSIWYG Editor
    strMessage = Replace(strMessage, " border=0>", ">", 1, -1, 1)
    strMessage = Replace(strMessage, " target=_blank>", ">", 1, -1, 1)
    strMessage = Replace(strMessage, " target=_top>", ">", 1, -1, 1)
    strMessage = Replace(strMessage, " target=_self>", ">", 1, -1, 1)
    strMessage = Replace(strMessage, " target=_parent>", ">", 1, -1, 1)
    strMessage = Replace(strMessage, " style=""CURSOR: hand""", "", 1, -1, 1)
   
    'Strip wordTidy tags
    strMessage = Replace(strMessage, "<wordTidy>", "", 1, -1, 1)
    strMessage = Replace(strMessage, "</wordTidy>", "", 1, -1, 1)
   
   
    'Strip out add blocking injection code
   
    'Strip out Norton Internet Security pop up add blocking injected code
    strMessage = Replace(strMessage, "<SCRIPT> window.open=NS_ActualOpen; </SCRIPT>", "", 1, -1, 1)
    strMessage = Replace(strMessage, "<SCRIPT language=javascript>postamble();</SCRIPT>", "", 1, -1, 1)
    strMessage = Replace(strMessage, "<SCRIPT language=""javascript"">postamble();</SCRIPT>", "", 1, -1, 1)
   
    'Strip out Zone Alarm Pro's pop up add blocking injected code (bloody pain in the arse crap software)
    If Instr(1, strMessage, "<!-- ZoneLabs Popup Blocking Insertion -->", 1) Then
        strMessage = Replace(strMessage, "<!-- ZoneLabs Popup Blocking Insertion -->", "", 1, -1, 1)
        strMessage = Replace(strMessage, "<SCRIPT>" & vbCrLf & "window.open=NS_ActualOpen;" & vbCrLf & "orig_onload = window.onload;" & vbCrLf & "orig_onunload = window.onunload;" & vbCrLf & "window.onload = noopen_load;" & vbCrLf & "window.onunload = noopen_unload;" & vbCrLf & "</SCRIPT>", "", 1, -1, 1)
        strMessage = Replace(strMessage, "window.open=NS_ActualOpen; orig_onload = window.onload; orig_onunload = window.onunload; window.onload = noopen_load; window.onunload = noopen_unload;", "", 1, -1, 1)
    End If
   
    'Strip out Norton Personal Firewall 2003's pop up add blocking injected code
    strMessage = Replace(strMessage, "<!--" & vbCrLf & vbCrLf & "window.open = SymRealWinOpen;" & vbCrLf & vbCrLf & "//-->", "", 1, -1, 1)
    strMessage = Replace(strMessage, "<!--" & vbCrLf & vbCrLf & "function SymError()" & vbCrLf & "{" & vbCrLf & "  return true;" & vbCrLf & "}" & vbCrLf & vbCrLf & "window.onerror = SymError;" & vbCrLf & vbCrLf & "//-->", "", 1, -1, 1)
    strMessage = Replace(strMessage, "<!--" & vbCrLf & vbCrLf & "function SymError()" & vbCrLf & "{" & vbCrLf & "  return true;" & vbCrLf & "}" & vbCrLf & vbCrLf & "window.onerror = SymError;" & vbCrLf & vbCrLf & "var SymRealWinOpen = window.open;" & vbCrLf & vbCrLf & "function SymWinOpen(url, name, attributes)" & vbCrLf & "{" & vbCrLf & "  return (new Object());" & vbCrLf & "}" & vbCrLf & vbCrLf & "window.open = SymWinOpen;" & vbCrLf & vbCrLf & "//-->", "", 1, -1, 1)

    'Strip out Kerio Firewall pop up add blocking injected code (now Sunbelt)
    strMessage = Replace(strMessage, "<!-- Kerio Popup Killer - script has been appended by KPF -->", "", 1, -1, 1)
    strMessage = Replace(strMessage, "<!-- Sunbelt Kerio Popup Killer -  has been appended by KPF -->", "", 1, -1, 1)
    strMessage = Replace(strMessage, "<iframe id=""kpfLogFrame"" src=""http://127.0.0.1:44501/pl.html?START_LOG"" onload=""destroyIframe(this)"" style=""display:none;"">" & vbCrLf & vbCrLf & "</iframe>", "", 1, -1, 1)
    strMessage = Replace(strMessage, "<iframe id=""kpfLogFrame"" src=""http://localhost:44501/pl.html?START_LOG"" onload=""destroyIframe(this)"" style=""display: none;"">" & vbCrLf & "</iframe>", "", 1, -1, 1)
    strMessage = Replace(strMessage, "<iframe id=""kpfLogFrame"" src=""http://127.0.0.1:44501/pl.html?START_LOG"" onload=""destroyIframe(this)"" style=""display: none;"">" & vbCrLf & "</iframe>", "", 1, -1, 1)
    strMessage = Replace(strMessage, "<script type=""text/javascript"">" & vbCrLf & "<!--" & vbCrLf & "    nopopups();" & vbCrLf & "//-->" & vbCrLf & "</script>", "", 1, -1, 1)
    strMessage = Replace(strMessage, "<script type=""text/javascript"">" & vbCrLf & "<!--" & vbCrLf & "nopopups();" & vbCrLf & "//-->" & vbCrLf & "</script>", "", 1, -1, 1)
    strMessage = Replace(strMessage, "<!-- Sunbelt Kerio Popup Killer - end of the  appended by KPF-->", "", 1, -1, 1)
    strMessage = Replace(strMessage, "<!-- Kerio Popup Killer - end of the script appended by KPF-->", "", 1, -1, 1)
   
    'Strip linux firewall for my LAN that injects this for ad blocking
    strMessage


Posted By: asplearning
Date Posted: 26 July 2006 at 2:22am
Here is a forum_post.asp file


        '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, "
Originally posted by , 1) > 0 AND InStr(1, strMessage, [/QUOTE , 1) > 0 AND InStr(1, strMessage, [/QUOTE wrote:

", 1) > 0 Then strMessage = formatUserQuote(strMessage)
        If InStr(1, strMessage, "
Quote ", 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, "[HIDE]", 1) > 0 AND InStr(1, strMessage, "[/HIDE]", 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




Posted By: jsaren
Date Posted: 26 July 2006 at 4:23am
Which database r you running?
i run it in Access database,it  do well.
something wrong with not access?


Posted By: asplearning
Date Posted: 26 July 2006 at 4:25am
Originally posted by jsaren jsaren wrote:

Which database r you running?
i run it in Access database,it  do well.
something wrong with not access?


I am running MS SQL.


Posted By: gölge
Date Posted: 26 July 2006 at 12:47pm
try this
 
strSQL = "SELECT " & strDbTable & "Thread.* "
 
i think there is a unneded space in code...



Posted By: asplearning
Date Posted: 26 July 2006 at 2:58pm
Originally posted by gölge gölge wrote:

try this
 
strSQL = "SELECT " & strDbTable & "Thread.* "
 
i think there is a unneded space in code...



It did not work golge

Microsoft OLE DB Provider for SQL Server error '80040e14'

Line 1: Incorrect syntax near '*'.

/forum/functions/functions_format_post.asp, line 132


Code:

strSQL = "SELECT" & strDbTable & "Thread.*"
strSQL = strSQL & "FROM " & strDbTable & "Thread "
strSQL = strSQL & "WHERE Author_ID = " & lngLoggedInUserID & " and Topic_ID = "&lngTopicID





Posted By: MadDog
Date Posted: 26 July 2006 at 9:41pm
You didnt copy the code correctly. Notice your missing a space.....

-------------
http://www.iportalx.net" rel="nofollow">


Posted By: asplearning
Date Posted: 26 July 2006 at 10:37pm
Originally posted by MadDog MadDog wrote:

You didnt copy the code correctly. Notice your missing a space.....


Thanks MD,  jsaren, and golge .  I got it works now.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net