Please is there any way to hide links on visitors

Snitz™ Forums 2000
https://forum.snitz.com/forumTopic/Posts/69731?pagenum=1
05 November 2025, 16:44

Topic


AHMEDHHH1
Please is there any way to hide links on visitors
25 October 2010, 22:09



Please is there any way to hide links on visitors and members inside the topics

so we can post a reply in the topic

 

Replies ...


HuwR
26 October 2010, 02:27


product-hide ?
AHMEDHHH1
26 October 2010, 08:05


Please is there any way to hide links on visitors and members inside the topics

so we can post a reply in the topic
ruirib
26 October 2010, 09:49


No, there is no such way. It's either full access to topic (actually to the forum where the topic is located) or no access to the topic at all.
AHMEDHHH1
26 October 2010, 18:17


could you add this characteristic?x

or could anyone explain to me how to do it ?x
Podge
27 October 2010, 08:44


Are you talking about showing external links within topics only to members that are logged in?
AHMEDHHH1
27 October 2010, 10:14



Yes

Originally posted by Podge
Are you talking about showing external links within topics only to members that are logged in?
Podge
27 October 2010, 13:06


I did that recently and its not that difficult. I will post instructions later.
Podge
27 October 2010, 15:04


Instructions for a default version of V3.4.07

Open inc_func_common.asp
About line 1553 add the following code

Code:
function withoutLinks (strInput)
Set rx = New RegExp
With rx
.Pattern = "<(a*)([^/]*)/([A-Za-z0-9]?[^>]+)"">([A-Za-z0-9]?[^>]+)</a>"
.IgnoreCase = True
.Global = True
End With
withoutLinks = rx.Replace (strInput, "<a href=""login.asp"" target=""_blank"">You must be logged in to see this link.</a>")
end Function

More in a few minutes.
Podge
27 October 2010, 15:09


Open topic.asp
About line 646 find the following code
Code:
            if Request.QueryString("SearchTerms") <> "" then
Response.Write SearchHiLite(formatStr(Reply_Content))
else
Response.Write formatStr(Reply_Content)
end if

Replace it with
Code:
            if strDBNTUserName = "" then
Cleaned_Reply_Content = withoutLinks(formatStr(Reply_Content))
else
Cleaned_Reply_Content = formatStr(Reply_Content)
end if
if Request.QueryString("SearchTerms") <> "" then
Response.Write SearchHiLite(Cleaned_Reply_Content)
else
Response.Write formatStr(Cleaned_Reply_Content)
end if
Podge
27 October 2010, 15:13


Still in topic.asp
Around line 852 find the following code
Code:
    if Request.QueryString("SearchTerms") <> "" then
Response.Write SearchHiLite(formatStr(Topic_Message))
else
Response.Write formatStr(Topic_Message)
end if

Replace it with
Code:
    if strDBNTUserName = "" then
Cleaned_Topic_Message = withoutLinks(formatStr(Topic_Message))
else
Cleaned_Topic_Message = formatStr(Topic_Message)
end if
if Request.QueryString("SearchTerms") <> "" then
Response.Write SearchHiLite(Cleaned_Topic_Message)
else
Response.Write Cleaned_Topic_Message
end if

This code is largely untested and I suspect that the regex needs a little work. Please post comments, suggestions and improvements and I'll package it in a mod and put it on SnitzBitz.
I think something like this should be included in the base code so that Snitz would be less of a target for spammers.
AHMEDHHH1
28 October 2010, 06:28



Thank you very much brother Podge

The structure was perfectly working ,And I will refer some part of idea later


I want also hide the links from the members who have not replied to the topic


This feature will be on in the forums which only specified

And the help still going on INCHALLAH of this proposals
Podge
28 October 2010, 09:00


You would have to add two boolean fields to the FORUM_FORUM table. One to allow/disallow links in the topic text and the other to allow/disallow links in the reply text. It should probably be settable in the edit forum page.
I'll look at the code in topic.asp and see how easy it is to work out if the logged in member has replied to the thread.
AHMEDHHH1
28 October 2010, 09:47


This feature will be on in the forums which only specified

Open post_info.asp

Around line 179 find the following code


