Snitz Forum BBCode? - Posted (2015 Views)
Senior Member
Astralis
Posts: 1218
1218
Has anyone compiled the basic Snitz Forum BBCode into a file (or a couple) that has only the minimal relevant components that they could share?
Of all the BBCodes out there, the Snitz BBCode is very nice.
 Sort direction, for dates DESC means newest first  
 Page size 
Posted
Forum Admin
HuwR
Posts: 20611
20611
you probably only need inc_iconfiles.asp and the 'Smile' function out of inc_func_common.asp
Posted
Senior Member
Astralis
Posts: 1218
1218
Thanks. What about the javascript? Is that located in one single file?
Posted
Forum Admin
HuwR
Posts: 20611
20611
Posted
Average Member
SiSL
Posts: 671
671
Originally posted by Astralis
Thanks. What about the javascript? Is that located in one single file?

All JS for Editor is at inc_code.js as well...
Posted
Senior Member
Astralis
Posts: 1218
1218
Is the js in inc_smile.asp only for inserting smilies?
Posted
Forum Moderator
AnonJr
Posts: 5768
5768
Originally posted by Astralis
Is the js in inc_smile.asp only for inserting smilies?

Last I checked, yes. I think there's a little more than just what's been listed to include BBCode in another project - its just been a while since I last looked.
At a glance, I can see in the last project I used the BBCode for, I included/used the following: (some are repeats from config.asp that I doubled because I did not want to include all of config.asp in the project in question)

Code:

<!-- #include virtual="/forum/inc_iconfiles.asp"-->
<!-- #include virtual="/forum/inc_func_common.asp"-->
<!-- #include virtual="/forum/inc_func_posting.asp"-->
'used for configuring the forum-type functions
Dim strAllowForumCode : strAllowForumCode = "1"
Dim strAllowHTML : strAllowHTML = "0"
Dim strIMGInPosts : strIMGInPosts = "1"
Dim strIcons : strIcons = "1"
Dim strImageUrl : strImageUrl = "http://training.capefearvalley.com/forum/images/"
Dim strDateType : strDateType = "dmmy"
Dim strDBType : strDBType = "sqlserver"
FormatStr() 'Used prior to final display
CleanCode() 'Used for editing
Smile() 'Processes the smilies

I think there's something else missing too, but it isn't exactly jumping out at me as I glance through the code. One of these days I do plan on cleaning up the code to release as a MOD... someday when I have spare time again.
Posted
Senior Member
Astralis
Posts: 1218
1218
Anon,

This is very nice. I remember trying to obtain the BBCode a couple of years ago and it was a beast so I abandoned it. But I keep coming back to it as the best one available if the code was more compact. It looks like you've done almost all the work so it could be a good project that I can do and share.
Unless anyone knows of a BBCode system that's more effective??
Posted
Forum Moderator
AnonJr
Posts: 5768
5768
I built a small stand-alone wiki for an in-house project, and rather than make the staff learn yet another markup language I set it up to use the Snitz BBCode.

I've heard a lot of folks over at StackOverflow.com (and the other StackExchange sites) love Markdown. For me, it was a matter of keeping everything the same and not making people learn new skills. Obviously you should always use the solution that best fits the problem. I seem to remember Jeff Atwood had a blog post about humane markup, a precursor to the decision to use Markdown.
Posted
Senior Member
Astralis
Posts: 1218
1218
Here is the basic compact Snitz BBCode.
1. This is not a Snitz Forum add-on. This is for people who want to use the Snitz BBCode in other applications.
2. This code does not process the BBCode, it's only designed to allow users to format their posts with BBCode in a non-WYSIWYG format. If you need a script to process the submission that's posted, I have a RegEx that might be more efficient than what Snitz Forum is currently using. You can also go through Snitz Forum's code to find the method to process the BBCode.
3. I believe this code will work on almost any browser, all the way from the Netscape era, as long as Javascript is enabled.
4. The contents of inc_code.js includes all the script that I believe is necessary to run the Snitz BBCode but may include some extras that aren't necessary.
5. As you test this, you will notice that icons will not show up. You will need to create your own icon graphics and smilies and place on your own server for them to appear (Yahoo and Google have 'open-sourced' their smilies and allow free use of them). I believe there are over 30 calls to the server with all those icons so it might be time to redesign how the icon buttons and smilies appear on the page ... maybe use CSS positioning??
6. The smilies will need converted into real smiley code because this forum is converting them into graphics. Reply with quote to this topic to see those values.
STEP 1 Paste the following in an HTML page:
Code:

