The Forum has been Updated
The code has been upgraded to the latest .NET core version. Please check instructions in the Community Announcements about migrating your account.
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" /><
Thanks
<moved from="Help: General / Current Version (v3.4.xx)" by="Shaggy" /><
Last edited by Shaggy on 30 January 2009, 13:53
Posted
I believe this thread has the information you are looking for:
http://forum.snitz.com/forum/topic.asp?TOPIC_ID=64934<
http://forum.snitz.com/forum/topic.asp?TOPIC_ID=64934<
Posted
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?<
is there a way to change the spoiler tag to make it hide tag and do what I need?<
Posted
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
add this line under that
around line 150 find these lines
Add this code under that
topic.asp
around line 35 find these lines
Add this line under that
Thats it
hide tags - [hide] - [/hide] upper or lower case<
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
Code:
function FormatStr(fString)
on Error resume nextCode:
if DoHide = true then fString = ReplaceHideTags(fString)around line 150 find these lines
Code:
if strAllowForumCode = "1" then
fString = extratags(fString)
end if
FormatStr = fString
on Error goto 0
end functionCode:
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 Functiontopic.asp
around line 35 find these lines
Code:
%>
<!--#INCLUDE FILE="config.asp"-->
<%Code:
DoHide = trueThats it
hide tags - [hide] - [/hide] upper or lower case<
_-/Cripto9t\-_
Last edited by cripto9t on 31 January 2009, 10:49
Posted
Maybe adding an if strDBNTUserName <> "" before showing the reply with quote button?<
Posted
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 linesCode:add this line under thatfunction FormatStr(fString)
on Error resume nextCode:if DoHide = true then fString = ReplaceHideTags(fString)
around line 150 find these linesCode:Add this code under thatif strAllowForumCode = "1" then
fString = extratags(fString)
end if
FormatStr = fString
on Error goto 0
end functionCode: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 linesCode:Add this line under that%>
<!--#INCLUDE FILE="config.asp"-->
<%Code: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?<
Posted
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:
inc_post_buttons.asp:
inc_iconfiles.asp"
Quick icon image:
I hope that helps.
<
inc_code.js:
Code:
Code:
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:
Code:
Code:
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"
Code:
Code:
Const strIconEditorHideUrl = "icon_editor_hide_url.gif|23|22"
Quick icon image:
I hope that helps.
Cheers,
David Greening
David Greening
Posted
Your icon names need to be the same, David. You cannot use "strIconEditorCode" in one instance and use "strIconEditorHideUrl" in another.
<
Posted
the button shows but I click on the button and nothing happens<
Posted
Ghostman, change the lines for inc_post_buttons.asp to say:
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.<
Code:
if mlev > 0 then
Response.Write " <a href=""Javascript:hideurl();"" tabindex=""-1"">" & getCurrentIcon(strIconEditorURL,"Hide URL","align=""top""") & "</a>" & vbNewLine
end ifIf 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.<
Last edited by Carefree on 01 February 2009, 23:00
Posted
Trouble with quick cut and paste.
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
David Greening
Email Member
Message Member
Post Moderation
FileUpload
If you're having problems uploading, try choosing a smaller image.
Preview post
Send Topic
Loading...