"T.T_STATUS, T.T_AUTHOR, T.T_SUBJECT " &_

Replace it with
"T.T_STATUS, T.T_AUTHOR, T.T_SUBJECT, F_Lenk" &_

Around line 189 find the following code

"F.FORUM_ID, F.F_STATUS, F.F_TYPE, F.F_SUBJECT " &_
Replace it with


"F.FORUM_ID, F.F_STATUS, F.F_TYPE, F.F_SUBJECT, F_Lenk " &_


Around line 1176 find the following code

strSql = strSql & ", F_SUBJECT"

And add below it:

strSql = strSql & ", F_Lenk"

Around line 1418 find the following code

strSql = strSql & ", F_SUBJECT = '" & txtSubject & "'"

And add below it:

strSql = strSql & ", F_Lenk = '" & Request.Form("ForumLenk")& "'"
AHMEDHHH1
28 October 2010, 09:59


Open post.asp

Around line 752 find the following code

if strRqMethod = "Forum" or _
strRqMethod = "EditForum" then
Response.Write " <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ noWrap vAlign=""top"" align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Increase Post Count:</b></font></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """><select name=""ForumCntMPosts"" size=""1"">" & vbNewLine & _
" <option value=""0"""
if fForumCntMPosts = "0" then Response.Write(" selected")
Response.Write ">No</option>" & vbNewLine & _
" <option value=""1"""
if fForumCntMPosts = "1" or fForumCntMPosts = "" then Response.Write(" selected")
Response.Write ">Yes</option>" & vbNewLine & _
" </select>" & vbNewLine & _
" <a href=""Javascript:openWindow3('pop_help.asp?mode=options#forumcntmposts')"" tabindex=""-1"">" & getCurrentIcon(strIconSmileQuestion,"Click here to get more help on this option","") & "</a></td>" & vbNewLine & _
" </tr>" & vbNewLine
end if



And add below it:

if strRqMethod = "Forum" or _
strRqMethod = "EditForum" then
Response.Write " <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ noWrap vAlign=""top"" align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Hide link for visitors:</b></font></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """><select name=""ForumLenk"" size=""1"">" & vbNewLine & _
" <option value=""0"""
if fForumCntMPosts = "0" then Response.Write(" selected")
Response.Write ">No</option>" & vbNewLine & _
" <option value=""1"""
if fForumCntMPosts = "1" or fForumCntMPosts = "" then Response.Write(" selected")
Response.Write ">Yes</option>" & vbNewLine & _
" </select>" & vbNewLine & _
end if

AHMEDHHH1
28 October 2010, 10:14


Open topic.asp
Around line 101 find the following code

", F.F_STATUS, F.FORUM_ID, F.F_SUBSCRIPTION, F.F_SUBJECT, F.F_MODERATION, T.T_MESSAGE"
Replace it with

", F.F_STATUS, F.FORUM_ID, F.F_SUBSCRIPTION, F.F_SUBJECT, F.F_MODERATION, T.T_MESSAGE, F_Lenk"

Around line 101 find the following code

Topic_Message = rsTopic("T_MESSAGE")

And add below it:

ForumLenk = rsTopic("F_Lenk")


Around line 852 find the following code

if Request.QueryString("SearchTerms") <> "" then
Response.Write SearchHiLite(formatStr(Topic_Message))
else
Response.Write formatStr(Topic_Message)
end if


Replace it with

if strDBNTUserName = "" and ForumLenk = 0 then
Cleaned_Topic_Message = withoutLinks(formatStr(Topic_Message))
else
Cleaned_Topic_Message = formatStr(Topic_Message)
end if
if Request.QueryString("SearchTerms") <> "" then
Response.Write SearchHiLite(Cleaned_Topic_Message)
else
Response.Write Cleaned_Topic_Message
end if

AHMEDHHH1
28 October 2010, 10:21


Add this code

[ALTER] FORUM
ADD#F_Lenk#int#NULL#0
[END]
AHMEDHHH1
28 October 2010, 10:42


everything is done we have left just hiding links on members who didn't post a reply in my topic
Podge
28 October 2010, 12:37


