Joomler!.net - Decided on Joomla!

デル株式会社

Jboard is Multiple Board!

Home » Blog » $content
1 votes
Written by:Joomler! 4131 hits Sunday, 06 July 2008 16:55

ページのソースを表示してdescription部分を見るとそのページで開いている最後(一番下)の記事のdescriptionが、最初に表示される。これは、Joomla!のヘッドタグに追加するメソッドが後からの分を登録済みのものの前に追加するように書かれているからです。

そこで変更してみました。

Root/includes/joomla.php

$this->_head['meta'][$i][1] = $content . ', ' . $this->_head['meta'][$i][1];

$this->_head['meta'][$i][1] =  $this->_head['meta'][$i][1]. ', '. $content;

として後から追加されるものは登録済みのものの後に追加するようにしてみました。これで最新のものが先に来るはずです。というより並び順の最初のものと言った方が良いのかな。

と、Joomla!1.5はどうかと気になったので確認してみましたが、記事単体を表示した状態でないとdescriptionに反映されない? ブログレイアウトのように複数の記事の場合は、サイトのdescriptionのみが表示されるようですね。

 
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.