Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 how can i Hide content with tags?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!
Before posting, make sure you have read this topic!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
Icaro Posted - 06 June 2007 : 11:39:47
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.<
15   L A T E S T    R E P L I E S    (Newest First)
leatherlips Posted - 25 June 2009 : 13:33:31
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?
Etymon Posted - 25 June 2009 : 13:21:59
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
leatherlips Posted - 25 June 2009 : 11:17:19
Anyone have any idea how to make my idea work?
leatherlips Posted - 21 June 2009 : 21:37:13
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
leatherlips Posted - 14 June 2008 : 14:55:14
The code for this spoiler code does not toggle the Show/Hide button in Safari.

fString = doCode(fString, "", "", "<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?
<
leatherlips Posted - 14 June 2008 : 10:10:35
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.<
Carefree Posted - 14 June 2008 : 09:49:04
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.

/* 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%;}
/********************************/
<
Carefree Posted - 08 May 2008 : 01:22:53
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.<
Icaro Posted - 21 June 2007 : 11:54:22
Wow!!!... thanks a lot muzishun, i've been trying to implement that reference code but it seems to work only with the response.write line and not on the post itself but with your help, it should be a lot more easier.

Maybe you should publish this on www.snitzbitz.com

Thanks!...<
muzishun Posted - 16 June 2007 : 23:43:33
I like the idea of a COPPA tag, and I don't really think it would be that hard. The only thing that I see becoming a problem is when you start to have too many tags and your users can't figure out which way is up. I've been thinking about reworking the way post.asp is layed out as well as redoing the forum code tutorial page to address some of these issues as I add mods to my forum.<
Etymon Posted - 15 June 2007 : 12:29:23
You guys ... my wife has an art site where some of the gals sometimes post anatomically correct images for reference when working on sculptures, so I think I will add a [COPPA][/COPPA] tag to my forums. This will hide "member-deemed" adult content from children who are also members and also from non-forum members.

This will not only be for images but also for adult language and humor. I'll try to figure a way to have the members include this tag when posting as well as educate them on the benefits of becoming more "child-friendly" when making posts.

I'd like to see the SmileManager Plus for Snitz 3.4 (http://forum.snitz.com/forum/topic.asp?ARCHIVE=true&TOPIC_ID=33807) be adapted to custom posting tags like we are talking about in this topic. I'm not available for it at the moment but would be willing to give it a go later as I have time. Anyone interested in helping to see if it is feasible or even possible?
<
AnonJr Posted - 15 June 2007 : 08:50:00
Thanks. I've got it bookmarked for when I need to point someone to it later on.

Actually, now that I thin about it, I'll probably add the [modnote] tag to my forums.<
muzishun Posted - 15 June 2007 : 00:21:42
In inc_func_common.asp, find the extratags function and replace it with this (or just add the spoiler parts to your function) and add the two functions beneath it:


function extratags(fString)
fString = doCode(fString, "[spoiler2]", "[/spoiler2]", "<span class=""spoiler"">Spoiler:</span><div class=""spoiler""><kbd>", "</kbd></div>")
fString = doCode(fString, "[spoiler]", "[/spoiler]", "<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)
extratags = fString
end function


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>You must log in to see this text.</strong></p>")
Else 'mode = 2
txt = Replace(txt,"[hidden]","")
txt = Replace(txt,"[/hidden]","")
HideText = txt
End If
end function


function ModNoteText(txt,mode)
Set regEx = New RegExp
regEx.Pattern = "\[modnote.*?\/modnote\]"
regEx.IgnoreCase = True
regEx.Global = True
Set Matches = regEx.Execute(txt)
If mode = 1 Then 'User is an admin
ModNoteText = txt
Else 'mode = 2
ModNoteText = regEx.Replace(txt, "")
End If
end function


Then, in topic.asp, do a search for the following text: "if Request.QueryString("SearchTerms") <> """. This should happen twice, and it's at the parts of topic.asp that display the text for the posts. Here's how I've got these working with the nested If..Then statements. You may or may not need to tweak it for your own forums.


if Request.QueryString("SearchTerms") <> "" then
If mlev = 0 Then
Response.Write ModNoteText(HideText(SearchHiLite(formatStr(Reply_Content)),1),2)
Else
If mlev > 2 Then 'User is a mod or admin
Response.Write ModNoteText(HideText(SearchHiLite(formatStr(Reply_Content)),2),1)
Else
Response.Write ModNoteText(HideText(SearchHiLite(formatStr(Reply_Content)),2),2)
End If
End If
else
If mlev = 0 Then
Response.Write ModNoteText(HideText(formatStr(Reply_Content),1),2)
Else
If mlev > 2 Then 'User is a mod or admin
Response.Write ModNoteText(HideText(formatStr(Reply_Content),2),1)
Else
Response.Write ModNoteText(HideText(formatStr(Reply_Content),2),2)
End If
End If
end if

and

if Request.QueryString("SearchTerms") <> "" then
If mlev = 0 Then
Response.Write ModNoteText(HideText(SearchHiLite(formatStr(Topic_Message)),1),2)
Else
If mlev > 2 Then 'User is a mod or admin
Response.Write ModNoteText(HideText(SearchHiLite(formatStr(Topic_Message)),2),1)
Else
Response.Write ModNoteText(HideText(SearchHiLite(formatStr(Topic_Message)),2),2)
End If
End If
else
If mlev = 0 Then
Response.Write ModNoteText(HideText(formatStr(Topic_Message),1),2)
Else
If mlev > 2 Then 'User is a mod or admin
Response.Write ModNoteText(HideText(formatStr(Topic_Message),2),1)
Else
Response.Write ModNoteText(HideText(formatStr(Topic_Message),2),2)
End If
End If
end if


Lastly, wherever you have your CSS information (mine is in a separate CSS file, but the base Snitz has it in inc_header.asp), add the following CSS info.


/* 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%;}
/********************************/

Again, you'll probably have to tweak this to work with your individual forums. I've got a couple functions that translate the forum values for font sizes and colors into something that will validate and work across different browsers.

If there are any questions, ask away!

Edit: Flippin' forum code. I forgot there was a spoiler tag on this forum... I couldn't figure out for the life of me why the text wasn't showing up right in the post. Fixed now.<
bobby131313 Posted - 14 June 2007 : 12:57:22


Yes please!


<
AnonJr Posted - 14 June 2007 : 07:38:09
go ahead and post it all in one spot - makes it easier to point people to a central location as opposed to "this topic has this bit, and that one has that bit, oh, and that one has part of what you need..." <

Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000 Version 3.4.07