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/Code)
 Mod in Progress ; alternate Spoiler and DIV's
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 03 December 2004 :  15:35:59  Show Profile  Visit MarcelG's Homepage
Well, as a result of some hints by Dayve and a trigger by Shaggy I started working on the spoiler tag.
The spoiler tag is processed upon displaying the topic/reply by means of the extratags-function in inc_func_common.asp.
That's quite handy, cause you don't have to worry about affecting your db!
This mod I'm working on only changes the way it's displayed.

So...what have I come up with.

My first work, was old-school table-stuff.
Replaced the existing line for the [spoiler] tag with this one:
fString = doCode(fString, "[spoiler]", "[/spoiler]", "<div align=""right"" id=""spoiler""><table class=""spoiler""><tr><td class=""spoilertd""><span class=""spoilertext"">spoiler:</span></td></tr><tr><td class=""spoilertd2""><span class=""spoilertext2"">", "</span></td></tr></table></div align=""right"" id=""spoiler"">")

Added these lines to inc_header.asp and inc_header_short.asp inbetween the other style sheet lines.

"table.spoiler {width: 90%; border: 0px " & strTableBorderColor & " solid}" & vbNewLine & _ 
".spoilertd {width: 100%; border: 0px DCDCDC solid}" & vbNewLine & _ 
".spoilertd2 {background-color: #F5F5F5 ; width: 100%; border: 1px "& strForumLinkColor &" dashed; border-collapse: separate; padding: 0.3em}" & vbNewLine & _ 
".spoilertext {font-family: ""Lucida Sans Unicode"", ""Verdana"", ""sans-serif""; font-size: 9pt}" & vbNewLine & _
".spoilertext2 {font-family: ""Lucida Sans Unicode"", ""Verdana"", ""sans-serif""; font-size: 9pt; color: #F5F5F5 }" & vbNewLine & _