Code:

 <script language="JavaScript" type="text/javascript" src="inc_code.js"></script>
<table border="0" cellspacing="0" cellpadding="0" align="center">

<tr>

<td bgcolor="#ffffff">

<table border="0" cellspacing="1" cellpadding="1">

<form name="PostTopic" method="post" action="post.asp" onSubmit="return validate();">
<tr>

<td bgColor="whitesmoke" noWrap vAlign="top" align="right"><font face="Verdana,Arial,Helvetica" size="2"><b>Screensize:</b></font></td>

<td bgColor="whitesmoke"><font face="Verdana,Arial,Helvetica" size="2">

<select name="SelectSize" size="1" tabindex="-1" onchange="resizeTextarea('Snitz00')">

<option value="1">640 x 480</option>

<option value="2" selected>800 x 600</option>

<option value="3">1024 x 768</option>

<option value="4">1280 x 1024</option>

</select>

</font></td>

</tr>

<tr>

<td bgColor="whitesmoke" align="right" valign="top">

<font face="Verdana,Arial,Helvetica" size="2"><b>Format Mode:</b></font></td>

<td bgColor="whitesmoke" align="left">

<select name="mode" tabindex="-1" onChange="thelp(this.options.value)">

<option selected value="0">Basic </option>

<option value="1">Help </option>

<option value="2">Prompt </option>

</select>

<a href="javascript:openWindowHelp('pop_help.asp?mode=post#mode')" tabindex="-1"><img src="icon_smile_question.gif" width="15" height="15" border="0" alt="" title="" /></a></td>

</tr>

<tr>

<td bgColor="whitesmoke" align="right" rowspan="2" valign="top">

<font face="Verdana,Arial,Helvetica" size="2"><b>Format:</b></font></td>

<td bgColor="whitesmoke" align="left">

<a href="javascript:bold();" tabindex="-1"><img src="icon_editor_bold.gif" width="23" height="22" border="0" alt="Bold" title="Bold" align="top" /></a><a href="javascript:italicize();" tabindex="-1"><img src="icon_editor_italicize.gif" width="23" height="22" border="0" alt="Italicized" title="Italicized" align="top" /></a><a href="javascript:underline();" tabindex="-1"><img src="icon_editor_underline.gif" width="23" height="22" border="0" alt="Underline" title="Underline" align="top" /></a><a href="javascript:strike();" tabindex="-1"><img src="icon_editor_strike.gif" width="23" height="22" border="0" alt="Strikethrough" title="Strikethrough" align="top" /></a>

<a href="javascript:left();" tabindex="-1"><img src="icon_editor_left.gif" width="23" height="22" border="0" alt="Align Left" title="Align Left" align="top" /></a><a href="javascript:center();" tabindex="-1"><img src="icon_editor_center.gif" width="23" height="22" border="0" alt="Centered" title="Centered" align="top" /></a><a href="javascript:right();" tabindex="-1"><img src="icon_editor_right.gif" width="23" height="22" border="0" alt="Align Right" title="Align Right" align="top" /></a>

<a href="javascript:hr();" tabindex="-1"><img src="icon_editor_hr.gif" width="23" height="22" border="0" alt="Horizontal Rule" title="Horizontal Rule" align="top" /></a> <a href="javascript:hyperlink();" tabindex="-1"><img src="icon_editor_url.gif" width="23" height="22" border="0" alt="Insert Hyperlink" title="Insert Hyperlink" align="top" /></a><a href="javascript:email();" tabindex="-1"><img src="icon_editor_email.gif" width="23" height="22" border="0" alt="Insert Email" title="Insert Email" align="top" /></a><a href="javascript:image();" tabindex="-1"><img src="icon_editor_image.gif" width="23" height="22" border="0" alt="Insert Image" title="Insert Image" align="top" /></a>

<a href="javascript:showcode();" tabindex="-1"><img src="icon_editor_code.gif" width="23" height="22" border="0" alt="Insert Code" title="Insert Code" align="top" /></a><a href="javascript:quote();" tabindex="-1"><img src="icon_editor_quote.gif" width="23" height="22" border="0" alt="Insert Quote" title="Insert Quote" align="top" /></a><a href="javascript:list();" tabindex="-1"><img src="icon_editor_list.gif" width="23" height="22" border="0" alt="Insert List" title="Insert List" align="top" /></a>

</td>

</tr>

<tr>

<td bgColor="whitesmoke" align="left">

