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/O Code)
 Hide links from guest users.
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Ghostman
Starting Member

Portugal
6 Posts

Posted - 30 January 2009 :  13:50:24  Show Profile  Visit Ghostman's Homepage  Reply with Quote
I was looking for a mod that would give me the possibility to hide http:// links from guests.
The main idea is to add a [hide][/hide] so if i want to hide a url from a guest i would use that code and a guest would see a message like "only registered members can see the links" instead of the links.
Can anyone help me with that?

Thanks

<moved from="Help: General / Current Version (v3.4.xx)" by="Shaggy" /><

Edited by - Shaggy on 30 January 2009 13:53:52

leatherlips
Senior Member

USA
1838 Posts

Posted - 30 January 2009 :  20:32:54  Show Profile  Visit leatherlips's Homepage  Reply with Quote
I believe this thread has the information you are looking for:

http://forum.snitz.com/forum/topic.asp?TOPIC_ID=64934<

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD
Go to Top of Page

Ghostman
Starting Member

Portugal
6 Posts

Posted - 30 January 2009 :  23:41:21  Show Profile  Visit Ghostman's Homepage  Reply with Quote
i have tried that and it's not working.

is there a way to change the spoiler tag to make it hide tag and do what I need?<
Go to Top of Page

cripto9t
Average Member

USA
881 Posts

Posted - 31 January 2009 :  10:43:21  Show Profile  Reply with Quote
I just wrote a function for this. I put it through a few test, and it seems to work fine. The problem with it is, a nonmember can still see the content in "Reply with Quote". I can write a function to deal with this, but I just can't think of a good way to do it.

a. Remove the hidden content for nonmembers and leave the hide tags visible to members. (Problems: members may remove one or more hide tags before posting)

b. Remove hidden content for everyone. (Problem: Member could still cut and paste.)

c. ?

On the other hand this would work great on locked topics.

Here's the code if you want to test it.

inc_func_common.asp

around line 116 find these lines
function FormatStr(fString)
	on Error resume next

add this line under that
        if DoHide = true then fString = ReplaceHideTags(fString)

around line 150 find these lines
	if strAllowForumCode = "1" then
		fString = extratags(fString)
	end if
	FormatStr = fString
	on Error goto 0
end function

Add this code under that
Function ReplaceHideTags(fString)
    Dim regEx
    Dim strMsg

    Set regEx = New RegExp
    regEx.IgnoreCase = True
    regEx.Global = True
    regEx.MultiLine = True

    '## Message to none members. 
    '## Use html not forum code. 
    '## No message __ strMsg = ""
    strMsg = "<b><u>You Must Be Logged In to View This Content.</u></b>" 

    if mLev > 0 then
        regEx.Pattern = "\[HIDE\]([\s\S]*?)\[/HIDE\]"
        fString = regEx.Replace(fString,"$1")
    else
        regEx.Pattern = "\[HIDE\][\s\S]*?\[/HIDE\]"
        fString = regEx.Replace(fString,strMsg)
    end if

    Set regEx = Nothing
        
    ReplaceHideTags = fString
End Function


topic.asp

around line 35 find these lines
%>
<!--#INCLUDE FILE="config.asp"-->
<%

Add this line under that
DoHide = true


Thats it
hide tags - [hide] - [/hide] upper or lower case<

    _-/Cripto9t\-_

Edited by - cripto9t on 31 January 2009 10:49:38
Go to Top of Page

modifichicci
Average Member

Italy
787 Posts

Posted - 31 January 2009 :  11:30:00  Show Profile  Visit modifichicci's Homepage  Reply with Quote
Maybe adding an if strDBNTUserName <> "" before showing the reply with quote button?<

Ernia e Laparocele
Forum di Ernia e Laparocele
Acces - MySql Migration Tutorial
Adamantine forum
Go to Top of Page

Ghostman
Starting Member

Portugal
6 Posts

Posted - 31 January 2009 :  21:47:18  Show Profile  Visit Ghostman's Homepage  Reply with Quote
quote:
Originally posted by cripto9t

I just wrote a function for this. I put it through a few test, and it seems to work fine. The problem with it is, a nonmember can still see the content in "Reply with Quote". I can write a function to deal with this, but I just can't think of a good way to do it.

a. Remove the hidden content for nonmembers and leave the hide tags visible to members. (Problems: members may remove one or more hide tags before posting)

b. Remove hidden content for everyone. (Problem: Member could still cut and paste.)

c. ?

On the other hand this would work great on locked topics.

Here's the code if you want to test it.

inc_func_common.asp

around line 116 find these lines
function FormatStr(fString)
	on Error resume next

add this line under that
        if DoHide = true then fString = ReplaceHideTags(fString)

around line 150 find these lines
	if strAllowForumCode = "1" then
		fString = extratags(fString)
	end if
	FormatStr = fString
	on Error goto 0
