Author |
Topic  |
|
Ghostman
Starting Member
Portugal
6 Posts |
Posted - 30 January 2009 : 13:50:24
|
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 |
|
Ghostman
Starting Member
Portugal
6 Posts |
Posted - 30 January 2009 : 23:41:21
|
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?< |
 |
|
cripto9t
Average Member
  
USA
881 Posts |
Posted - 31 January 2009 : 10:43:21
|
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 |
 |
|
modifichicci
Average Member
  
Italy
787 Posts |
|
Ghostman
Starting Member
Portugal
6 Posts |
Posted - 31 January 2009 : 21:47:18
|
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?< |
 |
|
Classicmotorcycling
Development Team Leader
    
Australia
2085 Posts |
Posted - 01 February 2009 : 00:53:58
|
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. < |
Cheers, David Greening |
 |
|
Carefree
Advanced Member
    
Philippines
4212 Posts |
Posted - 01 February 2009 : 17:08:55
|
Your icon names need to be the same, David. You cannot use "strIconEditorCode" in one instance and use "strIconEditorHideUrl" in another. < |
 |
|
Ghostman
Starting Member
Portugal
6 Posts |
Posted - 01 February 2009 : 20:12:19
|
the button shows but I click on the button and nothing happens< |
 |
|
Carefree
Advanced Member
    
Philippines
4212 Posts |
Posted - 01 February 2009 : 22:44:10
|
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.< |
Edited by - Carefree on 01 February 2009 23:00:31 |
 |
|
Classicmotorcycling
Development Team Leader
    
Australia
2085 Posts |
Posted - 02 February 2009 : 04:01:18
|
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 |
 |
|
Ghostman
Starting Member
Portugal
6 Posts |
|
Carefree
Advanced Member
    
Philippines
4212 Posts |
Posted - 02 February 2009 : 08:43:16
|
Try this< |
Edited by - Carefree on 02 February 2009 08:45:57 |
 |
|
|
Topic  |
|