
XOOPSチューニング
↑
outof.orgで導入したチューニングやハックを掲載していきます。

XOOPS本体/XOOPS
↑

自動ログインハック
↑
→ http://www.peak.ne.jp/xoops/modules/mydownloads/viewcat.php?cid=2

PM[Private Message]機能拡張Hack
↑
→ http://jp.xoops.org/modules/mydownloads/singlefile.php?cid=8&lid=153

XOOPSに検索語マーカーを(Ver.2)
↑
→ http://hypweb.net/xoops/modules/pukiwiki/1560.html

modPukiWikiの組み込み
↑
→ http://hypweb.net/xoops/modules/pukiwiki/1324.html
→ http://www.kowa.org/modules/pukiwiki/326.html

[code]を見やすく便利に
↑
→ http://hypweb.net/xoops/modules/pukiwiki/661.html

投票数ランキングブロックのアバターが小さくないようにする
↑

ICQや会社名などの項目を削除
↑

検索結果の表示数を増やす
↑
変更前:
$results =& $module->search($queries, $andor, 5, 0);
変更後:
$results =& $module->search($queries, $andor, 20, 0);
変更前:
変更後:

PukiWiki書式ヘルパー
↑
対象ファイル → XOOPSルート/include/xoopscodes.php
function xoopsCodeTarea($textarea_id, $cols=60, $rows=15, $suffix=null)
{
$hiddentext = isset($suffix) ? 'xoopsHiddenText'.trim($suffix) : 'xoopsHiddenText';
//Hack for url, email ...., the anchor is for having a link on [_More...]
echo "<a name='moresmiley'></a><img src='".XOOPS_URL."/images/url.gif' alt='url' onmouseover='style.cursor=\"hand\"' onclick='xoopsCodeUrl(\"$textarea_id\", \"".htmlspecialchars(_ENTERURL, ENT_QUOTES)."\", \"".htmlspecialchars(_ENTERWEBTITLE, ENT_QUOTES)."\");'/> <img src='".XOOPS_URL."/images/email.gif' alt='email' onmouseover='style.cursor=\"hand\"' onclick='xoopsCodeEmail(\"$textarea_id\", \"".htmlspecialchars(_ENTEREMAIL, ENT_QUOTES)."\");' /> <img src='".XOOPS_URL."/images/imgsrc.gif' alt='imgsrc' onmouseover='style.cursor=\"hand\"' onclick='xoopsCodeImg(\"$textarea_id\", \"".htmlspecialchars(_ENTERIMGURL, ENT_QUOTES)."\", \"".htmlspecialchars(_ENTERIMGPOS, ENT_QUOTES)."\", \"".htmlspecialchars(_IMGPOSRORL, ENT_QUOTES)."\", \"".htmlspecialchars(_ERRORIMGPOS, ENT_QUOTES)."\");' /> <img src='".XOOPS_URL."/images/image.gif' alt='image' onmouseover='style.cursor=\"hand\"' onclick='openWithSelfMain(\"".XOOPS_URL."/imagemanager.php?target=".$textarea_id."\",\"imgmanager\",400,430);' /> <img src='".XOOPS_URL."/images/code.gif' alt='code' onmouseover='style.cursor=\"hand\"' onclick='xoopsCodeCode(\"$textarea_id\", \"".htmlspecialchars(_ENTERCODE, ENT_QUOTES)."\");' /> <img src='".XOOPS_URL."/images/quote.gif' alt='quote' onmouseover='style.cursor=\"hand\"' onclick='xoopsCodeQuote(\"$textarea_id\",\"".htmlspecialchars(_ENTERQUOTE, ENT_QUOTES)."\");'/><br />\n";
$sizearray = array("xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large");
echo "<select id='".$textarea_id."Size' onchange='setVisible(\"xoopsHiddenText\");setElementSize(\"".$hiddentext."\",this.options[this.selectedIndex].value);'>\n";
echo "<option value='SIZE'>"._SIZE."</option>\n";
foreach ( $sizearray as $size ) {
echo "<option value='$size'>$size</option>\n";
}
echo "</select>\n";
$fontarray = array("Arial", "Courier", "Georgia", "Helvetica", "Impact", "Verdana");
echo "<select id='".$textarea_id."Font' onchange='setVisible(\"xoopsHiddenText\");setElementFont(\"".$hiddentext."\",this.options[this.selectedIndex].value);'>\n";
echo "<option value='FONT'>"._FONT."</option>\n";
foreach ( $fontarray as $font ) {
echo "<option value='$font'>$font</option>\n";
}
echo "</select>\n";
$colorarray = array("00", "33", "66", "99", "CC", "FF");
echo "<select id='".$textarea_id."Color' onchange='setVisible(\"xoopsHiddenText\");setElementColor(\"".$hiddentext."\",this.options[this.selectedIndex].value);'>\n";
echo "<option value='COLOR'>"._COLOR."</option>\n";
foreach ( $colorarray as $color1 ) {
foreach ( $colorarray as $color2 ) {
foreach ( $colorarray as $color3 ) {
echo "<option value='".$color1.$color2.$color3."' style='background-color:#".$color1.$color2.$color3.";color:#".$color1.$color2.$color3.";'>#".$color1.$color2.$color3."</option>\n";
}
}
}
echo "</select><span id='".$hiddentext."'>"._EXAMPLE."</span>\n";
echo "<br />\n";
// for PukiWiki helper.
$url = XOOPS_URL."/modules/pukiwiki";
$wiki_helper = <<<EOD
<map name="map_button">
<area shape="rect" coords="0,0,22,16" alt="URL" href="#" onClick="java script:pukiwiki_linkPrompt('url'); return false;">
<area shape="rect" coords="24,0,40,16" alt="B" href="#" onClick="java script:pukiwiki_tag('b'); return false;">
<area shape="rect" coords="43,0,59,16" alt="I" href="#" onClick="java script:pukiwiki_tag('i'); return false;">
<area shape="rect" coords="62,0,79,16" alt="U" href="#" onClick="java script:pukiwiki_tag('u'); return false;">
<area shape="rect" coords="81,0,103,16" alt="SIZE" href="#" onClick="java script:pukiwiki_tag('size'); return false;">
</map>
<map name="map_color">
<area shape="rect" coords="0,0,8,8" alt="Black" href="#" onClick="java script:pukiwiki_tag('Black'); return false;">
<area shape="rect" coords="8,0,16,8" alt="Maroon" href="#" onClick="java script:pukiwiki_tag('Maroon'); return false;">
<area shape="rect" coords="16,0,24,8" alt="Green" href="#" onClick="java script:pukiwiki_tag('Green'); return false;">
<area shape="rect" coords="24,0,32,8" alt="Olive" href="#" onClick="java script:pukiwiki_tag('Olive'); return false;">
<area shape="rect" coords="32,0,40,8" alt="Navy" href="#" onClick="java script:pukiwiki_tag('Navy'); return false;">
<area shape="rect" coords="40,0,48,8" alt="Purple" href="#" onClick="java script:pukiwiki_tag('Purple'); return false;">
<area shape="rect" coords="48,0,55,8" alt="Teal" href="#" onClick="java script:pukiwiki_tag('Teal'); return false;">
<area shape="rect" coords="56,0,64,8" alt="Gray" href="#" onClick="java script:pukiwiki_tag('Gray'); return false;">
<area shape="rect" coords="0,8,8,16" alt="Silver" href="#" onClick="java script:pukiwiki_tag('Silver'); return false;">
<area shape="rect" coords="8,8,16,16" alt="Red" href="#" onClick="java script:pukiwiki_tag('Red'); return false;">
<area shape="rect" coords="16,8,24,16" alt="Lime" href="#" onClick="java script:pukiwiki_tag('Lime'); return false;">
<area shape="rect" coords="24,8,32,16" alt="Yellow" href="#" onClick="java script:pukiwiki_tag('Yellow'); return false;">
<area shape="rect" coords="32,8,40,16" alt="Blue" href="#" onClick="java script:pukiwiki_tag('Blue'); return false;">
<area shape="rect" coords="40,8,48,16" alt="Fuchsia" href="#" onClick="java script:pukiwiki_tag('Fuchsia'); return false;">
<area shape="rect" coords="48,8,56,16" alt="Aqua" href="#" onClick="java script:pukiwiki_tag('Aqua'); return false;">
<area shape="rect" coords="56,8,64,16" alt="White" href="#" onClick="java script:pukiwiki_tag('White'); return false;">
</map>
<script type="text/javascript" src="{$url}/skin/default.ja.js"></script>
<script type="text/javascript">
<!--
if (pukiwiki_WinIE)
{
document.write('※ PukiWiki書式ヘルパー⇒');
pukiwiki_show_fontset_img("$url");
}
else
{
document.write('※ PukiWiki書式も使えます。');
}
-->
</script>
EOD;
//Hack smilies move for bold, italic ...
echo "<img src='".XOOPS_URL."/images/bold.gif' alt='bold' onmouseover='style.cursor=\"hand\"' onclick='setVisible(\"".$hiddentext."\");makeBold(\"".$hiddentext."\");' /> <img src='".XOOPS_URL."/images/italic.gif' alt='italic' onmouseover='style.cursor=\"hand\"' onclick='setVisible(\"".$hiddentext."\");makeItalic(\"".$hiddentext."\");' /> <img src='".XOOPS_URL."/images/underline.gif' alt='underline' onmouseover='style.cursor=\"hand\"' onclick='setVisible(\"".$hiddentext."\");makeUnderline(\"".$hiddentext."\");'/> <img src='".XOOPS_URL."/images/linethrough.gif' alt='linethrough' onmouseover='style.cursor=\"hand\"' onclick='setVisible(\"".$hiddentext."\");makeLineThrough(\"".$hiddentext."\");' /></a> <input type='text' id='".$textarea_id."Addtext' size='20' /> <input type='button' onclick='xoopsCodeText(\"$textarea_id\", \"".$hiddentext."\", \"".htmlspecialchars(_ENTERTEXTBOX, ENT_QUOTES)."\")' value='"._ADD."' /><br />{$wiki_helper}<br /><textarea id='".$textarea_id."' name='".$textarea_id."' cols='$cols' rows='$rows' onselect=\"xoopsSavePosition('".$textarea_id."');\" onclick=\"xoopsSavePosition('".$textarea_id."');\" onkeyup=\"xoopsSavePosition('".$textarea_id."');pukiwiki_pos();\" onmouseup=\"pukiwiki_pos();\">".$GLOBALS[$textarea_id]."</textarea><br />\n";
//Fin du hack
}