It will be a few hours before I can take a look at it (still at work).
Carefree
28 October 2010, 16:29


Here you go Podge. I have it working on the test site. If you see something to change, feel free.
Save the following as "dbs_links.asp". Run from admin console.
Code:

Allowed Links Mod v1.0

[ALTER] FORUM
ADD#F_TOPICLINK#INT#NULL#1
ADD#F_REPLYLINK#INT#NULL#1
[END]
[UPDATE] FORUM
F_TOPICLINK#1#
F_REPLYLINK#1#
[END]

Change the following files as indicated:

"inc_func_common.asp"
Code:

Add the following to the end of the file:

'########################################## Links Mod ##############################################
function WithoutLinks(strInput)
Set rx = New RegExp
With rx
.Pattern = "<(a*)([^/]*)/([A-Za-z0-9]?[^>]+)"">([A-Za-z0-9]?[^>]+)</a>"
.IgnoreCase = True
.Global = True
End With
if intLAllowed = 0 and strDBNTUserName > "" then
if Reply_ReplyID > 0 then
WithoutLinks = rx.Replace(strInput, "(Links not allowed in replies. Go <a href=""post.asp?method=Edit&TOPIC_ID=" & TopicID & "&REPLY_ID=" & Reply_ReplyID & "&FORUM_ID=" & FORUM_ID & """ target=""_self"">back</a> to edit this reply.)")
else
WithoutLinks = rx.Replace(strInput, "(Links not allowed in topics. Go <a href=""post.asp?method=EditTopic&TOPIC_ID=" & TopicID & "&REPLY_ID=" & TopicID & "&FORUM_ID=" & FORUM_ID & """ target=""_self"">back</a> to edit this topic.)")
end if
else
WithoutLinks = rx.Replace(strInput, "(<a href=""login.asp"" target=""_blank"">Login</a> to see this link.)")
end if
end Function
'########################################## Links Mod ##############################################


"post.asp"
Code:

Look for the following lines (appx 618-621):

Response.Write " </select>" & vbNewLine & _
" <a href=""Javascript:openWindow3('pop_help.asp?mode=options#category')"" tabindex=""-1"">" & getCurrentIcon(strIconSmileQuestion,"Click here to get more help on this option","") & "</a></td>" & vbNewLine & _
" </tr>" & vbNewLine
end if

After them, insert these:

'########################################## Links Mod ##############################################
if strRqMethod = "Forum" or strRqMethod = "EditForum" then
Response.Write " <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ noWrap vAlign=""top"" align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Links Permission:</b></font><br /><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>(Links Allowed?)</font></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """>" & vbNewLine & _
" <select name=""LinkAuth"" size=""1"">" & vbNewLine
if strRqMethod = "Forum" then
intTLink = 0
intRLink = 0
else
strSQL = "SELECT F_TOPICLINK, F_REPLYLINK FROM " & strTablePrefix & "FORUM WHERE FORUM_ID = " & strRqForumID
set rsLinks = my_Conn.Execute(strSQL)
if not rsLinks.EOF then
intTLink = rsLinks("F_TOPICLINK")
intRLink = rsLinks("F_REPLYLINK")
rsLinks.Close
end if
set rsLinks = Nothing
end if
Response.Write " <option value=""0"""
if intTLink = 0 and intRLink = 1 then Response.Write(" selected")
Response.Write ">Don't Allow Links in Topics</option>" & vbNewLine & _
" <option value=""1"""
if intTLink = 1 and intRLink = 0 then Response.Write(" selected")
Response.Write ">Don't Allow Links in Replies</option>" & vbNewLine & _
" <option value=""2"""
if intTLink = 0 and intRLink = 0 then Response.Write(" selected")
Response.Write ">Don't Allow Links in Topics or Replies</option>" & vbNewLine & _
" <option value=""3"""
if intTLink = 1 and intRLink = 1 then Response.Write(" selected")
Response.Write ">Allow Links in Topics and Replies</option>" & vbNewLine & _
" </select>" & vbNewLine & _
" <a href=""Javascript:openWindow3('pop_help.asp?mode=linksmod#permission')"" tabindex=""-1"">" & getCurrentIcon(strIconSmileQuestion,"Click here to get more help on this option","") & "</a></td>" & vbNewLine & _
" </tr>" & vbNewLine
end if
'########################################## Links Mod ##############################################