end function

Add this code under that
Function ReplaceHideTags(fString)
    Dim regEx
    Dim strMsg

    Set regEx = New RegExp
    regEx.IgnoreCase = True
    regEx.Global = True
    regEx.MultiLine = True

    '## Message to none members. 
    '## Use html not forum code. 
    '## No message __ strMsg = ""
    strMsg = "<b><u>You Must Be Logged In to View This Content.</u></b>" 

    if mLev > 0 then
        regEx.Pattern = "\[HIDE\]([\s\S]*?)\[/HIDE\]"
        fString = regEx.Replace(fString,"$1")
    else
        regEx.Pattern = "\[HIDE\][\s\S]*?\[/HIDE\]"
        fString = regEx.Replace(fString,strMsg)
    end if

    Set regEx = Nothing
        
    ReplaceHideTags = fString
End Function


topic.asp

around line 35 find these lines
%>
<!--#INCLUDE FILE="config.asp"-->
<%

Add this line under that
DoHide = true


Thats it
hide tags - [hide] - [/hide] upper or lower case



Tested and it works like a charm.
Thanks so much.


Can you give a code to add a button to place the tags on the topic response form?<
Go to Top of Page

Classicmotorcycling
Development Team Leader

Australia
2085 Posts

Posted - 01 February 2009 :  00:53:58  Show Profile  Reply with Quote
If you have the other part working, this should allow you to add a button to be able press a button. You will need to edit 3 files and add an icon to your forum image folder:

inc_code.js:



function hideurl() {
	var text = getText();
 	if (helpstat) {
		alert("Hide URLs from non-members.\n\nUSE: [hide]This URL is hidden[/hide]");
	} else if (basic) {
		AddTxt="[hide]" + text + "[/hide]";
		AddText(AddTxt);
	} else {
		if (text) {
			txt=prompt("URL to be hidden",text);
		} else {
			txt=prompt("TURL to be hidden","Text");
		}
		if (txt!=null) {
			AddTxt="[hide]"+txt+"[/hide]";
			AddText(AddTxt);
		}
	}
}



inc_post_buttons.asp:



if mlev > 0 then
	Response.Write	"                <a href=""Javascript:hideurl();"" tabindex=""-1"">" & getCurrentIcon(strIconEditorCode,"Hide URL","align=""top""") & "</a>" & vbNewLine
end if



inc_iconfiles.asp"



Const strIconEditorHideUrl = "icon_editor_hide_url.gif|23|22"




Quick icon image:

I hope that helps. <

Cheers,

David Greening
Go to Top of Page

Carefree
Advanced Member

Philippines
4212 Posts

Posted - 01 February 2009 :  17:08:55  Show Profile  Reply with Quote
Your icon names need to be the same, David. You cannot use "strIconEditorCode" in one instance and use "strIconEditorHideUrl" in another.
<
Go to Top of Page

Ghostman
Starting Member

Portugal
6 Posts

Posted - 01 February 2009 :  20:12:19  Show Profile  Visit Ghostman's Homepage  Reply with Quote
the button shows but I click on the button and nothing happens<
Go to Top of Page

Carefree
Advanced Member

Philippines
4212 Posts

Posted - 01 February 2009 :  22:44:10  Show Profile  Reply with Quote
Ghostman, change the lines for inc_post_buttons.asp to say:
if mlev > 0 then
	Response.Write	"                <a href=""Javascript:hideurl();"" tabindex=""-1"">" & getCurrentIcon(strIconEditorURL,"Hide URL","align=""top""") & "</a>" & vbNewLine
end if


If the button is showing and nothing happens when you click it, then you must have an error in your "inc_code.js" file. Post a link to it in .txt format and we'll try and fix it.<

Edited by - Carefree on 01 February 2009 23:00:31
Go to Top of Page

Classicmotorcycling
Development Team Leader

Australia
2085 Posts

Posted - 02 February 2009 :  04:01:18  Show Profile  Reply with Quote
Trouble with quick cut and paste.
quote:
Originally posted by Carefree

Your icon names need to be the same, David. You cannot use "strIconEditorCode" in one instance and use "strIconEditorHideUrl" in another.


<

Cheers,

David Greening
Go to Top of Page

Ghostman
Starting Member

Portugal
6 Posts

Posted - 02 February 2009 :  06:29:16  Show Profile  Visit Ghostman's Homepage  Reply with Quote
ok

here's the links to the code in inc_code.js

http://only.ghostlinks.com.pt/code.txt<
Go to Top of Page

Carefree
Advanced Member

Philippines
4212 Posts

Posted - 02 February 2009 :  08:43:16  Show Profile  Reply with Quote
Try this<

Edited by - Carefree on 02 February 2009 08:45:57
Go to Top of Page
  Previous Topic Topic Next Topic  
 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.15 seconds. Powered By: Snitz Forums 2000 Version 3.4.07