PDA

View Full Version : <html> or [BBcode] ?



Niellya
12-04-2002, 01:18 PM
Hi there.

I noticed both BBcode and html are enabled on these boards. Are there any plans to disable html? Just asking cause I couldn't figure out how to center with BBcode and had to switch it to html tags.

Does anyone know how to center with BBcode tags?

Lothay
12-04-2002, 01:47 PM
No, there are no plans to disable HTML.

Poor Ngreth and Niami went to a great deal of trouble to make sure both worked.

slimb hcarvul
12-04-2002, 01:52 PM
Currently no way to center with BBCode - just the basics with it:

bold
italic
underline
quote
lists
images
links

Niellya
12-04-2002, 01:52 PM
Thanks for the answer. I would understand if they did, just wanted to plan ahead.

Niami DenMother
12-04-2002, 03:17 PM
Aye, we don't plan, at this time, to disable either. Unfortunately, we have to tell the boards specifically what HTML codes (code, by code, by code) we wish to allow, and not all of the ones on the allow list are currently behaving. So, please bear with us if some codes are still flaking out. We're fixing what we can as we can. :)

Talnic
12-07-2002, 06:05 AM
Hehe I had the problem too with html not working with all the tags I told it to so I just wrote my own BB code for all the HTML I was gona allow and disabled HTML

It is real easy to add new BB code once ya figure it out. Also there is a nice mod out that makes it easy to add the quick BB code buttons up top

If you or the house ogre dont have time I can e-mail you the code for just about any html -> BB code conversion you could want :)

Ngreth Thergn
12-07-2002, 10:39 AM
Sure! :)

I would love to see a
[code:1]&lt;table>
&lt;tr>
&lt;th>&lt;/th>
&lt;td>&lt;/td>
&lt;/tr>
&lt;/table>[/code:1]

and

[code:1]&lt;option>
&lt;select>&lt;/select>
&lt;select>&lt;/select>
&lt;/option>[/code:1]

Talnic
12-07-2002, 02:32 PM
Ask and ye shall recive

[code:1]
################################################## ############
## MOD Title: Table and Select BB Code
## MOD Author: Digitalxero &lt; digitalxero@hotmail.com > http://64.45.3.172/twc_new
## MOD Description: Lets you use table and select bb Code
## MOD Version: 1.0.1
## MOD Status: Beta(I havnt had anyone but me test it)
## Installation Level: (moderate)
## Installation Time: 5 Minutes
## Files To Edit: bbcode.php4, bbcode.tpl
## Included Files: (n/a)
################################################## ############
## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/
################################################## ############
## Author Notes: If someone does not close thier table tag it could mess us the look of the topic
##
################################################## ############
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
################################################## ############

#
#-----[ OPEN]------------------------------------------
#
templates/subSilver/bbcode.tpl
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
&lt;!-- BEGIN table_open -->
&lt;table {TABLE}>
&lt;!-- END table_open -->
&lt;!-- BEGIN table_close -->
&lt;/table>
&lt;!-- END table_close -->
&lt;!-- BEGIN td_open -->
&lt;td {TD}>
&lt;!-- END td_open -->
&lt;!-- BEGIN td_close -->
&lt;/td>
&lt;!-- END td_close -->
&lt;!-- BEGIN th_open -->
&lt;th {TH}>
&lt;!-- END th_open -->
&lt;!-- BEGIN th_close -->
&lt;/th>
&lt;!-- END th_close -->
&lt;!-- BEGIN tr_open -->
&lt;tr {TR}>
&lt;!-- END tr_open -->
&lt;!-- BEGIN tr_close -->
&lt;/tr>
&lt;!-- END tr_close -->

&lt;!-- BEGIN select_open -->
&lt;select {SELECT}>
&lt;!-- END select_open -->
&lt;!-- BEGIN select_close -->
&lt;/select>
&lt;!-- END select_close -->
&lt;!-- BEGIN option_open -->
&lt;option {OPTION}>{OPTION_TEXT}
&lt;!-- END option_open -->
&lt;!-- BEGIN option_close -->
&lt;/option>
&lt;!-- END option_close -->

#
#-----[ OPEN]------------------------------------------
#
includes/bbcode.php

