Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - How to hide links for guest users
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to hide links for guest users

 Post Reply Post Reply
Author
Gando View Drop Down
Groupie
Groupie


Joined: 30 June 2005
Location: Turkey
Status: Offline
Points: 52
Post Options Post Options   Thanks (0) Thanks(0)   Quote Gando Quote  Post ReplyReply Direct Link To This Post Topic: How to hide links for guest users
    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
Back to Top
Shaun View Drop Down
Groupie
Groupie


Joined: 24 February 2006
Status: Offline
Points: 78
Post Options Post Options   Thanks (0) Thanks(0)   Quote Shaun Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Gando View Drop Down
Groupie
Groupie


Joined: 30 June 2005
Location: Turkey
Status: Offline
Points: 52
Post Options Post Options   Thanks (0) Thanks(0)   Quote Gando Quote  Post ReplyReply Direct Link To This Post 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.

Also you can check this topic!

Thank you for helping me.


Edited by Gando - 16 December 2008 at 1:40pm
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

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.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.