Googleの検索結果のように本文抜粋
↑
- xoops/search.php
- xoops/xoops.css
- xoops/include/functions.php
- xoops/modules/system/templates/system_userinfo.html
- xoops/modules/newbb/include/search.inc.php
- xoops/modules/news/include/search.inc.php
- xoops/modules/pukiwiki/xoops_search.inc.php
http://hypweb.net/xoops/modules/pukiwiki/1070.html

フォーラムで署名が表示できない
↑
http://jp.xoops.org/modules/newbb/viewtopic.php?topic_id=4928&forum=12
フォーラムの投稿にある、[オプション]の[署名を付ける]にチェックを入れても
[アカウント編集]-[署名]にある[投稿に署名を必ず追加する]にチェックが入っていないと
署名が表示されないようです。
XOOPS 2.0.7で確認。
※わかりずらい仕様だ、、、

ユーザメニューにUser's Wikiの項目を作る
↑
http://hypweb.net/xoops/modules/newbb/viewtopic.php?viewmode=flat&topic_id=518&forum=12

「モジュール管理」のモジュールをソートする
↑
http://jp.xoops.org/modules/newbb/viewtopic.php?viewmode=flat&order=DESC&topic_id=1707&forum=14

「管理メニュー」のモジュールアイコンをソートする
↑
http://jp.xoops.org/modules/newbb/viewtopic.php?viewmode=flat&order=DESC&topic_id=1683&forum=14