#
#-----[ FIND ]------------------------------------------
#
function prepare_bbcode_template($bbcode_tpl)
{
global $lang;

#
#-----[ AFTER, ADD ]------------------------------------------
#
//Table
$bbcode_tpl['table_open'] = str_replace('{TABLE}', '\\1', $bbcode_tpl['table_open']);
$bbcode_tpl['td_open'] = str_replace('{TD}', '\\1', $bbcode_tpl['td_open']);
$bbcode_tpl['th_open'] = str_replace('{TH}', '\\1', $bbcode_tpl['th_open']);
$bbcode_tpl['tr_open'] = str_replace('{TR}', '\\1', $bbcode_tpl['tr_open']);

//Select
$bbcode_tpl['select_open'] = str_replace('{SELECT}', '\\1', $bbcode_tpl['select_open']);
//option
$bbcode_tpl['option_open'] = str_replace('{OPTION}', '\\1', $bbcode_tpl['option_open']);
$bbcode_tpl['option_open'] = str_replace('{OPTION_TEXT}', '\\2', $bbcode_tpl['option_open']);

#
#-----[ FIND ]------------------------------------------
#
function prepare_bbcode_template($bbcode_tpl)
{
global $lang;
#
#-----[ AFTER, ADD ]------------------------------------------
#
//Table
$bbcode_tpl['table_open'] = str_replace('{TABLE}', '\\1', $bbcode_tpl['table_open']);
$bbcode_tpl['td_open'] = str_replace('{TD}', '\\1', $bbcode_tpl['td_open']);
$bbcode_tpl['th_open'] = str_replace('{TH}', '\\1', $bbcode_tpl['th_open']);
$bbcode_tpl['tr_open'] = str_replace('{TR}', '\\1', $bbcode_tpl['tr_open']);

//Select
$bbcode_tpl['select_open'] = str_replace('{SELECT}', '\\1', $bbcode_tpl['select_open']);
//option
$bbcode_tpl['option_open'] = str_replace('{OPTION}', '\\1', $bbcode_tpl['option_open']);
$bbcode_tpl['option_open'] = str_replace('{OPTION_TEXT}', '\\2', $bbcode_tpl['option_open']);

#
#-----[ FIND ]------------------------------------------
#
function bbencode_first_pass($text, $uid)
{
// pad it with a space so we can distinguish between FALSE and matching the 1st char (index 0).
// This is important; bbencode_quote(), bbencode_list(), and bbencode_code() all depend on it.
$text = &quot; &quot; . $text;
#
#-----[ AFTER, ADD ]------------------------------------------
#
//Start Butification code
//What this does is allows you to format your table and select code in a readable manner vs only on one line
if ( preg_match(&quot;#\[table(.*?)\](\n*?)(.*?)\[/table\]#si&quot;, $text, $test)) {
for($i=0;$i&lt;count($test[0]);$i++)
{
$test[0][$i] = str_replace(&quot;\r\n&quot;, &quot;\t&quot;, $test[0]);
$text = preg_replace(&quot;#\[table&quot;.$test[1][$i].&quot;\]&quot;.$test[2] [$i].&quot;\[/table\]#si&quot;, $test[0][$i], $text, 1);
}

$textbr = str_replace(&quot;\r\n&quot;, &quot;\t&quot;, $test[0]);
$text = preg_replace(&quot;#\[table(.*?)\](\n*?)(.*?)\[/table\]#si&quot;, $textbr, $text);
}

if ( preg_match_all(&quot;#\[th(.*?)\](.*?)\[/th\]#si&quot;, $text, $test)) {
for($i=0;$i&lt;count($test[0]);$i++)
{
$test[0][$i] = str_replace(&quot;\t&quot;, &quot;\n&quot;, $test[0][$i]);
$text = preg_replace(&quot;#\[th&quot;.$test[1][$i].&quot;\]&quot;.$test[2][$i ].&quot;\[/th\]#si&quot;, $test[0][$i], $text, 1);
}
}

if ( preg_match_all(&quot;#\[td(.*?)\](.*?)\[/td\]#si&quot;, $text, $test)) {
for($i=0;$i&lt;count($test[0]);$i++)
{
$test[0][$i] = str_replace(&quot;\t&quot;, &quot;\n&quot;, $test[0][$i]);
$text = preg_replace(&quot;#\[td&quot;.$test[1][$i].&quot;\]&quot;.$test[2][$i ].&quot;\[/td\]#si&quot;, $test[0][$i], $text, 1);
}
}

if ( preg_match(&quot;#\[select(.*?)\](.*?)\[/select\]#si&quot;, $text, $test)) {
for($i=0;$i&lt;count($test[0]);$i++)
{
$test[0][$i] = str_replace(&quot;\n&quot;, '', $test[0]);
$text = preg_replace(&quot;#\[select&quot;.$test[1][$i].&quot;\]&quot;.$test[2 ][$i].&quot;\[/select\]#si&quot;, $test[0][$i], $text, 1);
}

}

if ( preg_match(&quot;#\[option(.*?)\](.*?)\[/option\]#si&quot;, $text, $test)) {
for($i=0;$i&lt;count($test[0]);$i++)
{
$test[0][$i] = str_replace(&quot;\n&quot;, &quot;&quot;, $test[0]);
$text = preg_replace(&quot;#\[option&quot;.$test[1][$i].&quot;\]&quot;.$test[2 ][$i].&quot;\[/option\]#si&quot;, $test[0][$i], $text, 1);
}
}
//Table
$text = preg_replace(&quot;#\[table(.*?)\](.*?)\[/table\]#si&quot;, &quot;[table:$uid \\1]\\2[/table:$uid]&quot;, $text);
$text = preg_replace(&quot;#\[td(.*?)\](.*?)\[/td\]#si&quot;, &quot;[td:$uid \\1]\\2[/td:$uid]&quot;, $text);
$text = preg_replace(&quot;#\[th(.*?)\](.*?)\[/th\]#si&quot;, &quot;[th:$uid \\1]\\2[/th:$uid]&quot;, $text);
$text = preg_replace(&quot;#\[tr(.*?)\](.*?)\[/tr\]#si&quot;, &quot;[tr:$uid \\1]\\2[/tr:$uid]&quot;, $text);
//Select
$text = preg_replace(&quot;#\[select(.*?)\](.*?)\[/select\]#si&quot;, &quot;[select:$uid \\1]\\2[/select:$uid]&quot;, $text);
//Option
$text = preg_replace(&quot;#\[option(.*?)\](.*?)\[/option\]#si&quot;, &quot;[option:$uid \\1]\\2[/option:$uid]&quot;, $text);
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
[/code:1]

Talnic
12-07-2002, 04:15 PM
You can write you table and select tages in a readable manner without having the anoying BR's added to them

ie



This is
my
row spaning
td

This is a normal td


This is a second normal td




should output something like

|----------------------------------------------|
|this is++++| this is a normal td |
|my++++++|-------------------------------|
|row spaning |This is a second normal td |
|td++++++|+++++++++++++++++|

if I didnt include the butification code it would have 8 BR's ontop of the table

you can use select also as follows


Something

Talnic
12-07-2002, 04:21 PM
oh you can go >>Here&lt;&lt; (http://64.45.3.172/twc_new/index.php4?page=viewtopic.php4&amp;p=7#7) to see it and test it out


Another note...if someone doe not close thier [table] tag it might make the board look funny and not much I can do about that

Haawk Wolfheart
12-08-2002, 08:12 AM
Aye, I've seen a number of msg boards "broken" by someone forgetting to close a table. Hopefully folks who use tables in their sigs will preview them 1st to make sure they work! ;)

Psychosis
12-09-2002, 12:26 AM
Aye, I've seen a number of msg boards "broken" by someone forgetting to close a table. Hopefully folks who use tables in their sigs will preview them 1st to make sure they work! ;)
No dobut, all that it does is make more work for the Mods and the Admins to go through and clean code.

.............. Wait a sec......... Thats all I do all day is go through and code in perl/html for my company. :?

And trust me when you screw up on somthing like that and 100+ Managers are looking at it you tend to do it only once.

<center><font size="+4" color="red"><Font face="Morpheus">PREVIEW IS YOUR FRIEND</font></font></center>

Though for some reason I cant get the font face tag to work :(

I am trying to use the Morpheus font.

If you want you can download that here at my site.

http://matrix.terrabox.com/~psychosis/fonts/morpheus.zipPC Morpheus Font</a>

http://matrix.terrabox.com/~psychosis/fonts/morpheus.sit.hqxMAC Morpheus Font</a>

http://matrix.terrabox.com/~psychosis/fonts/nosferat.zipPC Nosferatu Font</a>

http://matrix.terrabox.com/~psychosis/fonts/nosferatu.sit.hqxMAC Nosferatu Font</a>

Ngreth Thergn
12-14-2002, 11:02 AM
Talnic.

Something looks odd in that code.

I see the code for making it OPEN table and selections... I do NOT see code to close tables and selections... AND the open part is doen TWICE... is this where the close stuff was suposd to be?

Talnic
12-17-2002, 10:29 AM
no it has to be done twcie. it does BBcode in two passes for the more complext BB code.

It doent auto close the tag, though I could probably figure out how to do that. but it will have to wait a week or so since I am outa town right now

Dragoron
12-17-2002, 11:56 AM
Thanks a TON for enabling HTML on the boards, without it I wouldn't be able to do the signature that I worked so hard on.

Faymar
12-28-2002, 04:02 PM
&lt;Span style="font-decoration:strike-through">test</span>

Ngreth Thergn
12-28-2002, 05:13 PM
Out of room to add tags. so no more HTML tags.