<font face="Verdana,Arial,Helvetica" size="2">

<select name="Font" tabindex="-1" onChange="showfont(this.options.value)">

<option value="" selected>Font</option>

<option value="Andale Mono">Andale Mono</option>

<option value="Arial">Arial</option>

<option value="Arial Black">Arial Black</option>

<option value="Book Antiqua">Book Antiqua</option>

<option value="Century Gothic">Century Gothic</option>

<option value="Comic Sans MS">Comic Sans MS</option>

<option value="Courier New">Courier New</option>

<option value="Georgia">Georgia</option>

<option value="Impact">Impact</option>

<option value="Lucida Console">Lucida Console</option>

<option value="Script MT Bold">Script MT Bold</option>

<option value="Stencil">Stencil</option>

<option value="Tahoma">Tahoma</option>

<option value="Times New Roman">Times New Roman</option>

<option value="Trebuchet MS">Trebuchet MS</option>

<option value="Verdana">Verdana</option>

</select> 

<select name="Size" tabindex="-1" onChange="showsize(this.options.value)">

<option value="" selected>Size</option>

<option value="1">1</option>

<option value="2">2</option>

<option value="3">3</option>

<option value="4">4</option>

<option value="5">5</option>

<option value="6">6</option>

</select> 

<select name="Color" tabindex="-1" onChange="showcolor(this.options.value)">

<option value="" selected>Color</option>

<option style="color:black" value="black">Black</option>

<option style="color:red" value="red">Red</option>

<option style="color:yellow" value="yellow">Yellow</option>

<option style="color:pink" value="pink">Pink</option>

<option style="color:green" value="green">Green</option>

<option style="color:orange" value="orange">Orange</option>

<option style="color:purple" value="purple">Purple</option>

<option style="color:blue" value="blue">Blue</option>

<option style="color:beige" value="beige">Beige</option>

<option style="color:brown" value="brown">Brown</option>

<option style="color:teal" value="teal">Teal</option>

<option style="color:navy" value="navy">Navy</option>

<option style="color:maroon" value="maroon">Maroon</option>

<option style="color:limegreen" value="limegreen">LimeGreen</option>

</select></font></td>

</tr>

<td bgColor="whitesmoke" noWrap vAlign="top" align="right"><font face="Verdana,Arial,Helvetica" size="2"><b>

Message:</b><br />

<br />

<table border="0">

<tr>

<td align="left" nowrap><font face="Verdana,Arial,Helvetica" size="2">

<script language="Javascript" type="text/javascript">

<!-- hide

function insertsmilie(smilieface) {

AddText(smilieface);

}

// -->

</script>

<table width="100%" border="0" cellspacing="0" cellpadding="2" align="center">

<tr align="center">

<td align="center" colspan="4"><a name="smilies"></a><font face="Verdana,Arial,Helvetica" size="1"><b>Smilies</b></font></td>

</tr>

<tr align="center" valign="middle">

<td><a href="javascript:insertsmilie('smile')" tabindex="-1"><img src="icon_smile.gif" width="15" height="15" border="0" alt="Smile smile" title="Smile smile" /></a></td>

<td><a href="javascript:insertsmilie('bigsmile')" tabindex="-1"><img src="icon_smile_big.gif" width="15" height="15" border="0" alt="Big Smile bigsmile" title="Big Smile bigsmile" /></a></td>

<td><a href="javascript:insertsmilie('cool')" tabindex="-1"><img src="icon_smile_cool.gif" width="15" height="15" border="0" alt="Cool cool" title="Cool cool" /></a></td>

<td><a href="javascript:insertsmilie('blush')" tabindex="-1"><img src="icon_smile_blush.gif" width="15" height="15" border="0" alt="Blush blush" title="Blush blush" /></a></td>

</tr>

<tr align="center" valign="middle">

<td><a href="javascript:insertsmilie('tongue')" tabindex="-1"><img src="icon_smile_tongue.gif" width="15" height="15" border="0" alt="Tongue tongue" title="Tongue tongue" /></a></td>

<td><a href="javascript:insertsmilie('[%7D:)]')" tabindex="-1"><img src="icon_smile_evil.gif" width="15" height="15" border="0" alt="Evil [):]" title="Evil [):]" /></a></td>

<td><a href="javascript:insertsmilie('wink')" tabindex="-1"><img src="icon_smile_wink.gif" width="15" height="15" border="0" alt="Wink wink" title="Wink wink" /></a></td>

