CentOS-XOOPS作業

Last-modified: 2005-09-13 (火) 16:52:44 (6799d)
※※このサイトは2012年頃より更新を停止しています。※※

(旧)仕事場Linux作業

仕事場のcommunityサイト作成に使用しているのがCentOS(2004-12〜2006-07)。
仕事場の環境での作業をそのままインターネットへオープンにするわけにもいきません(現場固有の名称などあるので)。
そこで、仕事場作業に際して自学自習で経験したノウハウにちょいとフィルタをかけて、自分用のメモを残していきます。

これはあくまで自分用のメモなので、参考にされる際にはいかなる操作/作業も自己責任で行ってください。

作業履歴まるなげリスト

とりあえず、整理もせずごっそり掲載。
CentOSを使う前の環境がredhat8だったので、最初のあたりはその情報が書かれています。

作業履歴/2005-06-03

仕事場redhat8 ポリシー変更

元々その端末で動作していたOSはredhat8だった。

  • phpのコンパイルインストール
    ※参考:
    http://www.dolphy.gr.jp/webap/env/php-install.html
    http://www.jpring.net/jitaku/redhat9+apache2.0.48+php-4.3.4-ok.html
    http://64.233.167.104/search?q=cache:wVwVxQvzjgsJ:49uper.com/memo/linux/php_configure.html+php+enable+cgi+configure&hl=ja&lr=lang_ja
    • 既存のphp関連のrpmパッケージをアンインストール
      RH8デフォrpmはマルチバイト関連が有効になってないため。
      rpm -e php-4.2.2-8.0.5.i386.rpm
      rpm -e php-imap-4.2.2-8.0.5.i386.rpm
      rpm -e php-ldap-4.2.2-8.0.5.i386.rpm
    • httpd-develをインストール
      依存関係解消の為、下記もインストール
      autoconf
      automake
      libtools
    • コンパイル環境も入ってなかった・・・
      ※参考 https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=76061
      RH8は開発環境のkernelheaderのパッケージ分類がちょいと特殊。
      下記をインストール
      binutils
      glibc-kernheaders
      glibc-devel
      gcc
    • php-4.3.11.tar.bz2を持ってきて展開、configure
      ./configure --with-apxs2filter=/usr/sbin/apxs \
      --with-gd --enable-gd-native-ttf \
      --with-freetype-dir=/usr --with-png-dir=/usr \
      --with-zlib --with-zlib-dir=/usr \
      --with-jpeg-dir=/usr --enable-exif \
      --enable-mbstring --enable-mbregex \
      --enable-zend-multibyte --with-pgsql=/usr \
      --with-mysql=/usr > ../php_configure.txt
      ここで、
      lex: command not found (※参考 http://ns1.php.gr.jp/pipermail/php-users/2001-September/001761.html)
       Cannot find libz
      libjpeg.(a|so) not found.
      libpng.(a|so) not found.
      freetype2 not found!
      と言われた・・・。
      それにこれも。
      configure: warning: You will need bison if you want to regenerate the PHP parsers.
      configure: warning: You will need bison if you want to regenerate the Zend parser.
      というわけで、
      flex
      zlib-devel
      libjpeg-devel
      libpng-devel
      freetype-devel
      bison
      をインストールで上記は解決。
      でもやっぱこいつは発生。
      ./configure: line 1: /apr-config: No such file or directory
      ./configure: line 1: /apu-config: No such file or directory
      こいつはもうメンドイのでそのままmake; install;
      したら
      /usr/lib/httpd/build/instdso.sh: そのようなファイルやディレクトリはありません
      とかゆわれるし・・・。
      http://slashdot.jp/journal.pl?op=display&id=107852&uid=6751
      ここらへんを参考にinstdso.shをhttpd-2.0.53.tar.bz2から持ってきてinstall。
    • だがしかし。
      CGI版をインストールするには、with-apxsしちゃいけないそうな。
      ※参考:http://php.s3.to/man/features.commandline.html
      というわけで、--with-apxs2filterを外して再コンパイル。
      DSO版は既にインストール済みなので、コンパイルの済んだcgi版と
      cli版をそれぞれリネームしながらインストール。
  • httpd.conf
    • AddHandlerを有効にした。
      これと、
      <Directory "/home/*/public_html/cgi-bin">
      Options ExecCGI
      </Directory>
      により、各ユーザはcgi-bin/配下のみでcgiの実行が可能。
    • DirectoryIndexにindex.cgiとindex.phpを追加。
    • LanguagePriorityの先頭にjaを持ってきた。
    • AddType application/x-httpd-php .php を加えた。
  • 動作確認
    • 以上でPHPのCGIもDSOも動作確認済み。

作業履歴/2005-06-07

  • ちょいと気になったツール : QuestionLabor
     http://itpro.nikkeibp.co.jp/free/ITPro/NEWS/20050607/162211/ ※情報ソース
     http://www.labor-project.com/ ※プロジェクトURL
    今度これも試しに入れてみよう。
    必要な追加パッケージ等
    MONSTUQI  (←めんどくさそう
    Ruby 
    PostgreSQL 
    仮にこれらを使うとしたら。
    データの移行は可能か?
    MSaccessとかのmdbファイルからphpで内容をクエリ抽出ってできたっけ?
  • xoops設置準備
    MySQLが必要ってことなので、phpもコンパイルし直そうかな。
    併せて、上記で触れているQuestionLaborの準備もかねてPostgreSQLも入れておく。
    phpコンパイルの準備としてdevelパッケージも入れておく。
    perlからも使えるようにperl-DB*も必要な分入れておく。
    よって下記パッケージ群をインストール
    • postgresql-perl-7.2.2-1.i386.rpm
    • postgresql-server-7.2.2-1.i386.rpm
    • postgresql-devel-7.2.2-1.i386.rpm
    • postgresql-7.2.2-1.i386.rpm
    • perl-DBD-Pg-1.13-5.i386.rpm
    • perl-DBD-MySQL-2.1017-3.i386.rpm
    • mysql-server-3.23.52-3.i386.rpm
    • mysql-devel-3.23.52-3.i386.rpm
    • mysql-3.23.52-3.i386.rpm
    • postgresql-libs-7.2.2-1.i386.rpm
    • perl-DBI-1.30-1.i386.rpm

  • phpのDSO版、CLI版、CGI版、全部再インストール完了。

作業履歴/2005-06-08

  • pukiwikiのCGI版動作はやはり挙動がおかしい
    うちでやった時と同じように、MenuBarの更新がなぜか反映されない。
    しゃーないのでDSO版php上で動かすことを基本にしよう。
  • MySQLの初期化
     http://www.foocrane.jp/WAPS3/chapter06/section12.html
     http://www.bitscope.co.jp/tep/MySQL/quickMySQL.html
    MySQLのrootのpasswordを設定しよう。
    サーバ起動時にサービス自動起動登録
    # chkconfig --level 345 mysql on
    明日の夜勤でxoops入れたろー。
    できれば一気にQuestionLaborも。 ←(こいつぁちょいと楽しみ
    ほいで全部まとめて挙動テスト。

作業履歴/2005-06-10 (redhat8)

  • MySQL xoops用ユーザ、データベース追加
    mysql> create database DBname;
    mysql> grant all privileges on DBname.* to username@localhost
        -> identified by 'password';
  • xoops インストール完了
    インストール時に設定する項目
    • 管理者名
    • パスワード
    • mailaddress
  • QuestionLabor - 失敗履歴
    06/10 4:00AM現在、Laborシリーズ配布一時停止中。
    RubyとMonstuqiのインストールだけ済ませておこうかな。
    ということで、まずは下記rubyパッケージ(rpm)をインストール。
    ruby-libs
    ruby
    ruby-docs
    Monstuqiのパッケージ群をtarballからインストール
    libfixed-current.tar.gz
    libmondai-1.2.0-031210.tar.gz
    libglade-panda-current.tar.gz
    gtk+panda-current.tar.gz
    panda-1.2.0-031210.tar.gz
    gw-20031210.tar.gz  ※Monstuqiのサンプルプログラム
    これらをコンパイルする為に、下記の開発系パッケージ(rpm)が必要
    gtk+-devel-1.2.10-22.i386.rpm	(←こっからgtk+pandaのconfigureで
    ORBit-devel-0.5.13-5.i386.rpm
    imlib-devel-1.9.13-9.i386.rpm
    esound-devel-0.2.28-1.i386.rpm
    gnome-libs-devel-1.4.1.2.90-22.i386.rpm
    XFree86-devel-4.2.0-72.i386.rpm
    indent-2.2.8-3.i386.rpm
    glib-devel-1.2.10-8.i386.rpm
    libtiff-devel-3.5.7-7.i386.rpm
    libungif-devel-4.1.0-13.i386.rpm
    audiofile-devel-0.2.3-3.i386.rpm
    pkgconfig-0.12.0-3.i386.rpm
    libghttp-devel-1.0.9-5.i386.rpm	(←たぶんlibfixedあたりのconfigureで
    libxml-devel-1.8.17-5.i386.rpm	(←libglade-pandaのconfigureで
    libxml2-devel-2.4.23-1.i386.rpm	(←libglade-pandaのconfigureで
    そしてそれぞれ下記繰り返し
    $ ./configure; make; make check;
    $ su
    # make install
    
    しかし、pandaのmake中に下記エラーでコケる。
    ./enum: error while loading shared libraries: libglade-panda-gnome.so.0: 
    cannot open shared object file: No such file or directory
    原因は/usr/local/lib がldconfigの対象になっていなかったこと。
    ※参考: http://www.atmarkit.co.jp/flinux/rensai/linuxtips/300sharelib.html
    # vi /etc/ld.so.config
         に/usr/local/libを追記
    # ldconfig
    してからmakeしたら、コンパイル完了!長かった(´Д`)
  • FSwiki
    • bbs2,bbs2list プラグインの動作確認
      上等。
    • calender,recentcalender プラグインの動作確認
      セクションの部分表示がうまくいかない。
      brプラグインを導入(本家プラグイン投稿ページから持ってくる)

作業履歴/2005-06-14

pukiwiki

  • pukiwikiのスキンに機能追加
    上部のリンクに「ソース」を追加し、sourceコマンドで表示中のページのHTML整形前のテキスト生データを出力するようにした。
    以下、変更箇所
    • lib/html.php
      61行目付近 - 追加:$_LINK['source']   = "$script?cmd=source&amp;page=$r_page";
      86行目付近 - 追加:$link_source    = & $_LINK['source'];
    • skin/pukiwiki.skin.php
      114行目付近 - 追加: <?php _navigator('source') ?> |
    • ja.lng.php
      131行目付近 - 追加:$_LANG['skin']['source']    = 'ソース'; // HTML整形前テキスト表示

作業履歴/2005-06-15

vsftpdの設定

  • ls_recurse_enable
    ※参考:http://sakaguch.com/PastBBS/0024/B0012531.html
    ls_recurse_enable=YES
    こいつを有効にしたので、FFFTPでいうミラーリングアップ/ダウンロードや、ディレクトリの丸ごとコピー/削除可能になりました。

作業履歴/2005-06-20

ネットワーク設定

作業履歴/2005-06-21

作業履歴/2005-06-22

postgreSQLのユーザ準備

作業履歴/2005-06-24

XOOPSとpukiwiki

  • 連動したサイトがあるね
    参考:http://taketan.mydns.jp/xoops/
    XOOPSとpukiwikiを連動させて記事編集ができるよう。XOOPSのモジュールとしてwikiを組み込むみたい。今度これ試してみよう。
    コミュニティページとしちゃ最適な組み合わせだと思えるけど、セッティングするの大変そう。。。

pukiwiki - calendar_viewerで表示される記事の設定

  • plugin/calendar_viewer
    記事タイトル表示がh1でなされているので、h2にした。
    171行目                 $head   = '<h2>' . $link . '</h2>' . "\n";
  • skin/pukiwiki.css.php
    75行目ぐらいから
    • h1とh2を分ける。
    • paddingの数値を減らす。
    • h2、h3のmarginを変更する。

  • plugin/article.inc.php
    articleプラグインで簡易掲示板を設置するに当たり、articleプラグインに下記の修正を加えた。
    34行目 define('PLUGIN_ARTICLE_AUTO_BR',        0); // 改行を自動的変換 1:する 0        :しない
    61行目         $article  = $subject . "\n" . '>' . $name . ' (' . $now . ')'. "        ~\n";

作業履歴/2005-06-27

Xoopsとpukiwikiモジュール

  • pukiwikiモジュールを追加
    Xoopsの日本語サイトのモジュールページにてwikiモジュールの紹介があります。
    そこにあるB-wikiというモジュールは、Built in pukiwikiの略で、pukiwikiをXoops内部に取り込む為のモジュール。
    これを使えばかなりコミュニティページとしての機能が揃いそう。
    開発者のページのアナウンスによると本家pukiwikiの1.4.5に対応しているとのこと。
    pukiwikiは1.4.2-->1.4.3以降で仕様に大きな変更がかかっているので、1.4.5対応でよかった。
    でもかなりコードに手を加えてるらしいので、本家版とは別物と考えた方がいいよう。
    プラグインに関しても、本家版のままでは動かないものも一部あるかもしれないとのこと。

    でも実際インストールしてみた感じ、かなり使い勝手良くなりそう。
    Xoops+B-wikiでサイト作りこんでいいと思われる。

  • やった作業
    1. B-wikiモジュールを、開発サイトの説明に従ってxoopsにインストール。
    2. 各種設定&bwikiをxoopsのトップページになるようにブロック設定。
    3. kifubbsの各種ファイルをbwikiのpluginに追加。
    4. kifubbsのスタイルシートをbwikiのskin/pukiwiki.css.phpに追記。

  • やり残しの作業
    • kifubbsの投稿フォームを下部に移動しよう。
      そしてそれに伴う配置調整。

作業履歴/2005-06-29

xoops B-wiki

  • skin/pukiwiki.css.phpに下記修正
    [user@localhost dir]$ diff original/pukiwiki.css.php xoopsdir/modules/bwiki/skin/pukiwiki.css.php
    98,104c98,112
    < h1, h2 {
    <       font-family:verdana, arial, helvetica, Sans-Serif;
    <       color:inherit;
    <       background-color:#DDEEFF;
    <       padding:.3em;
    <       border:0px;
    <       margin:0px 0px .5em 0px;
    ---
    > h1 {
    >         font-family:verdana, arial, helvetica, Sans-Serif;
    >         color:inherit;
    >         background-color:#DDEEFF;
    >         padding:.3em;
    >         border:0px;
    >         margin:0px 0px .5em 0px;
    > }
    > h2 {
    >         font-family:verdana, arial, helvetica, Sans-Serif;
    >         color:inherit;
    >         background-color:#DDEEFF;
    >         padding:.2em;
    >         border:0px;
    >         margin:0px 0px .5em 0px;
    107,116c115,124
    <       font-family:verdana, arial, helvetica, Sans-Serif;
    <       border-bottom:  3px solid #DDEEFF;
    <       border-top:     1px solid #DDEEFF;
    <       border-left:   10px solid #DDEEFF;
    <       border-right:   5px solid #DDEEFF;
    <
    <       color:inherit;
    <       background-color:#FFFFFF;
    <       padding:.3em;
    <       margin:0px 0px .5em 0px;
    ---
    >         font-family:verdana, arial, helvetica, Sans-Serif;
    >         border-bottom:  2px solid #DDEEFF;
    >         border-top:     0px solid #DDEEFF;
    >         border-left:   10px solid #DDEEFF;
    >         border-right:   0px solid #DDEEFF;
    >
    >         color:inherit;
    >         background-color:#FFFFFF;
    >         padding:.1em;
    >         margin:0px 0px .5em 0px;
    119,120c127,128
    <       font-family:verdana, arial, helvetica, Sans-Serif;
    <       border-left:   18px solid #DDEEFF;
    ---
    >         font-family:verdana, arial, helvetica, Sans-Serif;
    >         border-left:   18px solid #DDEEFF;
    122,125c130,133
    <       color:inherit;
    <       background-color:#FFFFFF;
    <       padding:.3em;
    <       margin:0px 0px .5em 0px;
    ---
    >         color:inherit;
    >         background-color:#FFFFFF;
    >         padding:.2em;
    >         margin:0px 0px .5em 0px;
    128,133c136,141
    <       font-family:verdana, arial, helvetica, Sans-Serif;
    <       color:inherit;
    <       background-color:#DDEEFF;
    <       padding:.3em;
    <       border:0px;
    <       margin:0px 0px .5em 0px;
    ---
    >         font-family:verdana, arial, helvetica, Sans-Serif;
    >         color:inherit;
    >         background-color:#DDEEFF;
    >         padding:.2em;
    >         border:0px;
    >         margin:0px 0px .5em 0px;
    675a684,895
    > /*
    >  * ここからkifubbs用の設定
    >  */
    >
    > div.kifubbs form.post div.postform{
    >       clear: both;
    >       margin: 15px 50px 0px 50px;
    >       padding: 8px;
    >       text-align: right;
    >       font-size: smaller;
    > }
    >
    > div.kifubbs form.post div.postform span.postform_attension
    > {
    >       color: #FF99BE;
    > }
    >
    > div.kifubbs form.post div.postform script span.message
    > {
    > }
    >
    > div.kifubbs hr
    > {
    >       display: none;
    > }
    >
    > div.kifubbs div.column
    > {
    >       clear: both;
    >       margin: 30px 50px 0px 50px;
    >       padding: 15px 30px;
    >       border-style: solid;
    >       border-color: #cccccc;
    >       border-width: 1px;
    >       background-color: white;
    > }
    >
    > div.kifubbs div.withgoban
    > {
    >       height: 440px;
    > }
    >
    > div.kifubbs div.column h2
    > {
    >       margin-right: 1em;
    >       background-color: transparent;
    >       font-size: smaller;
    >       font-weight: bolder;
    >       display: inline;
    > }
    >
    > div.kifubbs div.column span.name,
    > div.kifubbs div.column span.mail,
    > div.kifubbs div.column span.url,
    > div.kifubbs div.column span.number,
    > div.kifubbs div.column span.timestamp,
    > div.kifubbs div.column span.res,
    > div.kifubbs div.column span.ipaddress{
    >       font-size: smaller;
    > }
    >
    > div.kifubbs p.goban{
    >       margin: 15px 0px 15px 8px;
    >       padding: 0px;
    >       background-color: white;
    >       float: right;
    >       width: 310px;
    > }
    >
    > div.kifubbs p.goban span.warning{
    >       color: #FF99BE;
    > }
    >
    > div.kifubbs div.column p.text
    > {
    > }
    >
    > div.kifubbs div.column div.subcolumn
    > {
    >       margin: 15px 0px 0px 50px;
    >       padding: 15px 0px 0px 0px;
    >       border-style: solid;
    >       border-color: #cccccc;
    >       border-width: 1px 0px 0px 0px;
    > }
    >
    > div.kifubbs div.column div.withgoban
    > {
    >       clear: both;
    >       height: 410px;
    > }
    >
    > div.kifubbs div.column div.subcolumn span.name,
    > div.kifubbs div.column div.subcolumn span.mail,
    > div.kifubbs div.column div.subcolumn span.url,
    > div.kifubbs div.column div.subcolumn span.number,
    > div.kifubbs div.column div.subcolumn span.timestamp,
    > div.kifubbs div.column div.subcolumn span.res,
    > div.kifubbs div.column div.subcolumn span.ipaddress{
    > }
    >
    > div.kifubbs div.column div.subcolumn p.text
    > {
    > }
    >
    > div.kifubbs form.pagelist{
    >       clear: both;
    >       margin: 0px 0px 0px 0px;
    >       padding: 5px 0px 0px 5px;
    >       border-style: solid;
    >       border-color: #cccccc;
    >       border-width: 0px;
    >       background-color: #efefff;
    >       text-align: right;
    > }
    >
    > div.kifubbs form.searchform{
    >       clear: both;
    >       margin: 15px 50px 0px 50px;
    >       padding: 15px 30px;
    >       border-style: solid;
    >       border-color: #cccccc;
    >       border-width: 1px;
    >       background-color: white;
    >       text-align: right;
    >       font-size: smaller;
    > }
    >
    > div.kifubbs form.pagelist div.pagelist,
    > div.kifubbs form.searchform p.searchform{
    >       display: inline;
    >       margin: 0px 0px 0px 0px;
    >       padding: 0px;
    >       font-size: smaller;
    > }
    >
    > div.kifubbs form.command div.commandform{
    >       clear: both;
    >       margin: 0px 0px 0px 0px;
    >       padding: 0px 5px 5px 0px;
    >       border-style: solid;
    >       border-color: #cccccc;
    >       border-width: 0px;
    >       background-color: #efffef;
    >       text-align: right;
    >       font-size: smaller;
    > }
    >
    > div.kifubbs p.message{
    >       margin: 15px 50px 0px 50px;
    >       padding: 8px;
    >       border-style: solid;
    >       border-color: #cccccc;
    >       border-width: 1px;
    >       background-color: white;
    >       font-size: smaller;
    >       color: #666666;
    > }
    >
    > div.kifubbs p.warning{
    >       margin: 15px 50px 0px 50px;
    >       padding: 8px;
    >       border-style: solid;
    >       border-color: #cccccc;
    >       border-width: 1px;
    >       background-color: white;
    >       font-size: smaller;
    >       color: #FF99BE;
    > }
    >
    > div.kifubbs ol.threadlist{
    >       margin: 15px 50px 0px 50px;
    >       padding: 8px;
    >       border-style: solid;
    >       border-color: #cccccc;
    >       border-width: 1px;
    >       background-color: white;
    >       font-size: smaller;
    > }
    >
    > div.kifubbs ol.threadlist li{
    >       display: inline;
    >       margin-right: 1em;
    > }
    >
    > div.kifubbs ol.allthreadlist,
    > div.kifubbs ul.searchlist{
    >       margin: 15px 50px 0px 50px;
    >       padding: 8px;
    >       border-style: solid;
    >       border-color: #cccccc;
    >       border-width: 1px;
    >       background-color: white;
    >       padding: 15px 30px 15px 50px;
    > }
    >
    > h2.new_post{
    >       text-align:center;
    >       background-color:#dfffdf;
    > }
    >
    > div.bbs_thread_title{
    >       background-color:#dddddd;
    >       padding:2px 2px 2px 2px;
    >       margin-bottom:3px;
    > }
    >
    > /*
    >  * kifubbs ここまで
    >  * これだけが全てではないが、これだけあればほとんどのことができるはず。
    >  */
    >
  • skin/pukiwiki.skin.phpに修正
    [user@localhost dir]$ diff original/pukiwiki.skin.php xoopsdir/modules/bwiki/skin/pukiwiki.skin.php
    96a97,98
    > <!--
    >
    159a162,163
    > -->
    >
  • plugin/kifubbs/display.inc.phpに下記修正
    [user@localhost dir]$ diff original/plugin/kifubbs/display.inc.php.ORG xoopsdir/modules/bwiki/plugin/kifubbs/display.inc.php
    71c71,74
    <               $ret  = $this->get_warning();
    ---
    >               $ret = $this->newpost_anchor();
    >               $ret .= $this->get_pagelist();
    >               $ret .= $this->get_commandform();
    >               $ret .= $this->get_warning();
    76d78
    <               $ret .= $this->get_postform('new');
    78d79
    <               $ret .= $this->get_pagelist();
    80c81,82
    <               $ret .= $this->get_commandform();
    ---
    >               $ret .= $this->get_pagelist();
    >               $ret .= $this->get_postform('new');
    175a178,187
    >        * 新規投稿へのアンカーを表示
    >        */
    >       function newpost_anchor()
    >       {
    >               $str = '<a href="#bbs_new_post">新規投稿はここをクリック</a>' . "\n";
    >               return $str;
    >       }
    >
    >
    >       /**
    231d242
    <               $str[] = '<hr />';
    233c244
    <               $str[] = '<p class="pagelist">';
    ---
    >               $str[] = '<div class="pagelist">';
    236a248
    >                       $str[] = '&lt;&lt;&nbsp;ページ繰り&nbsp;&gt;&gt;';
    239c251
    <               $str[] = '<select name="kifubbs_page">';
    ---
    >               $str[] = '&nbsp;&nbsp;&nbsp;もしくは&nbsp;&nbsp;&nbsp;<select name="kifubbs_page">';
    242c254
    <                               $str[] = '<option selected="selected">' . $i . '</option>';
    ---
    >                               $str[] = '<option value="' . $i . '" selected="selected">' . $i . '</option>';
    249,250c261,262
    <               $str[] = '<input type="submit" name="kifubbs_command" value="Jump" />';
    <               $str[] = '</p>';
    ---
    >               $str[] = 'ページ目へ<input type="submit" name="kifubbs_command" value="Jump" />';
    >               $str[] = '</div>';
    263a276
    > /*
    276a290,291
    > */
    >               return;
    291d305
    <               $str[] = '<hr />';
    293c307
    <               $str[] = '<p class="commandform">';
    ---
    >               $str[] = '<div class="commandform">';
    295c309
    <               $str[] = 'number <input type="text" name="kifubbs_num" value="" size="6" />';
    ---
    >               $str[] = '記事番号 <input type="text" name="kifubbs_num" value="" size="6" />';
    297c311
    <                       $str[] = 'key <input type="password" name="kifubbs_key" value="' . $key . '" size="10" />';
    ---
    >                       $str[] = '再編集キー <input type="password" name="kifubbs_key" value="' . $key . '" size="10" />';
    300,301c314,315
    <               $str[] = '<option value="showrewrite" selected="selected">rewrite</option>';
    <               $str[] = '<option value="delete">delete</option>';
    ---
    >               $str[] = '<option value="showrewrite" selected="selected">記事編集</option>';
    >               $str[] = '<option value="delete">記事削除</option>';
    303,304c317,318
    <               $str[] = '<input type="submit" value="submit" />';
    <               $str[] = '</p>';
    ---
    >               $str[] = '<input type="submit" value="送信" />';
    >               $str[] = '</div>';
    477c491,494
    <
    ---
    >               if($cmd == 'new') {
    >                       $str[] = "<br />\n";
    >                       $str[] = "<h2 class=\"new_post\"><a name=\"bbs_new_post\">新規投稿フォーム</a></h2>\n";
    >               }
    489c506
    <               $str[] = 'password <input type="password" name="kifubbs_key" value="' . $key . '" maxlength="10" size="10" /><br />';
    ---
    >               $str[] = '再編集キー<input type="password" name="kifubbs_key" value="' . $key . '" maxlength="10" size="10" /><br />';
    494c511
    <               $str[] = '<input type="submit" value="submit" />';
    ---
    >               $str[] = '<input type="submit" value="投稿" />';
    544a562
    >                       $str[] = "<div class=\"bbs_thread_title\">\n";
    557c575,578
    <                       $str[] = '<span class="res"><input type="hidden" name="kifubbs_resto" value="' . $col->num . '" /><input type="hidden" name="kifubbs_command" value="showres" /><input type="submit" value="返信" /></span>';
    ---
    >                       $str[] = "</div>\n";
    >               }
    >               if($ismain){
    >                       $str[] = '<div class="res" align="right"><input type="hidden" name="kifubbs_resto" value="' . $col->num . '" /><input type="hidden" name="kifubbs_command" value="showres" /><input type="submit" value="このスレッドに返信" /></div>';
    630c651
    < ?>
    \ No newline at end of file
    ---
    > ?>

作業履歴/2005-06-30

redhat8

xoops

  • レイアウト修正
    • テーマをdefaultに。
    • modules/news/templates/blocks/news_block_new.htmlで、
      トップページのニュース表示を日付が頭に来るように編集。
      その後モジュールのアップデートをしないと反映されないらしい。
    • 下記の極悪な配色決め打ちのbgcolor属性を削除。
      templates_c/%%02^02D^02DF536F%%theme.html.php中の
      <td width="20%" bgcolor="#EFEFEF">
      ※ROOT/theme/配下を変更しても見栄えが変わらないのは、systemモジュールの設定でthemeに関する項目の影響があるかも。
      そこを「反映する」ようにしておけば即座に変更がtemplates_c/に反映されるんだはず。
    • 検索フォームの修正
      xoopsdir/modules/system/templates/blocks/system_block_search.html
      を編集。
    • Q&Aの頭に検索フォームを。
    • B-wikiのヘッドに新着告知事項を。
    • xoopsスタートは告知事項に。余計なモンは省いた。
  • B-wiki
    skin/pukiwiki.css.phpで、searchform・pagelist・commandformのdivスタイルは同じにした法がいいことに気づく(色だけ変える)
    また、plugin/kifubbs/display.inc.phpの中でcommandformがcommandになってる部分発見。

作業履歴/2005-07-04

gvim


この辺から、すでにCentOSだはず。


作業履歴/2005-07-11

CentOS各種設定

  • VNCserver
    参考:(googleキャッシュ) - http://u-mex.plala.jp/index2.php?%27%27vnc-server%A4%CE%C0%DF%C4%EA%27%27
    OSインストール直後のままユーザ作ってそのままvncserverコマンドやっちゃうと、twnでデスクトップが立ち上がってしまう。
    そこで上記URLを参考に、ユーザにスケルトンを用意しておくことにした。
    # switchdesk GNOME
    # mkdir /etc/skel/.vnc
    # cp /etc/X11/xinit/xinitrc /etc/skel/.vnc/
    これで、どのユーザでもvncserverコマンドを実行した時にはGNOMEデスクトップがVNCserverで起動される。
    あとは適切なディスプレイ番号にVNCclientでアクセスすればOK。

作業履歴/2005-07-20

CentOS

  • システムデフォルト文字コードと less と lv
    参考:http://www.jp.redhat.com/FAQ/index_support_2.html#17
    /etc/sysconfig/i18n
      LANG="ja_JP.eucJP"
      SUPPORTED="ja_JP.eucJP:ja_JP.UTF-8:ja_JP.SJIS:ja_JP:ja:en_US.UTF-8:en_US:en"
      SYSFONT="latarcyrheb-sun16"
    /etc/man.config
      # PAGER         /usr/bin/less -iRs
      PAGER           /usr/bin/lv -i
    と編集してeuc-jpをシステムデフォルト文字コードに。
    さらにlv-4.51-5.i386.rpmをferora core4のパッケージから持ってきてインストール。
    less をlvにシンボリックリンクしてしまえ。
    # mv /usr/bin/less /usr/bin/less.ORG
    # ln -s /usr/bin/lv /usr/bin/less

作業履歴/2005-07-22

CentOS

ちょいメモ

  • gvim
    プラグイン等の変数設定状況の確認は
    :let
    また、kaoriya版gvimには便利なコマンド
    CdCurren
    がある。(参考)
    カレントディレクトリを現在開いているファイルのあるところに移動するそうな。

  • gvim - IEのソース表示に別エディタを設定する
    参考:(googleキャッシュ) - http://www.atmarkit.co.jp/fwin2k/win2ktips/286iesourceview/iesourceview.html
    IEのソース表示にgvimを設定してみた。
     ・googleはUTF-8のようだが、ちゃんとコード変換して表示してくれた。
     ・pukiwiki.sourceforge.jpもUTF-8で変換表示に問題なし。
     ・FSwikiもeuc-jpで変換表示に問題なし。
     ・しかし。xoopsのソース表示のeuc-jpをちゃんと判別してくれない(ノД`)
    なんでや。

作業履歴/2005-07-26

xoops

  • Newsモジュールのテンプレート編集
    テンプレートに手を加えて、表示記事が無い場合にはその旨の文言を表示するように設定。
    • ''編集対象:news_index.html
       <!-- start news item loop -->
      +<{if $stories > 0}>
         <{section name=i loop=$stories}>
      〜
      〜
         <{/section}>
      +<{else}>
      +<div align="center" style="font-weight:900;font-size:15px;">■表示する記事がありません■</div>
      +<br />
      +<br />
      +<br />
      +<{/if}>
       <!-- end news item loop -->

作業履歴/2005-07-29

PHPスクリプト

  • ニュース記事の掲載内容プリントアウトのスクリプト
    装飾タグの解釈方法について、xoopsコードからパクってこれないか調べてみた。
    • まずはとっかかり
      $ find ./ -name "*.php" | xargs grep -n "xx-large"
      あたり出力結果から
      ./include/xoopscodes.php:42:    $sizearray = array("xx-small", "x-small", "small
      がクサイと思った。
      が、ここでは配列しか定義してなかったので、今度はsizearrayを使ってるファイルを探す。
      $ find ./ -name "*.php" | xargs grep -n "sizearray"
      が、これは見当違いだった。
    • 別の切り口
      でも「xoopscodes.php」はポイントになるキーワードだと考え、日本xoops公式サイトにて「xoopscode」で検索。
      フォーラムの「自作モジュールの中でXoopsのエディターを使いたい」というスレッドにてミソになってそうな関数「MyTextSanitizer()」を見つけた。
    • ビンゴ
      $ find ./ -name "*.php" | xargs grep -n "MyTextSanitizer"
      〜略〜
      ./class/module.textsanitizer.php:44:class MyTextSanitizer
      〜略〜
      で大当たりだった。
      この関数をパクって、装飾タグを変換するようにコーディングしてみよう。

作業履歴/2005-08-04

shift-jisで書かれたweb文書ディレクトリの全文検索について

  • namazuを使えるか?
    namazuを使って全文検索ができるかどうか。
    • CentOS版のnamazuパッケージ要確認。
    • namazuでの検索が複数文字コードに対応しているかどうか

  • Hyper Estraier
    この辺(googleキャッシュ)より、namazuはわりと古いとか
    そこでHyper Estraierってやつを試してみようかー?なんて思った。
    でもちょいと導入に一手間要りそう。configure通ったのにmakeで失敗しよったよ(ノД`)
    明日にでもやり直してみるか。

ちょいメモ

作業履歴/2005-08-05

全文検索について

  • Hyper Estraier
    コンパイル失敗するのは何かのライブラリが足りないからっぽい。
    slocateで見てみるとlibiconvがないでやんの。
    配布ミラー見てもCentOSのパッケージにlibiconvはないっぽい。
    そこでlibiconv1.9.1を http://www.gnu.org/software/libiconv/ から持って来てコンパイル/インストール。
    それからHyper Estraierを再コンパイル。
    おっけぃ通った(・∀・)b
    そして検索できた!!

作業履歴/2005-08-08

phpスクリプト

  • xoopsニュースモジュールの記事をのExcel出力
    参考:http://ns1.php.gr.jp/pipermail/php-users/2003-February/013654.html
    参考:(googleキャッシュ ) - http://www.fukulog.com/memo/2005-07-06-9.html
    参考:http://www.doyouphp.jp/sample/sample_ora_excel.shtml
    PEARにExcelファイルとして出力するようなclass(Spreadsheet_Excel_Writer)があるそうな。
    こいつに取り組んでみよう。
    • Spreadsheet_Excel_Writerのインストール
      PEARが入ってれば、PEARコマンドでインストールできる。
      依存性の解決の為にOLEってやつも併せてインストール。
      [root@localhost bin]# pear list
      Installed packages:
      ===================
      Package              Version State
      Archive_Tar          1.1     stable
      Console_Getopt       1.2     stable
      HTML_Template_IT     1.1     stable
      Net_UserAgent_Detect 2.0.1   stable
      PEAR                 1.3.5   stable
      XML_RPC              1.2.2   stable
      [root@localhost bin]# pear install /home/user/pack/tarball/Spreadsheet_Excel_Writer-0.8.tgz
      requires package `OLE' >= 0.5
      Spreadsheet_Excel_Writer: Dependencies failed
      [root@localhost bin]# pear install /home/user/pack/tarball/OLE-0.5.tgz
      install ok: OLE 0.5
      [root@localhost bin]# pear install /home/user/pack/tarball/Spreadsheet_Excel_Writer-0.8.tgz
      install ok: Spreadsheet_Excel_Writer 0.8
      [root@localhost bin]# pear install /home/user/pack/tarball/Spreadsheet_Excel_Writer-0.8.tgz
      Spreadsheet_Excel_Writer already installed
  • csv出力
    とりあえず、やったことがあるからラクチンっていうことで、Excelファイル出力よりも先にcsv形式での出力を実装。
    こんなんなった。
    <?php
    
    // 全体用変数定義
    	$site_IP = "x.x.x.x";
    	$site_URL = "http://$site_IP/group/";
    
    	$mode = $_REQUEST['mode'];
    
    //////////////////////////////////////////////
    // スクリプト本体
    
    	$xoopsDB = mysql_connect("localhost","dbuser","xoops_DB") or die("接続できませんでした");
    	mysql_select_db("DBname") or die("データベースを選択できませんでした");
    
    	// 登録ユーザ配列準備
    	$result =  mysql_query("select * from group_users");
    	while ( $line = mysql_fetch_array($result, MYSQL_ASSOC) ){
    		$num = $line[uid];
    		$user[$num] = $line[name];
    	}
    
    	// story配列から必要データを抽出
    	$result =  mysql_query("select * from group_stories order by published");
    	while ( $line = mysql_fetch_array($result, MYSQL_ASSOC) ){
    		// print_r($line);
    		$story_data[] = layout_table_data($line,$user,$mode);
    	}
    
    	mysql_close($xoopsDB);
    
    	// データをアウトプット(モードによって振り分け)
    	// mode : "csv", "default"
    	switch ( $mode ){
    	case "csv":
    		array_push($story_data,mb_convert_encoding("連絡開始日,連絡終了日,記述者,連絡事項\n", "SJIS-WIN", "EUC-JP"));
    		$story_data = array_reverse($story_data);
    		$filename = date("Ymd_His")."morning.csv";
    		header("Content-disposition: attachment; filename=$filename");	
    		header("Content-Type: application/octet-stream; name=$filename");
    		foreach($story_data as $tmp){
    			echo $tmp;
    		}
    		break;
    	default:
    		array_push($story_data,layout_table_title());
    		$story_data = array_reverse($story_data);
    		header("Content-Type: text/html;charset:EUC-JP");
    		echo header_output($site_URL);
    
    		foreach($story_data as $tmp){
    			echo $tmp;
    		}
    		echo footer_output();
    	}
    
    
    
    //////////////////////////////////////////////
    //////////////////////////////////////////////
    // レイアウト用記述部分
    
    //////////////////////////////////////////////
    // ヘッダ〜ボディを生成
    
    	function header_output($site_URL){
    		$str = <<<HTML_END
    <html>
    <head>
    <title>あるニュース記事</title>
    <link rel="stylesheet" type="text/css" media="screen,print" href="./print_out.css" />
    </head>
    <body>
    [<a href="$site_URL">groupページへ戻る</a>]
    <h1 class="morning_title" align="center">ニュース記事</h1>
    <table border="0" cellpadding="0" cellspacing="0">
    
    HTML_END;
    		return $str;
    	}
    
    
    //////////////////////////////////////////////
    // テーブル・ボディ・HTML閉じ
    
    	function footer_output(){
    		$str = <<<HTML_END
    
    </table>
    </body>
    </html>
    HTML_END;
    		return $str;
    	}
    
    //////////////////////////////////////////////
    // テーブルの項目タイトル部分
    
    	function layout_table_title(){
    		$str = <<<HTML_END
    
    	<tr class="tr_terms">
    		<th align="center" width="50">開始日</th>
    		<th align="center" width="50">終了日</th>
    		<th align="center" width="80">記述者</th>
    		<th align="center" >連絡事項</th>
    	</tr>
    
    HTML_END;
    		return $str;
    	}
    
    //////////////////////////////////////////////
    // 各データの表示テーブル
    
    	function layout_table_data($line,$user,$mode){
    		$now_time = time();
    		$num = $line[uid];
    		if( empty($line[expired]) || ( $line[topicid] == "2" && $now_time > $line[published] && $now_time < $line[expired] ) ){
    			switch ($mode){
    			case "csv":
    				$data = date("n月j日",$line[published]).",";
    				$data .= date("n月j日",$line[expired]).",";
    				$data .= $user[$num].",";
    				$line_tmp = xoopsCodeDecode($line[hometext],1);
    				$line_tmp = ereg_replace("\r\n","[     ]",str_replace(",",",",$line_tmp));
    				$line_tmp = ereg_replace("<[^>]+>","",$line_tmp);
    				$data .= $line_tmp;
    				$line_tmp = xoopsCodeDecode($line[bodytext],1);
    				$line_tmp = ereg_replace("\r\n","",str_replace(",",",",$line_tmp));
    				// $line_tmp = ereg_replace("<.+>","",$line_tmp);
    				$data .= $line_tmp."\n";
    				$data = mb_convert_encoding($data,"SJIS-WIN", "EUC-JP");
    				break;
    			default:
    				$data = "\t<tr>\n";
    				$data .= "\t\t<td class=\"start\" valign=\"top\">".date("n月j日",$line[published])."<br />".date("H:i",$line[published])."</td>\n";
    				$data .= "\t\t<td class=\"end\" valign=\"top\">".date("n月j日",$line[expired])."<br />".date("H:i",$line[expired])."</td>\n";
    				$data .= "\t\t<td class=\"person\" valign=\"top\">$user[$num]</td>\n";
    				$data .= "\t\t<td class=\"message\" valign=\"top\">\n";
    				$line_tmp = xoopsCodeDecode($line[hometext],1);
    				$data .= nl2br($line_tmp)."\n<br /><br />";
    				$line_tmp = xoopsCodeDecode($line[bodytext],1);
    				$data .= nl2br($line_tmp)."\n\t\t</td>\n\t</tr>\n";
    			}
    		} else {
    			$data = "";
    		}
    		return $data;
    	}
    
    //////////////////////////////////////////////
    //////////////////////////////////////////////
    // xoopsエディタの装飾タグ変換用関数(xoopsからのパクリ
    
        function xoopsCodeDecode(&$text, $allowimage)
        {
            $patterns = array();
            $replacements = array();
            // RMV: added new markup for intrasite url (allows easier site moves)
            // TODO: automatically convert other URLs to this format if XOOPS_URL matches??
            $patterns[] = "/\[siteurl=(['\"]?)([^\"'<>]*)\\1](.*)\[\/siteurl\]/sU";
            $replacements[] = '<a href="http://'.$site_IP.'/\\2" target="_blank">\\3</a>';
            $patterns[] = "/\[url=(['\"]?)(http[s]?:\/\/[^\"'<>]*)\\1](.*)\[\/url\]/sU";
            $replacements[] = '<a href="\\2" target="_blank">\\3</a>';
            $patterns[] = "/\[url=(['\"]?)(ftp?:\/\/[^\"'<>]*)\\1](.*)\[\/url\]/sU";
            $replacements[] = '<a href="\\2" target="_blank">\\3</a>';
            $patterns[] = "/\[url=(['\"]?)([^\"'<>]*)\\1](.*)\[\/url\]/sU";
            $replacements[] = '<a href="http://\\2" target="_blank">\\3</a>';
            $patterns[] = "/\[color=(['\"]?)([a-zA-Z0-9]*)\\1](.*)\[\/color\]/sU";
            $replacements[] = '<span style="color: #\\2;">\\3</span>';
            $patterns[] = "/\[size=(['\"]?)([a-z0-9-]*)\\1](.*)\[\/size\]/sU";
            $replacements[] = '<span style="font-size: \\2;">\\3</span>';
            $patterns[] = "/\[font=(['\"]?)([^;<>\*\(\)\"']*)\\1](.*)\[\/font\]/sU";
            $replacements[] = '<span style="font-family: \\2;">\\3</span>';
            $patterns[] = "/\[email]([^;<>\*\(\)\"']*)\[\/email\]/sU";
            $replacements[] = '<a href="mailto:\\1">\\1</a>';
            $patterns[] = "/\[b](.*)\[\/b\]/sU";
            $replacements[] = '<b>\\1</b>';
            $patterns[] = "/\[i](.*)\[\/i\]/sU";
            $replacements[] = '<i>\\1</i>';
            $patterns[] = "/\[u](.*)\[\/u\]/sU";
            $replacements[] = '<u>\\1</u>';
            $patterns[] = "/\[d](.*)\[\/d\]/sU";
            $replacements[] = '<del>\\1</del>';
            //$patterns[] = "/\[li](.*)\[\/li\]/sU";
            //$replacements[] = '<li>\\1</li>';
            $patterns[] = "/\[img align=(['\"]?)(left|center|right)\\1]([^\"\(\)\?\&'<>]*)\[\/img\]/sU";
            $patterns[] = "/\[img]([^\"\(\)\?\&'<>]*)\[\/img\]/sU";
            $patterns[] = "/\[img align=(['\"]?)(left|center|right)\\1 id=(['\"]?)([0-9]*)\\3]([^\"\(\)\?\&'<>]*)\[\/img\]/sU";
            $patterns[] = "/\[img id=(['\"]?)([0-9]*)\\1]([^\"\(\)\?\&'<>]*)\[\/img\]/sU";
            if ($allowimage != 1) {
                $replacements[] = '<a href="\\3" target="_blank">\\3</a>';
                $replacements[] = '<a href="\\1" target="_blank">\\1</a>';
                $replacements[] = '<a href="http://'.$site_IP.'/image.php?id=\\4" target="_blank">\\4</a>';
                $replacements[] = '<a href="http://'.$site_IP.'/image.php?id=\\2" target="_blank">\\3</a>';
            } else {
                $replacements[] = '<img src="\\3" align="\\2" alt="" />';
                $replacements[] = '<img src="\\1" alt="" />';
                $replacements[] = '<img src="http://'.$site_IP.'/image.php?id=\\4" align="\\2" alt="\\4" />';
                $replacements[] = '<img src="http://'.$site_IP.'/image.php?id=\\2" alt="\\3" />';
            }
            $patterns[] = "/\[quote]/sU";
            $replacements[] = '引用:<div class="xoopsQuote"><blockquote>';
            //$replacements[] = 'Quote: <div class="xoopsQuote"><blockquote>';
            $patterns[] = "/\[\/quote]/sU";
            $replacements[] = '</blockquote></div>';
            $patterns[] = "/javascript:/si";
            $replacements[] = "java script:";
            $patterns[] = "/about:/si";
            $replacements[] = "about :";
            return preg_replace($patterns, $replacements, $text);
        }
    ?>

作業履歴/2005-08-22

xoops

  • プライベートメッセージ(pm)機能
    プライベートメッセージを作成する画面でのテキストエリアのサイズ変更は下記の部分の数値を変更することでできる。
    • pmlite.php
      120行目:                 xoopsCodeTarea("message",50,20);
  • サーバを移設する場合
    参考:xoops.sourceforge.jpのHOWTO/サーバー移設
    上記リンクにてサーバ移設やデータバックアップ手順への参考情報あり。

作業履歴/2005-08-16

Gimp

透過PNGを作ってみる。
でもなんかうまくできてないんだけどー(´Д`)
とりあえず参考にしたURLだけのしとく。

作業履歴/2005-08-29

xoops

  • 様々フォーラム
    • メインメニューの表示名称を様々Forumに変更。
      なんでかというと、メール通知のsubjectが文字化けしよんの(´Д`)
    • トピックの所属フォーラムの変更時の注意。
      各記事がどのフォーラムに所属しているのかは2つのテーブルで管理されている模様。
      よって、記事の所属Forumを変更するにはこの2つについて該当記事、トピックのfurum_id値を修正しないといけない。
      • _bb_posts
        postされた記事がどのtopic、どのforumに所属してどんなツリーになっているかといった、記事固有情報を管理するテーブル。
      • _bb_topics
        スレッドがどのフォーラムに属し、閲覧件数、返信数などのスレッド固有情報を管理するテーブル。
トップ   差分 バックアップ リロード   一覧 単語検索 最終更新   ヘルプ   最終更新のRSS