Result: See here: http://www.oxle.com/topic.asp?TOPIC_ID=635
This one works fine in IE and Firefox/Mozilla
However, Dayve came up with the remark that all the tables are in fact unnecessary, and that a (couple of) DIV(s) can solve it also.
Didn't know how to work with DIV's, but this seemed a good moment to start with them
So, I made [spoiler1] for testing purposes, and added 2 other functions for a small right aligned div and a small left aligned div. (usefull for quotes wihtin an article, or things like that (example).
Added this to the extratags function in inc_func_common.asp:
fString = doCode(fString, "[spoiler1]", "[/spoiler1]", "1<div class=""spoil1"">spoiler:<div class=""spoil2"">", "</div></div>")
fString = doCode(fString, "[srdiv]", "[/srdiv]", "<div class=""srdiv"">", "</div>")
fString = doCode(fString, "[sldiv]", "[/sldiv]", "<div class=""sldiv"">", "</div>")

For that I added these lines to inc_header.asp and inc_header_short.asp, again in the styles section.
".spoil1 {padding-left: 50pt; width: 100%; ;font-family: ""Lucida Sans Unicode"", ""Verdana"", ""sans-serif""; font-size: 8pt;color:" & strDefaultFontColor & ";}" & vbNewLine & _
".spoil2 {padding-left: 50pt; width: 100%; background-color:#F5F5F5;padding:2px;border:1px dashed "& strForumLinkColor &";font-family: ""Lucida Sans Unicode"", ""Verdana"", ""sans-serif""; font-size: 9pt;color:#F5F5F5;}" & vbNewLine & _
".srdiv {float: right; width: 25%; background-color:#F5F5F5;padding:5px;border:1px dashed silver;font-family: ""Lucida Sans Unicode"", ""Verdana"", ""sans-serif""; font-size: 9pt;color:" & strDefaultFontColor & ";}" & vbNewLine & _
".sldiv {float: left; width: 25%; spacing:2px;background-color:#F5F5F5;padding:5px;border:1px dashed silver;font-family: ""Lucida Sans Unicode"", ""Verdana"", ""sans-serif""; font-size: 9pt;color:" & strDefaultFontColor & ";}" & vbNewLine & _

Okay...all seems well, so I guess I've done it now.
It looks allright in IE, it looks quite alright in Mozilla.
Examples:
spoiler-tag (with tables) in action http://www.oxle.com/topic.asp?TOPIC_ID=635
spoiler1-tag (with div's) in action http://www.oxle.com/topic.asp?TOPIC_ID=1784
srdiv-tag and sldiv-tag in action http://www.oxle.com/topic.asp?TOPIC_ID=1783
(I've got a slight problem with these ones, cause I cannot seem to be be able to set the spacing of the DIV....the text outside the DIV is way too close to the border...., any help would be appreciated).

portfolio - linkshrinker - oxle - twitter

dayve
Forum Moderator

USA
5820 Posts

Posted - 03 December 2004 :  16:09:21  Show Profile  Visit dayve's Homepage
when using multiple div's sometimes you have to add a float property... if you use a float property and want a new line after it, then you have to add a clear="all" to your break tag <br clear="all">.

it can get kind of tricky.

Go to Top of Page

ILLHILL
Junior Member

Netherlands
341 Posts

Posted - 06 December 2004 :  19:58:26  Show Profile
This looks good, how could I add a button to the post menu?
Same as the buttons for "bold" "url" etc. etc.

CLPPR.com - All The News Only Seconds Away
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 07 December 2004 :  03:17:16  Show Profile  Visit MarcelG's Homepage
erm...I have NO idea...

portfolio - linkshrinker - oxle - twitter
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 07 December 2004 :  11:06:40  Show Profile  Visit dayve's Homepage
Fixed: 12/9/2004

I haven't tested this, but it should work.

Add these lines in inc_code.asp

function spoiler() {
	if (helpstat) {
		alert("Spoiler Tag Makes the enlosed text hidden.\n\nUSE: [spoiler]This is some hidden text[/spoiler]");
	} else if (basic) {
		AddTxt="[spoiler][/spoiler]";
		AddText(AddTxt);
	} else {  
		txt=prompt("Text to be made HIDDEN.","Text");     
		if (txt!=null) {           
			AddTxt="[spoiler]"+txt+"[/spoiler]";
			AddText(AddTxt);
		}       
	}
}

and then add this line in inc_post_buttons.asp

"<a href=""Javascript:spoiler();"" tabindex=""-1"">" & getCurrentIcon(strIconEditorSpoiler,"Spoiler","align=""top""") & "</a>" & vbNewLine & _

I marked a portion of the above in red because you'll need to create an icon for the spoiler tag to edit in inc_iconfiles.asp.

If I have time later, I can try to make an icon suitable for your needs.


Edited by - dayve on 09 December 2004 18:55:05
Go to Top of Page

muzishun
Senior Member

United States
1079 Posts

Posted - 07 December 2004 :  13:45:46  Show Profile  Visit muzishun's Homepage
Is this MOD nearing completion? I tried the first one you've got at the top, but it didn't seem to work for me.

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

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 07 December 2004 :  15:23:49  Show Profile  Visit MarcelG's Homepage
? It didn't work ? The first one at the top is the actual one that I got working in the first place...
You should replace the existing line for spoilers in the extratags function in INC_FUNC_COMMON.ASP with that one, and add the style lines to inc_header.asp, where the other style lines are (such as spnmessagetext and stuff).

Do you have a demo-page that I can have a look at ?

portfolio - linkshrinker - oxle - twitter
Go to Top of Page

muzishun
Senior Member

United States
1079 Posts

Posted - 07 December 2004 :  20:55:02  Show Profile  Visit muzishun's Homepage
I removed it thinking that maybe it was still in progress. I'll try it again and if it doesn't work, I'll put a link here.

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

muzishun
Senior Member

United States
1079 Posts

Posted - 07 December 2004 :  21:45:51  Show Profile  Visit muzishun's Homepage
It's working just fine now. Looks like it was an ID-10-T error on the part of the user implementing the code... *glances around* Now who did that, I wonder?

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

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 08 December 2004 :  03:38:11  Show Profile  Visit MarcelG's Homepage
hahaha...
A typical case of CILIKAC
Cause Is Located Inbetween Keyboard And Chair...

portfolio - linkshrinker - oxle - twitter
Go to Top of Page

muzishun
Senior Member

United States
1079 Posts

Posted - 08 December 2004 :  12:41:03  Show Profile  Visit muzishun's Homepage
Indeed.

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

ILLHILL
Junior Member

Netherlands
341 Posts

Posted - 09 December 2004 :  15:00:08  Show Profile
Thank you all for your help.
One case of advice (or maybe precaution, since I'm about to implement this)

quote:
inbetween the other style sheet lines

Add these lines in inc_code.asp




Where to add them? I'm gonna try it out now though, but for newbs to asp
this is hocus pocus so maybe an example line and a "add this *** directly underneath/above that"

I'll prolly manage to get it working though, so, thanks again for the help and this great addition!

D

CLPPR.com - All The News Only Seconds Away
Go to Top of Page

muzishun
Senior Member

United States
1079 Posts

Posted - 09 December 2004 :  16:07:48  Show Profile  Visit muzishun's Homepage
If you're talking about this post by dayve:

quote:
I haven't tested this, but it should work.

Add these lines in inc_code.asp


function spoiler() {
if (helpstat) {
alert("Spoiler Tag Makes the enlosed text hidden.\n\nUSE: This is some hidden text");
} else if (basic) {
AddTxt="";
AddText(AddTxt);
} else {
txt=prompt("Text to be made HIDDEN.","Text");
if (txt!=null) {
AddTxt=""+txt+"";
AddText(AddTxt);
}
}
}


and then add this line in inc_post_buttons.asp


"<a href=""Javascript:spoiler();"" tabindex=""-1"">" & getCurrentIcon(strIconEditorSpoiler,"Spoiler","align=""top""") & "</a>" & vbNewLine & _


I marked a portion of the above in red because you'll need to create an icon for the spoiler tag to edit in inc_iconfiles.asp.

If I have time later, I can try to make an icon suitable for your needs.


Don't use that just yet. IIRC, there isn't yet an icon for the spoiler tag. To use this in its current state, just use what marcel has in his first post.

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

ILLHILL
Junior Member

Netherlands
341 Posts

Posted - 09 December 2004 :  16:33:51  Show Profile
Thanks, for your advice...I made a spoiler icon myself, so that's no problem.

I got it to work, but I had to add a bit to dayve's code:

function spoiler() {
if (helpstat) {
alert("Spoiler Tag Makes the enlosed text hidden.\n\nUSE: This is some hidden text");
} else if (basic) {
AddTxt=" [ spoiler ] [ /spoiler ] (remove the spaces!)";
AddText(AddTxt);
} else {
txt=prompt("Text to be made HIDDEN.","Text");
if (txt!=null) {
AddTxt=""+txt+"";
AddText(AddTxt);
}
}
}


You also need to add this code to "inc_code.js"


CLPPR.com - All The News Only Seconds Away

Edited by - ILLHILL on 09 December 2004 16:39:00
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 09 December 2004 :  18:54:08  Show Profile  Visit dayve's Homepage
yeah, the post I made tried to parse the spoiler tags. I thought I took care of them all, but I must have missed a set.

Go to Top of Page

ILLHILL
Junior Member

Netherlands
341 Posts

Posted - 09 December 2004 :  19:22:38  Show Profile
No problem, your code solved my problem :-)

thanks!

D

CLPPR.com - All The News Only Seconds Away
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.16 seconds. Powered By: Snitz Forums 2000 Version 3.4.07