<td><a href="javascript:insertsmilie('clown')" tabindex="-1"><img src="icon_smile_clown.gif" width="15" height="15" border="0" alt="Clown clown" title="Clown clown" /></a></td>

</tr>

<tr align="center" valign="middle">

<td><a href="javascript:insertsmilie('blackeye')" tabindex="-1"><img src="icon_smile_blackeye.gif" width="15" height="15" border="0" alt="Black Eye blackeye" title="Black Eye blackeye" /></a></td>

<td><a href="javascript:insertsmilie('eightball')" tabindex="-1"><img src="icon_smile_8ball.gif" width="15" height="15" border="0" alt="Eight Ball eightball" title="Eight Ball eightball" /></a></td>

<td><a href="javascript:insertsmilie('sad')" tabindex="-1"><img src="icon_smile_sad.gif" width="15" height="15" border="0" alt="Frown sad" title="Frown sad" /></a></td>

<td><a href="javascript:insertsmilie('shy')" tabindex="-1"><img src="icon_smile_shy.gif" width="15" height="15" border="0" alt="Shy shy" title="Shy shy" /></a></td>

</tr>

<tr align="center" valign="middle">

<td><a href="javascript:insertsmilie('shock')" tabindex="-1"><img src="icon_smile_shock.gif" width="15" height="15" border="0" alt="Shocked shock" title="Shocked shock" /></a></td>

<td><a href="javascript:insertsmilie('angry')" tabindex="-1"><img src="icon_smile_angry.gif" width="15" height="15" border="0" alt="Angry angry" title="Angry angry" /></a></td>

<td><a href="javascript:insertsmilie('dead')" tabindex="-1"><img src="icon_smile_dead.gif" width="15" height="15" border="0" alt="Dead dead" title="Dead dead" /></a></td>

<td><a href="javascript:insertsmilie('[%7C)]')" tabindex="-1"><img src="icon_smile_sleepy.gif" width="15" height="15" border="0" alt="Sleepy sleepy" title="Sleepy sleepy" /></a></td>

</tr>

<tr align="center" valign="middle">

<td><a href="javascript:insertsmilie('kisses')" tabindex="-1"><img src="icon_smile_kisses.gif" width="15" height="15" border="0" alt="Kisses kisses" title="Kisses kisses" /></a></td>

<td><a href="javascript:insertsmilie('[%5E]')" tabindex="-1"><img src="icon_smile_approve.gif" width="15" height="15" border="0" alt="Approve [^]" title="Approve [^]" /></a></td>

<td><a href="javascript:insertsmilie('dissapprove')" tabindex="-1"><img src="icon_smile_disapprove.gif" width="15" height="15" border="0" alt="Disapprove dissapprove" title="Disapprove dissapprove" /></a></td>

<td><a href="javascript:insertsmilie('question')" tabindex="-1"><img src="icon_smile_question.gif" width="15" height="15" border="0" alt="Question question" title="Question question" /></a></td>

</tr>

</table>

</font></td>

</tr>

</table>

</font></td>

<td bgColor="whitesmoke"><textarea cols="70" name="Message" rows="12" wrap="VIRTUAL" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onchange="storeCaret(this);"></td>

</tr>

<script language="JavaScript" type="text/javascript">document.PostTopic.Message.focus();</script>

<tr>

<td bgColor="whitesmoke"> </td>

<td bgColor="whitesmoke">

<font face="Verdana,Arial,Helvetica" size="2"><input name="Sig" id="Sig" type="checkbox" value="yes" checked><label for="Sig">Check here to include your profile signature.</label><br /></font>

<font face="Verdana,Arial,Helvetica" size="2"><input name="lock" id="lock" type="checkbox" value="1"><label for="lock">Check here to lock the topic after this post.</label><br /></font>

</td>

</tr>

<tr>

<td bgColor="whitesmoke"> </td>

<td bgColor="whitesmoke"><input name="Submit" type="submit" value="Post New Reply"> <input name="Preview" type="button" value=" Preview " onclick="OpenPreview()"></td>

</tr>

</form>

</table>

</td>

</tr>

</table>

<br />

</td>

</tr>

</table>

STEP TWO Copy the code below and paste into a file named "inc_code.js" and upload to the same directory as the html page you created above. Download inc_code.js
Posted
Forum Admin
HuwR
Posts: 20611
20611
you are not allowed to use the Snitz graphics on a non snitz site without the Permission of Mike (ReinSnitz) who owns them, they do not belong to Snitz so we can't give permission.
 
You Must enter a message