Joomler!.net - Decided on Joomla!

デル株式会社

Wiki or Wordpress? No it is JContentPlus.

Home » Blog » ThickBox
0 votes
Written by:Joomler! 4115 hits Saturday, 26 January 2008 18:15

少し改造してみた。

http://demo.joomler.net/

各記事上のPDFアイコンとE-Mailアイコンをクリックしてみてください。

GreyBoxを使って表示するようにしてみました。

変更は以下

Root/libraries/joomla/html/html.php

Line:110

return '<a href="'.$url.'" '.$attribs.'>'.$text.'</a>';

$base = substr(JURI::base(), 0, strlen(JURI::base()) - 1);
  $regex = '/<img[^>]*alt="pdf"[^>]*\/>/i';
  if(preg_match($regex, $text)){
   $attribs = ' rel="gb_page_fs[]"';
   $url = $base. $url;
  }
  $regex = '/<img[^>]*alt="E-mail"[^>]*\/>/i';
  if(preg_match($regex, $text)){
   $attribs = $attribs. ' rel="gb_page_center[480, 320]"';
   $url = $base. $url;
  }
  return '<a href="'.$url.'" '.$attribs.'>'.$text.'</a>';

へ変更した。

これだけでは、常時GreyBoxのJavascriptは読み込まれない(プラグインには関係ない)のでテンプレートのheadセクションに以下を追加

<script type="text/javascript">var GB_ROOT_DIR = "<?brush:php; echo $this->baseurl ?>/plugins/content/greybox/"</script>
<script type="text/javascript" src="/<?brush:php; echo $this->baseurl ?>/plugins/content/greybox/AJS.js"></script>
<script type="text/javascript" src="/<?brush:php; echo $this->baseurl ?>/plugins/content/greybox/AJS_fx.js"></script>
<script type="text/javascript" src="/<?brush:php; echo $this->baseurl ?>/plugins/content/greybox/gb_scripts.js"></script>
<link href="/<?brush:php; echo $this->baseurl ?>/plugins/content/greybox/gb_styles.css" rel="stylesheet" type="text/css" />

これは、デフォルトのrhuk_milkywayテンプレートの場合です。

これによって常時GreyBoxのJavascriptがロードされるのでGreyBoxプラグインをインストールしている場合は、Output GreyBox.jsをNoに変更してください。

output_no_greybox

参考にGreyBoxを使ってみましたが、同様にLightBox、ThickBox、LightWindowなど他の画像表示のJavascriptにも応用できるでしょう。

HTMLが表示できるJavascriptライブラリでないと無理でしたね。

 
0 votes
Written by:Joomler! 3442 hits Thursday, 17 January 2008 18:46

  • テンプレートが狭くて自分で作ったエクステンションで使っていないものがある。
  • 配布しているバージョンより古いものを使っていたりする。
  • 配布しているものより新しいバージョンでバグを修正したものを使っているときがある。
  • 自分のサイト用に配布しているものと全く違うものを使っているときがある。
  • 配布している物とは異なるものだが、バグが見つかりバレ無いように密かにダンプしながらオンラインでバグ修正しているときがある。Hot

と、担当者に先日I dont know 新しいバージョン使っていないよ。古い物を使っている。」と言ったら

「信じられない。Surprisedと。そりゃそうか・・・と変に納得。

 

さて、現在保留中のエクステンションを列挙。
保留中からボツになるものもあるでしょうけど。

  • FlashBox : 考えているだけ。頭の中ではできている。
  • ThickBox_R : 途中までやったが放置。
  • Cycle... : 現在上部に表示しているが途中で放置。
  • Template Controler : 昨年中にテストまでと思っていたが間に合わなかった。新年は、新しいテンプレートと思っていたのですが・・・。優先度高。
  • J_Pagepeel : もう少しFlashのお勉強を・・・。Linuxでは、Transparentが効かなかったのがショックで放置。他のPagepeelもそうですよ。現在Winのみ表示。
  • ArticleTranslation : 中途半端なまま、現在使用しているが途中で放置。
  • SiteTrans : 方法は考えたが、放置。優先度中。
  • FlashJoomla : 考えただけ。
  • Other : 秘密

と、いろいろ考えてはいるのですが、なかなか時間がありません。

 

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.