"post_info.asp"
Code:

Look for the following lines (appx 1428-1429):

strSql = strSql & ", F_DEFAULTDAYS = " & cLng(Request.Form("DefaultDays"))
strSql = strSql & ", F_COUNT_M_POSTS = " & cLng("0" & Request.Form("ForumCntMPosts"))

After them, insert these:

'########################################## Links Mod ##############################################
if ChkString(Request.Form("LinkAuth"), "SQLString") = 3 then
strSql = strSql & ", F_TOPICLINK = 1, F_REPLYLINK = 1"
elseif ChkString(Request.Form("LinkAuth"), "SQLString") = 2 then
strSql = strSql & ", F_TOPICLINK = 0, F_REPLYLINK = 0"
elseif ChkString(Request.Form("LinkAuth"), "SQLString") = 1 then
strSql = strSql & ", F_TOPICLINK = 1, F_REPLYLINK = 0"
else
strSql = strSql & ", F_TOPICLINK = 0, F_REPLYLINK = 1"
end if
'########################################## Links Mod ##############################################

Next, look for the following lines (appx 1220-1221):

strSql = strSql & ", " & ChkString(Request.Form("DefaultDays"), "SQLString")
strSql = strSql & ", " & ChkString(Request.Form("ForumCntMPosts"), "SQLString")

After them, insert these:

'########################################## Links Mod ##############################################
if ChkString(Request.Form("LinkAuth"), "SQLString") = 3 then
strSql = strSql & ", 1, 1"
elseif ChkString(Request.Form("LinkAuth"), "SQLString") = 2 then
strSql = strSql & ", 0, 0"
elseif ChkString(Request.Form("LinkAuth"), "SQLString") = 1 then
strSql = strSql & ", 1, 0"
else
strSql = strSql & ", 0, 1"
end if
'########################################## Links Mod ##############################################

Next, look for the following lines (appx 1189-1190):

strSql = strSql & ", F_DEFAULTDAYS "
strSql = strSql & ", F_COUNT_M_POSTS "

After them, insert these:

'########################################## Links Mod ##############################################
strSql = strSql & ", F_TOPICLINK "
strSql = strSql & ", F_REPLYLINK "
'########################################## Links Mod ##############################################

"topic.asp"
Code:

Look for the following lines (appx 848-852):

if Request.QueryString("SearchTerms") <> "" then
Response.Write SearchHiLite(formatStr(Topic_Message))
else
Response.Write formatStr(Topic_Message)
end if

Change them to say:

'########################################## Links Mod ##############################################
strSQL = "SELECT F_TOPICLINK FROM " & strTablePrefix & "FORUM WHERE FORUM_ID = " & Forum_ID
set rsLAllowed = my_Conn.Execute(strSQL)
intLAllowed = 0
if not rsLAllowed.EOF then
intLAllowed = rsLAllowed("F_TOPICLINK")
rsLAllowed.Close
end if
set rsLAllowed = Nothing
strSQL = "SELECT REPLY_ID FROM " & strTablePrefix & "REPLY WHERE TOPIC_ID = " & TopicID & " AND REPLY_ID = " & MemberID
set rsReplied = my_Conn.Execute(strSQL)
intReplied = 0
if not rsReplied.EOF or (TopicID = MemberID) then
intReplied = 1
rsReplied.Close
end if
set rsReplied = Nothing
if ((strDBNTUserName = "") or (intReplied = 0)) and (intLAllowed = 0) then
Cleaned_Topic_Message = WithoutLinks(formatStr(Topic_Message))
else
Cleaned_Topic_Message = formatStr(Topic_Message)
end if
if Request.QueryString("SearchTerms") <> "" then
Response.Write SearchHiLite(formatStr(Cleaned_Topic_Message))
else
Response.Write SearchHiLite(formatStr(Cleaned_Topic_Message))
end if
'########################################## Links Mod ##############################################

Next, look for the following lines (appx 644-647):

