Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 Please is there any way to hide links on visitors
 New Topic  Reply to Topic
 Printer Friendly
Previous Page
Author Previous Topic Topic Next Topic
Page: of 2

AHMEDHHH1
Junior Member

Egypt
105 Posts

Posted - 28 October 2010 :  10:21:46  Show Profile  Reply with Quote
Add this code

[ALTER]
FORUM
ADD#F_Lenk#int#NULL#0
[END]
Go to Top of Page

AHMEDHHH1
Junior Member

Egypt
105 Posts

Posted - 28 October 2010 :  10:42:52  Show Profile  Reply with Quote
everything is done we have left just hiding links on members who didn't post a reply in my topic
Go to Top of Page

Podge
Support Moderator

Ireland
3775 Posts

Posted - 28 October 2010 :  12:37:22  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message  Reply with Quote
It will be a few hours before I can take a look at it (still at work).

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 28 October 2010 :  16:29:51  Show Profile  Reply with Quote
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.


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"


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"


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"


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"


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"


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
'##################################################################################################

Edited by - Carefree on 28 October 2010 16:58:40
Go to Top of Page

AHMEDHHH1
Junior Member

Egypt
105 Posts

Posted - 29 October 2010 :  17:40:04  Show Profile  Reply with Quote
The structure was perfectly working
Thank you very much brother Podge + Carefree


Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 29 October 2010 :  20:35:33  Show Profile  Reply with Quote
Any time. Podge did the hard part, my regex abilities are about nil.
Go to Top of Page

Podge
Support Moderator

Ireland
3775 Posts

Posted - 01 November 2010 :  07:25:31  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message  Reply with Quote
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.

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page

AHMEDHHH1
Junior Member

Egypt
105 Posts

Posted - 04 November 2010 :  11:19:17  Show Profile  Reply with Quote

quote:
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
Go to Top of Page

Podge
Support Moderator

Ireland
3775 Posts

Posted - 05 November 2010 :  07:27:42  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message  Reply with Quote
Can you give me a link to the original post?

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page

AHMEDHHH1
Junior Member

Egypt
105 Posts

Posted - 06 November 2010 :  16:19:08  Show Profile  Reply with Quote
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


Edited by - AHMEDHHH1 on 06 November 2010 16:38:08
Go to Top of Page

Podge
Support Moderator

Ireland
3775 Posts

Posted - 07 November 2010 :  07:44:08  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message  Reply with Quote
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.

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page

AHMEDHHH1
Junior Member

Egypt
105 Posts

Posted - 09 November 2010 :  16:35:26  Show Profile  Reply with Quote
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>

Edited by - AHMEDHHH1 on 09 November 2010 16:36:27
Go to Top of Page

Podge
Support Moderator

Ireland
3775 Posts

Posted - 09 November 2010 :  19:28:49  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message  Reply with Quote
<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.

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page

AHMEDHHH1
Junior Member

Egypt
105 Posts

Posted - 12 November 2010 :  07:33:32  Show Profile  Reply with Quote
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


Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Previous Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.28 seconds. Powered By: Snitz Forums 2000 Version 3.4.07