how can i Hide content with tags? - Posted (2778 Views)
Starting Member
Icaro
Posts: 3
3
hi:

Im new for snitz, i implemented lots of mods without problems but im looking for an specific mod that hides some of the content inside a post (a link or a text) by using [hide][/hide] tags, so when a non logged user is viewing the post he will only see a MSG saying "Hidden Content, Please Log in"

I tried to do it myself but i couldnt make it work, i added some lines on inc_func_common.asp i think it have to do something with:

if mlev > 0 then... but i dont know what the following line should be

I was thinking also about a feature that unhides the content (of a topic) only when you post a reply...
Any ideas on how can i do this?
thanks in advance.<
 Sort direction, for dates DESC means newest first  
 Page size 
Posted
Advanced Member
Carefree
Posts: 4224
4224
Hope you don't mind if I drag this horse back to the water.
I added the functions to inc_func_common.asp and replaced the search terms functions in topic.asp; however, when I preview a topic with the [modnote] attribute, it merely shows [modnote]xxx[/modnote] - it seems to ignore the function altogether. Should the preview act like that?
Well, I used it in a post and it's ignored there too. Guess I must have missed something.<
Posted
Advanced Member
Carefree
Posts: 4224
4224
I'm not good with css. Could someone convert this to Response Write format? When I tried to convert it, I got a blank page at default.asp - not exactly what I was hoping for.
Code:

/* This is for the spoiler tag. */
div.spoiler {margin: 0 5%; border: 1px dashed <%=ReplaceColorWithHex(strPageBGColor)%>; background-color: <%=ReplaceColorWithHex(strHeadCellColor)%>; color: inherit;}
kbd {font-style: normal; font-weight: normal; display: block; color: <%=ReplaceColorWithHex(strHeadCellColor)%>; background-color: inherit;}
span.spoiler {font-style: normal; font-weight: normal; font-size: <%=ReplaceSizeWithPt(strFooterFontSize)%>; display: block; margin: 0 5%;}
/********************************/
<
Posted
Senior Member
leatherlips
Posts: 1838
1838
Carefree,

I didn't even add that part and my new spoiler tag still works just fine.
Edit: Nevermind. I see you need that for the spoiler2 text tag.<
Posted
Senior Member
leatherlips
Posts: 1838
1838
The code for this spoiler code does not toggle the Show/Hide button in Safari.
Code:
fString = doCode(fString, "Reveal hidden content", "", "<div style=""margin:1em auto; width: 90%;"">" & vbNewline & "	<div><strong>Spoiler:</strong> <input type=""button"" value=""Show"" style=""width:45px;font-size:10px;margin:0px;padding:0px;"" onclick=""if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = '';this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }"" /></div>" & vbNewline & "	<div style=""margin: 0px; padding: 6px; border: 1px inset;"">" & vbNewline & "		<div style=""display: none;"">" & vbNewline, "		</div>" & vbNewline & "	</div>" & vbNewline & "</div>" & vbNewline)
On a Mac with Safari, the button only says Show. In IE and FF, it says Show or Hide depending on that state that it is in. Can someone show how to make the button show properly in Safari? <
Posted
Senior Member
leatherlips
Posts: 1838
1838
I'm trying to figure out how to modify the hidden text code. What I want is to make a tag that is hidden from everyone unless they belong to a certain private forum.
The reason I want this is because sometimes my members will mention things in the private forum in the open public forum. I'd like to edit their posts with the hidden tag so that the private forum members will see it but the regular members and visitors will not see it.
I've been trying to add something like this but can't get it to work:

dim isAllowed
isAllowed=chkForumAccess(1,MemberID,false)
if isAllowed then

function HideText(txt,mode)
If mode = 1 Then
Set regEx = New RegExp
regEx.Pattern = "\[hidden.*?\/hidden\]"
regEx.IgnoreCase = True
regEx.Global = True
Set Matches = regEx.Execute(txt)
HideText = regEx.Replace(txt, "<p><strong>This section of text is private.</strong></p>")
Else 'mode = 2
txt = Replace(txt,"[hidden]","")
txt = Replace(txt,"[/hidden]","")
HideText = txt
End If
end function
Posted
Posted
Advanced Member
Etymon
Posts: 2396
2396
Hi leatherlips,

You will have to decide if these tags will be available to the general membership, or to only moderators and above, or to only administrators and above, or to only the forum (super) administrator, etc.
I say this because you will have to strip the tags out of the message according to the forum(s) you don't want these tags used by whichever group.
It can get tricky because if a member does not have access to a certain private forum, but has knowledge of the content of the topic(s) within it, then that member can still post content publicly but not have the power to hide it unless you give all members access to use the tags.
I like the concept of what you are trying to do. Sounds like a fun hairball. Perhaps you could contact CareFree about this. He likes challenging projects!
Cheers,

Etymon
Posted
Senior Member
leatherlips
Posts: 1838
1838
I'd like to have this tag available to any member of my private forum. If that is too hard then it could be only for me the admin.
Basically I'm looking to do this, here is an example:

Let's say a member of a private forum posts something in the general forum mentioning something specific from the private forum.
Hey everyone, did you read about that topic in the private forum? It was really interesting.
I could then edit it with a hidden tag like this:

Hey everyone, did you read about that topic [hidden]in the private forum[/hidden]? It was really interesting.
Then the general forum would only see:

Hey everyone, did you read about that topic? It was really interesting.
But the members of the private forum would see the whole thing.
Does that make any sense?
You Must enter a message