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: Forum Code - Table tags
 New Topic  Topic Locked
 Printer Friendly
Previous Page
Author Previous Topic Topic Next Topic
Page: of 2

ajhvdb
Junior Member

Netherlands
392 Posts

Posted - 20 November 2004 :  19:07:28  Show Profile
Thx, needed something like this but it took me an hour to find out that line 3 needed to be:
tblCode = Split(fString, "[table")
Go to Top of Page

ajhvdb
Junior Member

Netherlands
392 Posts

Posted - 20 November 2004 :  19:25:00  Show Profile
For the breaks i also replaced:
ClearBreaksS1 = Left(tblCode(i), ftblEn)
ClearBreaksS2 = Replace(ClearBreaksS1, "<br>", " ")
ClearBreaksS2 = Replace(ClearBreaksS2, "<br />", " ")
ClearBreaksS2 = Replace(ClearBreaksS2, Chr(10), " ")
tblCode(i) = replace(tblCode(i), ClearBreaks1, ClearBreaks2)

With:
tblCode(i) = replace(tblCode(i), "]<br />[", "][")

Not tested live
Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 21 November 2004 :  01:25:42  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
quote:
Thx, needed something like this but it took me an hour to find out that line 3 needed to be:
tblCode = Split(fString, "[table")


Thats in the main topic.... Is there a problem with that line?

quote:
For the breaks i also replaced:
ClearBreaksS1 = Left(tblCode(i), ftblEn)
ClearBreaksS2 = Replace(ClearBreaksS1, "<br>", " ")
ClearBreaksS2 = Replace(ClearBreaksS2, "<br />", " ")
ClearBreaksS2 = Replace(ClearBreaksS2, Chr(10), " ")
tblCode(i) = replace(tblCode(i), ClearBreaks1, ClearBreaks2)

With:
tblCode(i) = replace(tblCode(i), "]<br />[", "][")



That wont do anything... my code didnt even do anything (cant figure that out yet...), but looking for <br /> being right inbetween brackets like that wont happen, unless by chance its like that in the db (rare it might happen)

-Stim
Go to Top of Page

ajhvdb
Junior Member

Netherlands
392 Posts

Posted - 21 November 2004 :  09:58:55  Show Profile
quote:
Is there a problem with that line?Thats in the main topic....

Please look at the main topic, in my browser that line is displayed as:
tblCode = Split(fString, "")

quote:
That wont do anything...

With the suggested code there won't be any empty lines before the table if you enter:
[table align=center table]
[tr table]
[td table]Cell 1
[/td]
[/tr]
[/table]



Edited by - ajhvdb on 21 November 2004 09:59:48
Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 21 November 2004 :  15:39:59  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
ah, I apologize, I hadnt realized that, sorry :( Fixed the main topic.

-Stim
Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 07 December 2004 :  08:30:53  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
Updated - 12/07/04

Fixed the line breaks issue, it is now safe to put the [tr and [td tags on new lines without affecting the format of the table

(previously it would insert a <br /> between those tags, and anyone who knows html knows how that ends up)

Also fixed multiple tables within one post issue

-Stim

Edited by - Da_Stimulator on 07 December 2004 09:20:56
Go to Top of Page

jensen
New Member

United Kingdom
97 Posts

Posted - 23 December 2004 :  08:32:59  Show Profile
I added the code to inc_func_common.asp and also added the countsubs function to inc_func_common.asp

But i dont get tables i get the text...
[table align=center table][tr table][td table]Cell 1[/td][/tr][/table]
as entered.

This is my moded inc_func_common.asp - what have i done wrong?


'############### table tags ##################
function CountSubs(fString, fSubString)
	 CountSubs = UBound(split(fString, fSubString))
end function
'############### end table tags ##################

function extratags(fString)
'################# Tables tags #####################
For i=0 to Ubound(tblCode)
  ftblBr = InStr(tblCode(i), " table]")
  ftrLoc = InStr(tblCode(i), "[tr")
  ftdLoc = InStr(tblCode(i), "[td")
  ftrClo = InStr(tblCode(i), "[/tr]")
  ftdClo = InStr(tblCode(i), "[/td]")
  ftblEn = InStr(tblCode(i), "[/table]")
  ClearBreaksS1 = Left(tblCode(i), ftblEn)
  ClearBreaksS2 = Replace(ClearBreaksS1, "<br>", " ")
  ClearBreaksS2 = Replace(ClearBreaksS2, "<br />", " ")
  ClearBreaksS2 = Replace(ClearBreaksS2, Chr(10), " ")
  tblCode(i) = replace(tblCode(i), ClearBreaks1, ClearBreaks2)
  if ftdLoc > ftrLoc and _
  (ftdClo > ftdLoc and ftdClo < ftrClo) and _
  (ftrClo < ftblEn and ftrClo > ftdClo) and _
  ftblEn > ftrClo and _
  CountSubs(tblCode(i), "[tr")=CountSubs(tblCode(i), "[/tr]") and _
  CountSubs(tblCode(i), "[td")=CountSubs(tblCode(i), "[/td]") and _
  CountSubs(fString, "[/table]")=Ubound(tblCode) then
    tblCode(i) = replace(tblCode(i), " align=center", " align=""center""")
	tblCode(i) = replace(tblCode(i), " align=left", " align=""left""")
	tblCode(i) = replace(tblCode(i), " align=right", " align=""right""")
	tblCode(i) = replace(tblCode(i), " valign=top", " valign=""top""")
	tblCode(i) = replace(tblCode(i), " valign=bottom", " valign=""bottom""")
    tblCode(i) = replace(tblCode(i), "[tr", "<tr")
	tblCode(i) = replace(tblCode(i), "[td", "<td")
	tblCode(i) = replace(tblCode(i), "[/td]", "</td>")
	tblCode(i) = replace(tblCode(i), "[/tr]", "</tr>")
	tblCode(i) = replace(tblCode(i), "[/table]", "</table>")
	tblCode(i) = replace(tblCode(i), " table]", ">")
	JoinBack = "<table"
   else
        JoinBack = "[table"
   end if
Next
fString = Join(tblCode, JoinBack)
'############### end table tags ##################

	fString = doCode(fString, "", "", "<font color=""" & CColor & """>", "</font id=""" & CColor & """>")
	extratags = fString
end function


Edited by - jensen on 23 December 2004 09:30:05
Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 23 December 2004 :  11:56:52  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
You're missing this part:


dim tblCode, ftrLoc, ftdLoc, ftrClo, ftdClo, ftblEn, JoinBack
dim ftblBr, clearBreaksS1, clearBreaksS2
tblCode = Split(fString, "[table")


That should go right before this line:


For i=0 to Ubound(tblCode)

-Stim
Go to Top of Page
Page: of 2 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.13 seconds. Powered By: Snitz Forums 2000 Version 3.4.07