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)
 how can i Hide content with tags?
 New Topic  Reply to Topic
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

Icaro
Starting Member

3 Posts

Posted - 06 June 2007 :  11:39:47  Show Profile  Reply with Quote
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.<

cripto9t
Average Member

USA
881 Posts

Posted - 07 June 2007 :  08:19:38  Show Profile  Reply with Quote
Look through this thread
http://forum.snitz.com/forum/topic.asp?ARCHIVE=true&TOPIC_ID=56099&SearchTerms=hide<

    _-/Cripto9t\-_
Go to Top of Page

Icaro
Starting Member

3 Posts

Posted - 13 June 2007 :  18:35:41  Show Profile  Reply with Quote
Thanks for your help! Thats what i was looking for...<
Go to Top of Page

muzishun
Senior Member

United States
1079 Posts

Posted - 14 June 2007 :  01:45:59  Show Profile  Visit muzishun's Homepage  Reply with Quote
To help consolidate and give you a couple more options, here are three different hide tags that I use on my forum. They are for three different purposes.

[spoiler][/spoiler]
This one creates a box around the spoiler text with a button that shows or hides the content of the box dynamically. For longer sections of a page that you want to hide, and for times you want to have other forum code within your hidden text.

[spoiler2][/spoiler2]
This one is mostly for hiding a few lines of text. Just creates a shaded box where the text is the same color as the background.

[hidden][/hidden]
This one has a check from topic.asp that, if the user isn't logged in (or if a guest visits the page), the text within these tags is replaced with a message that the user needs to log in to see the hidden text.

[modnote][/modnote]
Basically the same as the one above, but text is hidden from normal users and guests. Useful for moderators and Admins to make notes to each other about posts.

I can provide you with the code I use for these if you want. Most of it has been posted here in the past, so you should be able to find it with some searching (and also at the link cripto9t mentioned above).<

Bill Parrott
Senior Web Programmer, University of Kansas
Co-Owner and Code Monkey, Eternal Second Designs (www.eternalsecond.com)
Personal Website (www.chimericdream.com)

Edited by - muzishun on 14 June 2007 01:47:57
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 14 June 2007 :  07:38:09  Show Profile  Visit AnonJr's Homepage  Reply with Quote
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..." <
Go to Top of Page

bobby131313
Senior Member

USA
1163 Posts

Posted - 14 June 2007 :  12:57:22  Show Profile  Visit bobby131313's Homepage  Reply with Quote


Yes please!


<

Switch the order of your title tags
Go to Top of Page

muzishun
Senior Member

United States
1079 Posts

Posted - 15 June 2007 :  00:21:42  Show Profile  Visit muzishun's Homepage  Reply with Quote
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.<

Bill Parrott
Senior Web Programmer, University of Kansas
Co-Owner and Code Monkey, Eternal Second Designs (www.eternalsecond.com)
Personal Website (www.chimericdream.com)

Edited by - muzishun on 15 June 2007 00:24:40
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 15 June 2007 :  08:50:00  Show Profile  Visit AnonJr's Homepage  Reply with Quote
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.<

Edited by - AnonJr on 15 June 2007 08:51:05
Go to Top of Page

Etymon
Advanced Member

United States
2385 Posts

Posted - 15 June 2007 :  12:29:23  Show Profile  Visit Etymon's Homepage  Reply with Quote
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?
<

Edited by - Etymon on 15 June 2007 12:33:19
Go to Top of Page

muzishun
Senior Member

United States
1079 Posts

Posted - 16 June 2007 :  23:43:33  Show Profile  Visit muzishun's Homepage  Reply with Quote
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.<

Bill Parrott
Senior Web Programmer, University of Kansas
Co-Owner and Code Monkey, Eternal Second Designs (www.eternalsecond.com)
Personal Website (www.chimericdream.com)
Go to Top of Page

Icaro
Starting Member

3 Posts

Posted - 21 June 2007 :  11:54:22  Show Profile  Reply with Quote
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!...<
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 08 May 2008 :  01:22:53  Show Profile  Reply with Quote
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.<

Edited by - Carefree on 08 May 2008 01:24:39
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 14 June 2008 :  09:49:04  Show Profile  Reply with Quote
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%;}
/********************************/
<
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 14 June 2008 :  10:10:35  Show Profile  Visit leatherlips's Homepage  Reply with Quote
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.<

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

Edited by - leatherlips on 14 June 2008 15:18:14
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 14 June 2008 :  14:55:14  Show Profile  Visit leatherlips's Homepage  Reply with Quote
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?
<

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

leatherlips
Senior Member

USA
1838 Posts

Posted - 21 June 2009 :  21:37:13  Show Profile  Visit leatherlips's Homepage  Reply with Quote
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

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
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 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.14 seconds. Powered By: Snitz Forums 2000 Version 3.4.07