Joomler!.net - Decided on Joomla!

デル株式会社

Jboard is Multiple Board!

Home » Blog » Break tag in Code SyntaxHighliter : Fireboard Hack
Apr
26
2008

Break tag in Code SyntaxHighliter : Fireboard Hack

EMailPrintPDF
2 votes
Written by:Joomler! 3133 hits

また、Fireboardのコードを変更しちゃいました。

投稿メッセージ中にコードを入力するとうちではSyntaxHighliterプラグインによってHighlightされますが、コード中に改行が入っていても<br />タグに変換されてしまうため見苦しいものになっていました。

そこで・・・。

root/components/com_fireboard/template/default/smile.class.php 内5カ所を変更・追加しました。

if ($break == "\r")
$break = "\n";

while (list(, $value) = each($content))

if ($break == "\r")
$break = "\n";
$textarea = false;
while (list(, $value) = each($content))

のように

if ((!count($innbr) && in_array($t[1], $nobr)) || in_array($t[1], $innbr))
$innbr[] = $t[1];
// Otherwise this is a closing tag

if ((!count($innbr) && in_array($t[1], $nobr)) || in_array($t[1], $innbr))
$innbr[] = $t[1];
// Otherwise this is a closing tag
if(strpos($value, 'name="code"')){
 $textarea = true;
}

のように

if (in_array(substr($value, 1), $innbr))
unset($innbr[count($innbr)]);

if (in_array(substr($value, 1), $innbr))
unset($innbr[count($innbr)]);

if(strpos($value, 'textarea')){
 $textarea = false;
}

のように

if (!count($innbr) && !$textarea)
$value = str_replace("\r", "<br />\n", $value);

if (!count($innbr) && !$textarea)
$value = str_replace("\r", "<br />\n", $value);

のように変更してみました。

この変更は、少し場当たり的と言えるかもしれませんが、一番簡単で私の目的は成し得ていますので十分と言えると思っています。

 

ADD A COMMENT

Subject*
:
Color Swatch




Email Link Page Code Text Align Center Text Align Justify Text Align Left Text Align Right Text Bold Text Quote Text Italic Text List Bullets Text List Numbers Text Strikethrough Text Underline World Link
Sun Unhappy Smile Evilgrin Wink Tongue Lightning Surprised Grin Rain Clouds Cloudy Snow Waii
Name*
:
EMail*
:
Website
:

JContentPlus for Joomla!1.5 powered by Joomler!.net

デル株式会社

Related Items

The Joomla!(R) name is used under a limited license from Open Source Matters in the United States and other countries.
joomler.net is not affiliated with or endorsed by Open Source Matters or the Joomla! Project.