Response.Write " <hr noshade size=""" & strFooterFontSize & """></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td valign=""top"" height=""100%""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """><span class=""spnMessageText"" id=""msg"">"

After them, insert these:

'########################################## Links Mod ##############################################
strSQL = "SELECT F_REPLYLINK FROM " & strTablePrefix & "FORUM WHERE FORUM_ID = " & Forum_ID
set rsLAllowed = my_Conn.Execute(strSQL)
intLAllowed = 0
if not rsLAllowed.EOF then
intLAllowed = rsLAllowed("F_REPLYLINK")
rsLAllowed.Close
end if
set rsLAllowed = Nothing
if ((strDBNTUserName = "") or (intReplied = 0)) and (intLAllowed = 0) then
Cleaned_Reply_Content = WithoutLinks(formatStr(Reply_Content))
else
Cleaned_Reply_Content = FormatStr(chkString(Reply_Content, "SQLString"))
end if
'########################################## Links Mod ##############################################

"pop_help.asp"
Code:

Look for the following line (appx 160):

case else
Above it, insert these:

'########################################## Links Mod ##############################################
case "linksmod"
'### Links Permission Help
Response.Write " <tr>" & vbNewLine & _
" <td bgcolor=""" & strCategoryCellColor & """><a name=""permission""></a><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strCategoryFontColor & """ ><b>What is Links Permissions?</b></font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strForumCellColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & vbNewLine & _
" Links Permission allows you to choose whether links are allowed in topics or replies for a particular forum.<br /><br />" & vbNewLine & _
" <li><b>Don't Allow Links in Topics:</b> Links will be allowed in replies within a forum, but not in new topics.</li>" & vbNewLine & _
" <li><b>Don't Allow Links in Replies:</b> Links will be allowed in topics within a forum, but not in replies.</li>" & vbNewLine & _
" <li><b>Don't Allow Links in Topics or Replies:</b> No links will be allowed in either topics or replies within a forum.</li>" & vbNewLine & _
" <li><b>Allow Links in Topics and Replies:</b> This is the default setting. Links will be allowed in both topics and replies within a forum.</li></font>" & vbNewLine & _
" <a href=""#top"">" & getCurrentIcon(strIconGoUp,"Go To Top Of Page","align=""right""") & "</a>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine
'##################################################################################################
AHMEDHHH1
29 October 2010, 17:40


The structure was perfectly working
Thank you very much brother Podge + Carefree


Carefree
29 October 2010, 20:35


Any time. Podge did the hard part, my regex abilities are about nil.
Podge
01 November 2010, 07:25


If you notice any links that are shown to users that are not logged in can you post them here? There may be some that are not caught by the regex.
AHMEDHHH1
04 November 2010, 11:19



Originally posted by Podge
If you notice any links that are shown to users that are not logged in can you post them here? There may be some that are not caught by the regex.
Yes
Podge
05 November 2010, 07:27


Can you give me a link to the original post?
AHMEDHHH1
06 November 2010, 16:19


the site is in arabic and you'll face some defficulties to understand it*

but a message is being sent to you through e-mail as a link

the example that i already post*

but is there a way to hide links like the one in the picture below

Podge
07 November 2010, 07:44


I tested the link you sent me and it is caught by the regex. Its not shown to users that are not logged in.
I'm not sure what you are trying to hide as what you're pointing to isn't a link.
AHMEDHHH1
09 November 2010, 16:35


link the example that i already post
HTML
<A href="http://forum.snitz.com/forum/topic.asp?TOPIC_ID=69731&whichpage=2"><FONT color=#008000 size=4>forum.snitz</FONT></A>
Podge
09 November 2010, 19:28


<FONT color=#008000 size=4>forum.snitz</FONT> is not a link.
http://forum.snitz.com/forum/topic.asp?TOPIC_ID=69731&whichpage=2 is caught by the regex and not shown to users that are not logged in.
AHMEDHHH1
12 November 2010, 07:33


The members here sometimes put links with this from and it shows for everybody

you do your best brother but many links don't show up to the visitors unless if they registered and for the members unless if they add a reply

it still just this kind, i will try to solve that problem inchallah thank you brother podge for the cooperation


© 2000-2021 Snitz™ Communications