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)
 RTE for Snitz 3.4 (Now with Demo!)
 New Topic  Topic Locked
 Printer Friendly
Previous Page
Author Previous Topic Topic Next Topic
Page: of 3

Dave.
Senior Member

USA
1037 Posts

Posted - 29 June 2003 :  00:32:48  Show Profile
This WILL NOT work on any version of Netscape (Should work on anything after the current version. although it SHOULD work with Mozilla1.3+.
Go to Top of Page

Dave.
Senior Member

USA
1037 Posts

Posted - 29 June 2003 :  00:40:14  Show Profile
Oh and also, depending on what happens on Monday, I may or may not be here for the rest of the summer, so unfortunately, don't expect this MOD anytime soon. sorry guys.
Go to Top of Page

thauck
Starting Member

1 Posts

Posted - 30 June 2003 :  19:21:28  Show Profile  Visit thauck's Homepage
Hey guys

I have been trying to get tables to work as well.
Been using Crash 3.4, and posting at www.crashsite.nl

Added in the tags for <table>, <tr>, etc, but have encountered a problem wherein whenever a table is posted in a reply, it kills the forum tables (as mentioned above I think)

yabbse, a php board system has the ability to post tables in it. I know even less about php than I do VB, but maybe someone can take a look at yabbse and see how it was done there?
Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 30 June 2003 :  20:12:04  Show Profile
I made my own table code for a few different apps and it works well. For the last one I did, I had it so that you could specify 3 options for the table: border thickness, width, and alignment. It wouldn't work with Snitz code the way it is now, but it could be tweaked to make it work. I store my "code" in the database as is and convert it to html only when displaying it on the page. That way I don't have to convert both ways when needing to edit the contents.

Inside whatever function converts code to html, the following would need to be placed before doing any Replace on vbNewline, vbCrLf, etc.:
Set re = New RegExp
re.Pattern = "\[table=(\d+),(1?[0-9]{1,2}%|auto),(right|left)\]\s?"
re.Global = True
re.IgnoreCase = True
re.MultiLine = True
if re.Test(strText) then
	strText = re.Replace(strText,"<table bgcolor=""black"" border=""0"" cellpadding=""3"" cellspacing=""" & "$1" & """ style=""width:" & "$2" & """ align=""" & "$3" & """>")
end if
re.Pattern = "\[table=(\d+),(1?[0-9]{1,2}%|auto),none\]\s?"
re.Global = True
re.IgnoreCase = True
re.MultiLine = True
if re.Test(strText) then
	strText = re.Replace(strText,"<table bgcolor=""black"" border=""0"" cellpadding=""3"" cellspacing=""" & "$1" & """ style=""width:" & "$2" & """>")
end if	
set re = Nothing
	
	strText = Replace(strText,"[/table]" & vbCrLf,"</table>")
	strText = Replace(strText,"[/table]","</table>")
	strText = Replace(strText,"[[","<tr><td bgcolor=""#faebd7"">")
	strText = Replace(strText,"]]" & vbCrLf,"</td></tr>")
	strText = Replace(strText,"]]","</td></tr>")
	strText = Replace(strText,"]" & vbCrLf & "[","</td><td bgcolor=""#faebd7"">")
	strText = Replace(strText,"][","</td><td bgcolor=""#faebd7"">")


An example of the code would be:
[table=1,50%,right]
[[cell 1][cell 2][cell 3]]
[[cell 4][cell 5][cell 6]]
[/table]

The only problem is if you don't have the same number of columns in each row (so no colspan) or if a [ or ] were left out.

I also have some javascript so that when someone copies and pastes tab delimited text (from excel or from a table in word for instance) inside the textarea, highlights it, and clicks the table button, the code is placed correctly around each of the cells.

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page
Page: of 3 Previous Topic Topic Next Topic  
Previous Page
 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.26 seconds. Powered By: Snitz Forums 2000 Version 3.4.07