bulletinモジュールphp7への対応

このトピックの投稿一覧へ

なし bulletinモジュールphp7への対応

msg# 1.6
depth:
1
前の投稿 - 次の投稿 | 親投稿 - 子投稿.1 | 投稿日時 2022/9/29 8:25 | 最終変更
タツ  管理人   投稿数: 2400 オンライン
続いて、bulletinモジュールphp7への対応です。他に編集したモジュールと同様、XoopsXより最新のd3pipesモジュール(bulletin-master)version3.03をダウンロードし、ローカル環境(サーバーxampp7.4.25、legacy-2.3を起用)でインストールし、エラーが出るかどうかのチェックをしました。以下の部分を編集することでエラーは今の所解消されています。ただし、実際の運用上の不具合については未確認です。

■1.PHP7へのバージョンアップによる書式変更(__construct部分)
・xoops_trust_path/modules/bulletin/class/bulletin.php
19行目
function Bulletin( $mydirname , $id=null )
変更↓
function __construct( $mydirname , $id=null )

・xoops_trust_path/modules/bulletin/class/relation.php
11行目
function relation($mydirname='')
変更↓
function __construct($mydirname='')

・xoops_trust_path/modules/bulletin/class/bulletinTopic.php
8行目
function BulletinTopic( $mydirname , $topicid=0 )
変更↓
function __construct( $mydirname , $topicid=0 )

・xoops_trust_path/modules/bulletin/class/bulletingp.php
8行目
function BulletinGP($mydirname){
変更↓
function __construct($mydirname){

24行目
$instance->BulletinGP($mydirname);
変更↓
$instance->__construct($mydirname);

・xoops_trust_path/modules/bulletin/include/gtickets.php
13行目
function XoopsGTicket()
変更↓
function __construct()

■2.PHP7へのバージョンアップによる書式変更エラー
Warning [Xoops]: Smarty error: unable to read resource: "db:altsys_inc_mymenu.html" in file C:\xampp/htdocs/xoops_trust_path/libs/smarty/Smarty.class.php line 1108 (1)
Gnaviモジュールをインストールした際に同様のエラーが表示されていたので(原因は、モジュール管理メニューにaltsysを結合する際にaltsysのメニューが正しく取得できなかったことが原因のようです)、同様に
xoops_trust_path/modules/pico/admin/mymenuをそのまま
xoops_trust_path/modules/bulletin/admin/mymenuに転用することで解消しました。
ただし、メニューが重複する部分があったので不要な部分をコメントアウトしました。

・xoops_trust_path/modules/bulletin/admin/mymenu.php(Picoモジュール内のmymenu.phpを転用後編集) 
40行目~57行目までコメントアウト
/**
if ( file_exists( XOOPS_TRUST_PATH . '/libs/altsys/myblocksadmin.php' ) ) {

	$title = defined( '_MD_A_MYMENU_MYBLOCKSADMIN' ) ? _MD_A_MYMENU_MYBLOCKSADMIN : 'blocksadmin';

	$adminmenu[] = [ 'title' => $title, 'link' => 'admin/index.php?mode=admin&lib=altsys&page=myblocksadmin' ];
}

// Preferences
$config_handler =& xoops_gethandler( 'config' );
if ( count( $config_handler->getConfigs( new Criteria( 'conf_modid', $xoopsModule->mid() ) ) ) > 0 ) {
	$adminmenu[] = [
		'title' => _PREFERENCES,
		'link'  => XOOPS_URL . '/modules/legacy/admin/index.php?action=PreferenceEdit&confmod_id=' . $xoopsModule->mid()
	];
}
*/

■3.インストール時の上書き禁止ファイル
以下のファイルが梱包されているが既にlegacy-2.3にて標準装備されているため上書きはしないようにすること
・xoops_trust_path/libs/smarty/plugins/function.d3comment.php
・xoops_trust_path/libs/smarty/plugins/function.xoopsdhtmltarea.php

■4.その他PHP7での配列書式変更
変更対象ファイル
array()は殆どのファイルにて多数存在するので省略します
例)$name = array() 
変更↓
$name = [];

以上です。今の所、管理画面ではエラーは解消しています。最初にも記述しましたが、今の所エラーは解消されていますが、実際の運用をしていないので稼働可能かどうかも含め、変更などあれば追加編集したいと思います。
投票数:20 平均点:3.50

投稿ツリー


     条件検索へ

旅と気ままなフォーラム最新投稿

欲しい商品が必ず見つかるメジャーなネットショップ

ログイン

Facebook,RSSリンク表示

検索

アクセスカウンタ

今日 : 31
昨日 : 655
総計 : 1628784