オンライン状況ブロックの更新頻度を上げる
↑
http://jp.xoops.org/modules/newbb/viewtopic.php?viewmode=flat&topic_id=3267&forum=15

「フォーラムでの最近の投稿」ブロックでフォーラムやスレッドで改行させない
↑
フォーラムのタイトルが長い場合など、フォーラムの項目内で改行されてしまい
レイアウトが崩れてしまうことがあります。
nowrapを書き加えて改行しないようにしましょう。
対象ファイル → XOOPSルート/modules/newbb/templates/blocks/newbb_block_new.html
変更前:
<{foreach item=topic from=$block.topics}>
<tr class="<{cycle values="even,odd"}>">
<td><a href="<{$xoops_url}>/modules/newbb/viewforum.php?forum=<{$topic.forum_id}>"><{$topic.forum_name}></a></td>
<td><a href="<{$xoops_url}>/modules/newbb/viewtopic.php?topic_id=<{$topic.id}>&forum=<{$topic.forum_id}>&post_id=<{$topic.post_id}>#forumpost<{$topic.post_id}>"><{$topic.title}></a></td>
<td align="center"><{$topic.replies}></td>
<td align="center"><{$topic.views}></td>
<td align="right"><{$topic.time}></td>
</tr>
<{/foreach}>
変更後:
<{foreach item=topic from=$block.topics}>
<tr class="<{cycle values="even,odd"}>">
<td nowrap><a href="<{$xoops_url}>/modules/newbb/viewforum.php?forum=<{$topic.forum_id}>"><{$topic.forum_name}></a></td>
<td nowrap><a href="<{$xoops_url}>/modules/newbb/viewtopic.php?topic_id=<{$topic.id}>&forum=<{$topic.forum_id}>&post_id=<{$topic.post_id}>#forumpost<{$topic.post_id}>"><{$topic.title}></a></td>
<td align="center"><{$topic.replies}></td>
<td align="center"><{$topic.views}></td>
<td align="right"><{$topic.time}></td>
</tr>
<{/foreach}>
※変更後にフォーラムのアップデートが必要

