Print Page | Close Window

How to hide links for guest users

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums
Forum Description: Support forum for Web Wiz Forums application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=26665
Printed Date: 29 March 2026 at 4:41am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: How to hide links for guest users
Posted By: Gando
Subject: How to hide links for guest users
Date Posted: 13 December 2008 at 4:59pm
Hi Everyone,

How to hide links for guest users? If people are not members on forum, I want to hide links and then they will register after they can see the links.

Is that possible on WebWiz Forum?

Best Regards



Replies:
Posted By: Shaun
Date Posted: 16 December 2008 at 4:06am
The only way you can do that is to have the links in actual forum sections.. Then set the forum section to "Hide if no access", through your Admin panel.

So until they are registered, they won't see them.. Once registered, they will.

Do be advised though, surely it's easier to "dangle the carrot", so they can see the section and NOT access it, meaning they're gonna think about signing up - Over not even knowing it's there in the 1st place.


Posted By: Gando
Date Posted: 16 December 2008 at 9:45am
I found some codes but it doesn't work very well or some is not very good. I will give you a example.

Step 1: functions/functions_format_post.asp
'Return the function
searchHighlighter = strTempMessage
End Function


Open the functions_format_post.asp and find parent codes. After then add below codes.

'******************************************
'*** Hide Links ***
'******************************************
Function AntiLinkForGuest(strMessage,lngTopicID,lngLoggedInUserID)
Dim strHideMessage
Dim lngStartPos
Dim lngEndPos
Dim strBuildHideBlock
Dim strOriginalHideBlock
if lngLoggedInUserID = 2 Then
Do While InStr(1, strMessage, "<a", 1) > 0 AND InStr(1, strMessage, "</a>", 1) > 0
lngStartPos = InStr(1, strMessage, "<a", 1) + 2
lngEndPos = InStr(lngStartPos, strMessage, "</a>", 1)
If lngEndPos < lngStartPos Then lngEndPos = lngStartPos + 2
If lngEndPos > lngStartPos Then

strBuildHideBlock = "IfLinkleri Görebilmek için " &_
"<link href=""login_user.asp"">Login</a> or " &_
" <link href=""registration_rules.asp"">register</a> to see hide links."

End if

lngStartPos = InStr(1, strMessage, "<a", 1)
lngEndPos = InStr(lngStartPos, strMessage, "</a>", 1) + 4
If lngEndPos < lngStartPos Then lngEndPos = lngStartPos + 2
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
strMessage = Replace(strMessage, "<link", "<a", 1, -1, 1)
end if
AntiLinkForGuest = strMessage
End Function

Step 2: forum_post.asp

If InStr(1, strMessage, "
", 1) > 0 AND InStr(1, strMessage, "
", 1) > 0 Then strMessage = formatCode(strMessage)

Open the forum_post.asp and find parent codes. After then add below codes.
If InStr(1, strMessage, "<a", 1) > 0 AND InStr(1, strMessage, "</a>", 1) > 0 Then strMessage = AntiLinkForGuest(strMessage,lngTopicID,lngLoggedInUserID)




So everything looks fine but ideas is not right. Because if I add more than 1 link then this codes show all links like that.

Login or register to see hide links.
Login or register to see hide links.
Login or register to see hide links.
Login or register to see hide links.
Login or register to see hide links.

I need to select all link and add first [*HIDE] and after then [*/HIDE] of course without * :) And then it we can see only one line "Login or register to see hide links." for all links. I am not server side developer or coder. If somebody help me about this modification I will be appreciate.

http://forums.webwiz.net/forum_posts.asp?TID=26683#137341 -



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