Joomler!.net - Decided on Joomla!

デル株式会社

Wiki or Wordpress? No it is JContentPlus.

Home » Blog » smile.class.php
2 votes
Written by:Joomler! 4587 hits Saturday, 26 April 2008 17:50

また、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);

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

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

 

JContentPlus for Joomla!1.5 powered by Joomler!.net

joomler.net is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
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.