ユーザメニューの項目を変更する
↑
変更前:
<table cellspacing="0">
<tr>
<td id="usermenu">
<a class="menuTop" href="<{$xoops_url}>/user.php"><{$block.lang_youraccount}></a>
<a href="<{$xoops_url}>/edituser.php"><{$block.lang_editaccount}></a>
<a href="<{$xoops_url}>/notifications.php"><{$block.lang_notifications}></a>
<a href="<{$xoops_url}>/user.php?op=logout"><{$block.lang_logout}></a>
<{if $block.new_messages > 0}>
<a class="highlight" href="<{$xoops_url}>/viewpmsg.php"><{$block.lang_inbox}> (<span style="color:#ff0000; font-weight: bold;"><{$block.new_messages}></span>)</a>
<{else}>
<a href="<{$xoops_url}>/viewpmsg.php"><{$block.lang_inbox}></a>
<{/if}>
<{if $xoops_isadmin}>
<a href="<{$xoops_url}>/admin.php"><{$block.lang_adminmenu}></a>
<{/if}>
</td>
</tr>
</table>
変更後:
<table cellspacing="0">
<tr>
<td id="usermenu">
<a class="menuTop" href="<{$xoops_url}>/user.php"><{$block.lang_youraccount}></a>
<a href="<{$xoops_url}>/edituser.php"><{$block.lang_editaccount}></a>
<a href="<{$xoops_url}>/notifications.php"><{$block.lang_notifications}></a>
<a href="<{$xoops_url}>/user.php?op=logout"><{$block.lang_logout}></a>
<{if $block.new_messages > 0}>
<a class="highlight" href="<{$xoops_url}>/viewpmsg.php"><{$block.lang_inbox}> (<span style="color:#ff0000; font-weight: bold;"><{$block.new_messages}></span>)</a>
<{else}>
<a href="<{$xoops_url}>/viewpmsg.php"><{$block.lang_inbox}></a>
<{/if}>
<a href="<{$xoops_url}>/modules/pukiwiki/?user/<{$xoops_uname}>">自由帳</a>
<a href="<{$xoops_url}>/modules/pukiwiki/?blog/<{$xoops_uname}>">ブログ</a>
<{if $xoops_isadmin}>
<a href="<{$xoops_url}>/admin.php"><{$block.lang_adminmenu}></a>
<{/if}>
</td>
</tr>
</table>
※日本語を書く場合は、文字コードをEUCで保存。

メインメニューの項目を変更する
↑
変更後:
<table cellspacing="0">
<tr>
<td id="mainmenu">
<a class="menuTop" href="<{$xoops_url}>/"><{$block.lang_home}></a>
<a class="menuSub" href="<{$xoops_url}>/modules/pukiwiki/187.html">はじめに</a>
<a class="menuMain" href="<{$xoops_url}>/modules/pukiwiki/56.html">SFCエミュレータ</a>
<a class="menuSub" href="<{$xoops_url}>/modules/pukiwiki/334.html">Snes9k</a>
<a class="menuSub" href="<{$xoops_url}>/modules/pukiwiki/52.html">Snes9x</a>
<a class="menuSub" href="<{$xoops_url}>/modules/pukiwiki/53.html">Snes9xpp SE'</a>
<a class="menuSub" href="<{$xoops_url}>/modules/pukiwiki/51.html">SENSGT</a>
<a class="menuSub" href="<{$xoops_url}>/modules/pukiwiki/333.html">SuperSleuth</a>
<a class="menuSub" href="<{$xoops_url}>/modules/pukiwiki/54.html">ZSNES</a>
<a class="menuMain" href="<{$xoops_url}>/modules/pukiwiki/122.html">関連ツール</a>
<a class="menuMain" href="<{$xoops_url}>/modules/pukiwiki/241.html">用語</a>
<a class="menuMain" href="<{$xoops_url}>/modules/pukiwiki/109.html">ゲームタイトル</a>
<a class="menuMain" href="<{$xoops_url}>/modules/pukiwiki/133.html">質問箱</a>
<a class="menuMain" href="<{$xoops_url}>/modules/newbb/">会議室</a>
<a class="menuMain" href="<{$xoops_url}>/modules/mailbbs/">写メールBBS</a>
</td>
</tr>
</table>
※日本語を書く場合は、文字コードをEUCで保存
※変更後にシステムのアップデートが必要

PukiWiki/PukiWikiMod
↑

ブラウザに表示されるタイトル<title>を変更する
↑
変更前:
// <title>にページ名をプラス
$xoops_pagetitle = $xoopsModule->name();
$xoops_pagetitle = $title."-".$xoops_pagetitle;
if ($h_excerpt) $xoops_pagetitle = $h_excerpt."-".$xoops_pagetitle;
変更後:
// <title>にページ名をプラス
$xoops_pagetitle = $xoopsModule->name();
$xoops_pagetitle = $xoops_pagetitle."/".$title;
if ($h_excerpt) $xoops_pagetitle = "[".$xoops_pagetitle."] ".$h_excerpt;

「タイムスタンプを変更しない」を常に有効にする
↑
変更前:
// タイムスタンプ
$timestamp_tag = ($X_admin || (($X_uid == $author_uid) && $X_uid))?
'<input type="checkbox" id="notimestamp" name="notimestamp" value="true"'.$notimestamp_enable.' /><label for="notimestamp"><span style="small">'.$_btn_notchangetimestamp.'</span></label>'
:'';
変更後:
// タイムスタンプ
$timestamp_tag = ($X_admin || (($X_uid == $author_uid) && $X_uid))?
'<input type="checkbox" id="notimestamp" name="notimestamp" value="true"'.$notimestamp_enable.' checked /><label for="notimestamp"><span style="small">'.$_btn_notchangetimestamp.'</span></label>'
:'';

showrssプラグインをリスト表示しない
↑
変更後:
class ShowRSS_html_menubar extends ShowRSS_html
{
var $class = ' class="wiki_showrss"';
function format_link($link)
{
return "$link<br />\n";
}
function format_body($str)
{
return "$str\n";
}
}

新着表示タグの文字列を変更する
↑
変更後:
// 経過秒数 => 新着表示タグ
$messages = array(
'_plugin_new_elapses' => array(
1*60*60*24 => ' <span class="new1" title="%s">UP</span>',
5*60*60*24 => ' <span class="new5" title="%s">UP</span>',
),
);
set_plugin_messages($messages);

上部や下部に表示されるメニューやアイコンメニューを編集したい
↑
http://pukiwiki.org/index.php?%E8%B3%AA%E5%95%8F%E7%AE%B1%2F391

ISBNプラグインのAmazonアソシエイトIDを変更する
↑
対象ファイル → XOOPSルート/modules/pukiwiki/plugin/isbn.inc.php
hypweb-22の部分をあなたのAmazonアソシエイトIDに変更するだけ。
変更前:
// AmazonアソシエイトID
if (!defined('AMAZON_ASE_ID')) define('AMAZON_ASE_ID','hypweb-22');
変更後:
// AmazonアソシエイトID
if (!defined('AMAZON_ASE_ID')) define('AMAZON_ASE_ID','outoforg0f-22');

人気の?件を表示しないようにする
↑
変更前:
'_popular_plugin_frame' => '<h5 class="side_label">人気の%d件%s</h5><div>%s</div>',
'_popular_plugin_today_frame' => '<h5 class="side_label" >今日のTOP%d%s</h5><div>%s</div>',
変更後:
'_popular_plugin_frame' => '<!-- <h5 class="side_label">人気の%d件%s</h5> --><div>%s</div>',
'_popular_plugin_today_frame' => '<!-- <h5 class="side_label" >今日のTOP%d%s</h5> --><div>%s</div>',

リスト(li)が表示される位置を変更する
↑
XOOPSルート/modules/pukiwiki/pukiwiki.ini.php
変更前:
/////////////////////////////////////////////////
// リスト構造の左マージン
$_list_left_margin = 10; // リストと画面左端との間隔(px)
$_list_margin = 8; // リストの階層間の間隔(px)
$_list_pad_str = ' class="list%d" style="padding-left:%dpx;margin-left:%dpx"';
変更後:
/////////////////////////////////////////////////
// リスト構造の左マージン
$_list_left_margin = 0; // リストと画面左端との間隔(px)
$_list_margin = 8; // リストの階層間の間隔(px)
$_list_pad_str = ' class="list%d" style="padding-left:%dpx;margin-left:%dpx"';

WikiNameを無効にする
↑
日本語環境ではあまり意味がないと思われる、WikiNameを無効にします。
XOOPSルート/modules/pukiwiki/pukiwiki.ini.php
変更前:
// WikiNameを*無効に*する
$nowikiname = 0;
変更後:
// WikiNameを*無効に*する
$nowikiname = 1;

PukiWiki内でコードを書く方法
↑
と書くと
となります。
コメントと違い、行が長すぎて表示しきれない場合は
内部でスクロールバーが表示されるので、レイアウトが崩れる心配がないので便利です。

変数
↑
$3とPukiWiki内に記述しておくと、ページ作成時にページ名に置き換えられます。
テンプレートページを作る時に知っておくと結構便利。

最新情報/BopComments
↑

header.phpの2行目でWarningが発生する
↑
http://finalgear.s33.xrea.com:8080/xoops/modules/newbb/viewtopic.php?topic_id=218&forum=26
対象ファイル → XOOPSルート/modules/BopComments/header.php
修正前:
include_once ("../../mainfile.php");
修正後:
$includePathName = realpath( dirname( __FILE__) );
require_once ($includePathName."/../../mainfile.php");

ブロック表示の微調整
↑
対象ファイル → XOOPSルート/modules/BopComments/templates/BopComments_Content_full.html
修正前:
<a href="<{$topic.modulelink}>"><img src="<{$topic.moduleimg}>" align="absmiddle"></a>
修正後:
<a href="<{$topic.modulelink}>"><img src="<{$topic.moduleimg}>" align="absmiddle"></a><br />

プラグイン
↑

BluesBB/bluesbb
↑

お知らせメールにIPアドレスとUser Agentを追加する
↑
変更前:
$m_message .= $myts->stripSlashesGPC($myts->htmlSpecialChars($input_message))."\n\n";
変更後:
$m_message .= $myts->stripSlashesGPC($myts->htmlSpecialChars($input_message))."\n\n";
$m_message .= "[".$_SERVER['REMOTE_ADDR']."]\n";
$m_message .= "[".$_SERVER['HTTP_USER_AGENT']."]\n";

ヘッドライン/xoopsheadline
↑

ヘッドラインブロックから一発でリンク先に移動する
↑
ヘッドラインブロックからヘッドラインに移動してしまうのが面倒な方へ。
XOOPSルート/modules/xoopsheadline/blocks/headline_block.html
変更前:
<li><a href="<{$xoops_url}>/modules/xoopsheadline/index.php?id=<{$site_id}>#<{$items[i].link}>"><{$items[i].title}></a></li>
変更後:
<li><a href="<{$items[i].link}>" target="_blank"><{$items[i].title}></a></li>