<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
  <title>ソロツーリングと気ままな旅 - 旅と気ままなフォーラム - XOOPS、パソコン関連 - [ XOOPS関連フォーラム ]</title>
  <link>https://www.onwil.com/modules/wilforum/index.php?forum_id=9</link>
  <description></description>
  <lastBuildDate>Thu, 09 Apr 2026 10:01:29 +0900</lastBuildDate>
  <docs>http://backend.userland.com/rss/</docs>
    <item>
    <title>ガラケイからスマホに替えました。</title>
    <link>https://www.onwil.com/modules/wilforum/index.php?post_id=934</link>
    <guid>https://www.onwil.com/modules/wilforum/index.php?post_id=934</guid>
    <description></description>
    <pubDate>Sun, 01 Mar 2026 07:25:11 +0900</pubDate>
    <category>XOOPS、パソコン関連</category>
    <category>XOOPS関連フォーラム</category>
    <content:encoded><![CDATA[この1月にガラケイからやっとスマホに替えました。たまたまいくつかの携帯は無料交換(ただし手数料が必要)できるということだったのでこの中で一番写真が綺麗に写るものをがほしいと言うとGoogl pixelでした。家に帰って現存のカメラと解像度を比べるとはるかに良いものでした。びっくりですね。<br><br>さて、早速この携帯でこのサイトを見ると、あら、横幅の隙間が大きすぎてかなりバランスが悪いというのが分かりました。早速不要な隙間を削除しました。携帯に関しては想像でサイトを作っていましたが初めて自分のサイトを実際に眺めて見ると細部に乖離があるものですね。<br><br>因みに最初、電話のかけ方は分かったのですが、かかってきた電話の取り方が分からなくて困りました。そもそも携帯は電話とメール以外は使うことはありません。強いて言えばホームページを見ることができれば他の機能は使うことはありません。Android OSが入っているので多様なアプリケーションを使うことができるとは思いますが、不必要なアプリケーションはインストールしないことにしています。また、ガラケイと違ってお知らせがよく入ってくるので不要なお知らせは設定でカットしました。今のところ順調です。]]></content:encoded>
  </item>
    <item>
    <title>d3pipesモジュールでサイト内の新着一覧表を表示させる</title>
    <link>https://www.onwil.com/modules/wilforum/index.php?post_id=922</link>
    <guid>https://www.onwil.com/modules/wilforum/index.php?post_id=922</guid>
    <description></description>
    <pubDate>Sun, 14 Dec 2025 15:33:11 +0900</pubDate>
    <category>XOOPS、パソコン関連</category>
    <category>XOOPS関連フォーラム</category>
    <content:encoded><![CDATA[d3pipeモジュールの目的は外部も含め新着情報を表示することです。これを利用すればホームページで各モジュールの新着投稿を表示することができます。ところが新着表示が10件しか表示されないことに問題があります。d3pipeモジュールには一般設定で設定項目(個々のパイプページで表示するエントリ数 )がありますが反映されません。<br><br>また、d3forumモジュールのブロック管理にて投稿一覧を表示すると投稿された一覧が表示され、d3pipesモジュールでのパイプ出力では投稿されたトピックの一覧が表示されます。<br><br>目標としては<br>1.トップ画面で各モジュールの統合した投稿の一覧を表示し、なおかつ別枠でd3forumの投稿されたトピックを表示したい<br>2.各モジュールで新着情報の最後に「もっと・・」を表示し、リンク先にはd3pipesモジュールの各パイプで少なくとも50以上の新着一覧表を表示したい<br><br>この目標の手順として次のようにしてみました。<br>1.d3pipeモジュールで各パイプの数を50以上(60とした)に増やす。<br>xoops_trust_path/modules/d3pipe/joints/block内に該当するd3pipsモジュールのブロック関数ファイルを編集する<br>例えば<br><div><pre><code>xoops_trust_path/modules/d3pipe/joints/block/D3pipesBlockD3forumtopics.class.phpであれば
26行目
1 =&gt; empty( $params[2] ) ? 10 : intval( $params[2] ) , // max_entries
10を60に変更</code></pre></div>同様に<br>自分のサイトでは以下のファイルを編集しました。<br>xoops_trust_path/modules/d3pipes/joints/block/D3pipesBlockGnavilist.class<br>xoops_trust_path/modules/d3pipes/joints/block/D3pipesBlockPicolist.class<br>xoops_trust_path/modules/d3pipes/joints/block/D3pipesBlockMyalbumplist.class<br>xoops_trust_path/modules/d3pipes/joints/block/D3pipesBlockWebphotolist.class<br>xoops_trust_path/modules/d3pipes/joints/block/D3pipesBlockBulletinlist.class<br>xoops_trust_path/modules/d3pipes/joints/block/D3pipesBlockD3forumtopics.class<br>編集後、d3pipesパイプ管理にてそれぞれのブロック関数を選択し表示させる<br><br><br>2.ブロック関数d3forumrevを編集しd3forumモジュールの新着投稿を表示させる。<br>xoops_trust_path/modules/d3forum/include/d3pipesd3forumrev.inc.php　<br><br><div><pre><code>22行目
if ( isset($params[4]) &amp;&amp; intval( $params[4] )&gt;0 ) {
//posts
$this-&gt;func_name = &#039;b_d3forum_list_posts_show&#039; ;
$this-&gt;block_options = array(
&#039;disable_renderer&#039; =&gt; true ,
0 =&gt; $this-&gt;target_dirname , // mydirname of pico
1 =&gt; empty( $params[2] ) ? 10 : intval( $params[2] ) , // max_entries
2 =&gt; &#039;time&#039; , // order by
3 =&gt; preg_replace( &#039;/[^0-9,]/&#039; , &#039;&#039; , @$params[1] ) , // category limitation
5 =&gt; preg_replace( &#039;/[^0-9,]/&#039; , &#039;&#039; , @$params[3] ) , // forum limitation
) ;
} else {
//topics
$this-&gt;func_name = &#039;b_d3forum_list_topics_show&#039; ;
$this-&gt;block_options = array(
&#039;disable_renderer&#039; =&gt; true ,
0 =&gt; $this-&gt;target_dirname , // mydirname of pico
1 =&gt; empty( $params[2] ) ? 10 : intval( $params[2] ) , // max_entries
2 =&gt; false , // show_fullsize
3 =&gt; &#039;time&#039; , // order by
4 =&gt; false , // is_markup
5 =&gt; preg_replace( &#039;/[^0-9,]/&#039; , &#039;&#039; , @$params[1] ) , // category limitation
7 =&gt; preg_replace( &#039;/[^0-9,]/&#039; , &#039;&#039; , @$params[3] ) , // forum limitation
) ;

↓
if文でtopicを優先させ、表示数を60に変更

if ( isset($params[4]) &amp;&amp; intval( $params[4] )&gt;0 ) {
//topics
$this-&gt;func_name = &#039;b_d3forum_list_topics_show&#039; ;
$this-&gt;block_options = array(
&#039;disable_renderer&#039; =&gt; true ,
0 =&gt; $this-&gt;target_dirname , // mydirname of pico
1 =&gt; empty( $params[2] ) ? 10 : intval( $params[2] ) , // max_entries
2 =&gt; false , // show_fullsize
3 =&gt; &#039;time&#039; , // order by
4 =&gt; false , // is_markup
5 =&gt; preg_replace( &#039;/[^0-9,]/&#039; , &#039;&#039; , @$params[1] ) , // category limitation
7 =&gt; preg_replace( &#039;/[^0-9,]/&#039; , &#039;&#039; , @$params[3] ) , // forum limitation
) ;
} else {
//posts
$this-&gt;func_name = &#039;b_d3forum_list_posts_show&#039; ;
$this-&gt;block_options = array(
&#039;disable_renderer&#039; =&gt; true ,
0 =&gt; $this-&gt;target_dirname , // mydirname of pico
1 =&gt; empty( $params[2] ) ? 60 : intval( $params[2] ) , // max_entries
2 =&gt; &#039;time&#039; , // order by
3 =&gt; preg_replace( &#039;/[^0-9,]/&#039; , &#039;&#039; , @$params[1] ) , // category limitation
5 =&gt; preg_replace( &#039;/[^0-9,]/&#039; , &#039;&#039; , @$params[3] ) , // forum limitation
) ;

さらに、
記事表示は省きすっきりさせました。
73行目
//&#039;headline&#039; =&gt; $post[&#039;subject&#039;] ,
&#039;headline&#039; =&gt; &#039;[&#039;.$post[&#039;forum_title&#039;].&#039;] &#039;.$post[&#039;subject&#039;] ,
&#039;description&#039; =&gt; $post[&#039;post_text&#039;] ,

↓

//&#039;headline&#039; =&gt; $post[&#039;subject&#039;] ,
&#039;headline&#039; =&gt; $post[&#039;subject&#039;].&#039; - &#039;.$post[&#039;forum_title&#039;] ,
//&#039;description&#039; =&gt; $post[&#039;post_text&#039;] ,</code></pre></div><br><br>これでd3pipesパイプ管理にてブロック関数d3forumrevを選択し表示させる<br><br>3.d3pipeモジュールで各モジュールを統合する際に別枠でd3forumモジュールのトピック新着情報を表示させる<br>d3pipesパイプ管理にてブロック関数d3forutopicを選択し表示させる<br><br>4.新着一覧の後に「もっと・・」を追加する<br>d3pipesのブロック関数で各モジュールの新着一覧ブロックを作成し、表示数は12程度にしておきます。そのあと「もっと・・」を追加しd3pipesの各モジュールのページにリンクし残りの新着情報が見れるようにします。<br>「もっと・・」の表示については、d3pipesのテンプレート、モジュール名_block_sync.htmlの最後に<br><br><div><pre><code>&lt;{if !$pipe.id}&gt;
&lt;div style=&quot;text-align:right;&quot;&gt;&lt;a class=&quot;button&quot; href=&quot;&lt;{$xoops_url}&gt;/modules/sitepipes/&quot; &gt;もっと・・&lt;/a&gt;&lt;div&gt;
&lt;{else}&gt;
&lt;div style=&quot;text-align:right;&quot;&gt;&lt;a class=&quot;button&quot; href=&quot;&lt;{$xoops_url}&gt;/modules/sitepipes/index.php?page=eachpipe&amp;pipe_id=&lt;{$pipe.id}&gt;&quot; &gt;もっと・・&lt;/a&gt;&lt;/div&gt;
&lt;{/if}&gt;</code></pre></div><br>を追加する<br><br>この方法が正しいかどうかは分かりません。少なくともd3pipesモジュールの一般設定では反映されないようです。既にxoops cubeのサポートもなくバージョンアップも見込めないことから現時点では自分の能力からこれが限界かもしれません。]]></content:encoded>
  </item>
    <item>
    <title>Gnaviモジュールアイコン管理ができない件</title>
    <link>https://www.onwil.com/modules/wilforum/index.php?post_id=893</link>
    <guid>https://www.onwil.com/modules/wilforum/index.php?post_id=893</guid>
    <description></description>
    <pubDate>Sat, 02 Aug 2025 15:43:19 +0900</pubDate>
    <category>XOOPS、パソコン関連</category>
    <category>XOOPS関連フォーラム</category>
    <content:encoded><![CDATA[Gnaviモジュールで今後使われないだろうと思われるシャドウアイコンを管理画面で削除しようとしたところエラーが発生しました。原因は、listの要素が１つ足りないということだったので、listの最後に$field項目を追加したところエラーが解消されました。<br>xoops_trust_path/modules/gnavi/admin/icon.php 88 89行目　<br><div><pre><code>list($tmp_name ,$ext ,$errmsg) = gnavi_submit_uploader(field: @$_POST[&quot;xoops_upload_file&quot;][0] ,$del_photo ,$preview_name , 1, $errmsg);
list($tmp_name1,$shadow_ext,$errmsg) = gnavi_submit_uploader(@$_POST[&quot;xoops_upload_file&quot;][1] ,$del_photo1,$preview_name1, 2, $errmsg);

↓
list($tmp_name ,$ext ,$errmsg) = gnavi_submit_uploader(@$_POST[&quot;xoops_upload_file&quot;][0] ,$del_photo ,$preview_name , 1, $errmsg,$field);
list($tmp_name1,$shadow_ext,$errmsg) = gnavi_submit_uploader(@$_POST[&quot;xoops_upload_file&quot;][1] ,$del_photo1,$preview_name1, 2, $errmsg ,$field);
}</code></pre></div>]]></content:encoded>
  </item>
    <item>
    <title>Gnaviモジュール投稿の際の不具合解消</title>
    <link>https://www.onwil.com/modules/wilforum/index.php?post_id=879</link>
    <guid>https://www.onwil.com/modules/wilforum/index.php?post_id=879</guid>
    <description></description>
    <pubDate>Wed, 28 May 2025 06:40:02 +0900</pubDate>
    <category>XOOPS、パソコン関連</category>
    <category>XOOPS関連フォーラム</category>
    <content:encoded><![CDATA[前回の修正にて実際に投稿してみたところ不具合が発生していたので対処しました。<br>投稿の際の不具合とその対処は次の通りです。<br><br>これらは全てhtml/module/gnaviモジュールを利用しているファイル名/js/map.jsを編集することで解消されました。<br><br>・アイコンがドラッグできなくなった。<br><div><pre><code>497行目
draggable : true,
↓
gmpDraggable : true,</code></pre></div><br>・地図をクリックしたときの記述エラーとクリックした場所を地図の真中に移動する<br><div><pre><code>521行目
//mypoint2.setPosition(point.latLng);
↓
mypoint2.position = point.latLng;
gn_map.panTo(point.latLng);//map to center</code></pre></div><br>・pointは不要<br><div><pre><code>527行目
//var p = gn_map.getCenter(point);
↓
var p = gn_map.getCenter();</code></pre></div><br>・アイコンをドラッグした後の記述エラーとドラッグしたあとの場所を地図の真中に移動する<br><div><pre><code>536行目
//var p = mypoint2.getPosition(point);
↓
var p = point.latLng;
gn_map.panTo(point.latLng);//map to center</code></pre></div><br>以上をまとめると次のようになります<br><div><pre><code>494行目辺り
----------------オリジナル
// setmarker
mypoint2 = new google.maps.Marker({
position:c,
draggable : true,
map: gn_map,
title : unescape(gn_lg[&#039;setpoint&#039;])
});


// addListener
google.maps.event.addListener(gn_map, &#039;click&#039;, function(point) {

if (point) {
mypoint2.setPosition(point.latLng);
DrawLatLngTxt(point.latLng);
}
});

google.maps.event.addListener(gn_map, &#039;idle&#039;, function(point) {
var p = gn_map.getCenter(point);
DrawLatLngTxt(p);
var newZoomLevel = gn_map.getZoom();
document.getElementById(&#039;z&#039;).value =newZoomLevel;
document.getElementById(&#039;sz&#039;).innerHTML =newZoomLevel;
});


google.maps.event.addListener(mypoint2, &#039;dragend&#039;, function(point) {
var p = mypoint2.getPosition(point);
DrawLatLngTxt(p);
document.getElementById(&#039;pchange&#039;).value = &#039;1&#039;;
});
-------------------


↓上の部分を変更

// setmarker
mypoint2 = new google.maps.marker.AdvancedMarkerElement({
position:c,
gmpDraggable : true,
map: gn_map,
title : unescape(gn_lg[&#039;setpoint&#039;])
});


// addListener
google.maps.event.addListener(gn_map, &#039;click&#039;, function(point) {

if (point) {
mypoint2.position = point.latLng;
gn_map.panTo(point.latLng);//map to center
DrawLatLngTxt(point.latLng);
}
});

google.maps.event.addListener(gn_map, &#039;idle&#039;, function(point) {
var p = gn_map.getCenter();
DrawLatLngTxt(p);
var newZoomLevel = gn_map.getZoom();
document.getElementById(&#039;z&#039;).value =newZoomLevel;
document.getElementById(&#039;sz&#039;).innerHTML =newZoomLevel;
});


google.maps.event.addListener(mypoint2, &#039;dragend&#039;, function(point) {
var p = point.latLng;//
gn_map.panTo(p);////map to center
DrawLatLngTxt(p);
document.getElementById(&#039;pchange&#039;).value = &#039;1&#039;;
});</code></pre></div><br>さらに投稿の際に地図で場所を検索できなくなっていたので次のように対処しました。<br>・記述エラー<br><div><pre><code>561行目
//mypoint2.setPosition(results[0].geometry.location);
↓
mypoint2.position = results[0].geometry.location;</code></pre></div><br>今のところ、この修正で解消しています。]]></content:encoded>
  </item>
    <item>
    <title>Gnaviモジュール地図を高度なマーカーに移行する</title>
    <link>https://www.onwil.com/modules/wilforum/index.php?post_id=878</link>
    <guid>https://www.onwil.com/modules/wilforum/index.php?post_id=878</guid>
    <description></description>
    <pubDate>Tue, 27 May 2025 11:05:35 +0900</pubDate>
    <category>XOOPS、パソコン関連</category>
    <category>XOOPS関連フォーラム</category>
    <content:encoded><![CDATA[Gnaviモジュールの地図はgooglemapのapiを利用しています。よく見てみると次のようなことがアナウンスされていました。<br>引用：<div><blockquote>google.maps.Marker（v3.56）は、2024 年 2 月 21 日にサポートが終了しました。つきましては、新しい google.maps.marker.AdvancedMarkerElement クラスに移行することをおすすめします。高度なマーカーでは、従来の google.maps.Marker クラスと比べて、大幅な改善が加えられています。<br></blockquote></div>https://developers.google.com/maps/documentation/javascript/advanced-markers/migration?hl=ja<br><br>ただし、今のところgoogle.maps.Markerの廃止予定はないようです。とはいうものの新しいgoogle.maps.marker.AdvancedMarkerElementクラスに移行しておいた方が良いのではないかとできるだけモジュールのオリジナルコードは変更せずに編集してみました。<br><br>Gnaviモジュールでの主な変更要領手順は次の通りです。<br><br><b>1.新しい地図に変更</b><br><div><pre><code>trust_path/modules/gnavi/include/common_javalang.inc.php
3行目
$gnavi_googlemap_url=&quot;https://maps-api-ssl.google.com&quot;;
↓
$gnavi_googlemap_url=&quot;https://maps.googleapis.com&quot;;</code></pre></div>と変更しました。<br>引用：<div><blockquote><b>高度なマーカーに移行する手順として次のように記載されています。</b><br>・マーカー ライブラリをインポートするためのコードを追加します。以前のバージョンのマーカー（google.maps.Marker）にはこの要件がないことにご注意ください。<br>・google.maps.Marker を google.maps.marker.AdvancedMarkerElement に変更します。<br>・地図の初期化コードに マップ ID を追加します。まだマップ ID がない場合は、テスト用の mapId: &#039;DEMO_MAP_ID&#039; を追加することもできます。<br></blockquote></div><br>この事を基準に編集を行います。<br><br><b>2.マーカー ライブラリをインポートするためのコード(&amp;libraries=marker)を追加</b><br>以下のscriptはいずれもscript類の一番最後に設置しました。オリジナルではinitmapという関数を呼び出した後別のスクリプトから必要な関数を呼び出しています。この別の呼び出し関数の要素は削除し、ダイレクトにそれぞれの関数を呼び出すことにしました。これが正しいかどうかはよくわかりません。そもそもinitmapという関数はmap.jsの中に存在しません。<br><br><div><pre><code>■xoops_trust_path/modules/gnavi/admin/category.php
削除→412行目　google.maps.event.addDomListener(window, &#039;load&#039;, function(){ InputGMap(); });

(callback=initmap 　→　callback=InputGMapへ)
変更後→&lt;script async src=&#039;$gnavi_googlemap_url/maps/api/js?key=$gnavi_googlemapapi_key&amp;libraries=marker&amp;loading=async&amp;callback=InputGMap&#039;&gt;&lt;/script&gt;

■xoops_trust_path/modules/gnavi/main/item.php
削除→124行目　google.maps.event.addDomListener(window, &#039;load&#039;, function(){ ShowItemGMap(); });

(callback=initmap 　→　callback=ShowItemGMapへ)
113行目変更後script類の一番最後へ→&lt;script async src=&#039;$gnavi_googlemap_url/maps/api/js?key=$gnavi_googlemapapi_key&amp;libraries=marker&amp;loading=async&amp;callback=ShowItemGMap&#039;&gt;&lt;/script&gt;

■xoops_trust_path/modules/gnavi/main/map.php
削除→227行目　google.maps.event.addDomListener(window, &#039;load&#039;, function(){ ShowGMap(); });

(callback=initmap →　callback=ShowGMapへ)
214行目変更後script類の一番最後へ→&lt;script async src=&#039;$gnavi_googlemap_url/maps/api/js?key=$gnavi_googlemapapi_key&amp;libraries=marker&amp;loading=async&amp;callback=ShowGMap&#039;&gt;&lt;/script&gt;

■xoops_trust_path/modules/gnavi/main/submit.php
削除→923行目　google.maps.event.addDomListener(window, &#039;load&#039;, function(){ InputGMap(); });

(callback=initmap →　callback=InputGMapへ)
917行目変更後script類の一番最後へ→&lt;script async src=&#039;$gnavi_googlemap_url/maps/api/js?key=$gnavi_googlemapapi_key&amp;libraries=marker&amp;loading=async&amp;callback=InputGMap&#039;&gt;&lt;/script&gt;</code></pre></div><br><br><b>3.地図の初期化コードに マップ ID を追加</b><br>マップ IDの取得方法はここを参考に<br><a href="https://developers.google.com/maps/documentation/maps-static/map-ids/get-map-id?hl=ja" rel="external">https://developers.google.com/maps/documentation/maps-static/map-ids/get-map-id?hl=ja</a><br>あるいは<br>テスト用の mapId: &#039;DEMO_MAP_ID&#039; を追加します。<br><br><div><pre><code>■html/module/gnaviモジュールを利用しているファイル名/js/map.js
64行目にmapId: &#039;DEMO_MAP_ID&#039;を追加
var myOptions = {
zoom: gn_iz,
center: myLatlng,
scaleControl :true,
mapTypeId:google.maps.MapTypeId[gn_mt]
};
↓
var myOptions = {
zoom: gn_iz,
center: myLatlng,
scaleControl :true,
mapTypeId:google.maps.MapTypeId[gn_mt]
mapId: &#039;DEMO_MAP_ID&#039;　//mapIdの追加
};</code></pre></div><br><br><br><b>4.マーカークラスの変更</b><br>google.maps.Marker を google.maps.marker.AdvancedMarkerElement に変更します。<br><br><div><pre><code>html/module/gnaviモジュールを利用しているファイル名/js/map.js内
google.maps.Marker
↓変更
google.maps.marker.AdvancedMarkerElement</code></pre></div>と全て変更します。<br><br><br><b>5.Gnaviモジュールで利用されている画像アイコンをマーカーに使う</b><br>マーカーを設置するにあたってGnaviではマーカーをイメージを利用しているためそのままでは利用することができません。新しいクラスで画像ファイルをマーカーを利用するためには画像ファイルをimg要素として設定し、マーカーをcontentで指定することになります具体的には<br><br><div><pre><code>html/module/gnaviモジュールを利用しているファイル名/js/map.js内の例
129行目
var iconimage = {
size: new google.maps.Size(parseInt(p[1]), parseInt(p[2])),
anchor: new google.maps.Point(parseInt(p[6]), parseInt(p[7])),
url: p[0]
};
↓変更
var iconimage = document.createElement(&#039;img&#039;);//img要素として設定
iconimage.src = p[0];


さらに
150行目
gn_mymk = new google.maps.Marker({
position:myLatlng,
// draggable : true,
icon: iconimage,
// shadow : iconshadow,
map: gn_map,
title: p.title
});

n_mymk = new google.maps.marker.AdvancedMarkerElement({
position:myLatlng,
// draggable : true,
content: iconimage,//contentを使用する
// shadow : iconshadow,
map: gn_map,
title: p.title
});</code></pre></div><br>ただし配列を利用し複数のマーカーを利用する場合、ダイレクトにcontentにimg要素の配列を設定すると画像マーカーが１つしか使えないという不具合が発生したので直前に代替えマーカーを利用するとうまく表示されました。<br><br><div><pre><code>html/module/gnaviモジュールを利用しているファイル名/js/map.js内の例
421行目
gn_mk[lid] = new google.maps.Marker({
position: ll,
content: iconimage[icd],
map: gn_map
});

↓

iconimagecpy = document.createElement(&#039;img&#039;);//代替えマーカーを利用
iconimagecpy.src = iconimage[icd].src;
gn_mk[lid] = new google.maps.marker.AdvancedMarkerElement({
position: ll,
content: iconimagecpy,
map: gn_map

});</code></pre></div><br><br><b>6.マーカーのgetPosition()は使用できない</b><br><br><div><pre><code>html/module/gnaviモジュールを利用しているファイル名/js/map.js
458行目
gn_infowindow.setContent(gn_desc[lid]);
gn_infowindow.open(gn_map,gn_mk[lid]);

gn_map.panTo(gn_mk[lid].getPosition());
↓getPosition()は使用不可のため
gn_map.panTo(gn_mk[lid].position); //gn_mk[lid].positionに変更</code></pre></div><br><br>Gnaviモジュールのmap.jsではアイコンの影を設定していますが、これは使えなくなっています。また今回の編集にてマップのバージョン設定も無効になっています。]]></content:encoded>
  </item>
    <item>
    <title>d3forumのページタイトルにトピックを追加</title>
    <link>https://www.onwil.com/modules/wilforum/index.php?post_id=850</link>
    <guid>https://www.onwil.com/modules/wilforum/index.php?post_id=850</guid>
    <description></description>
    <pubDate>Sat, 23 Nov 2024 11:08:35 +0900</pubDate>
    <category>XOOPS、パソコン関連</category>
    <category>XOOPS関連フォーラム</category>
    <content:encoded><![CDATA[旅と気ままなフォーラムのページで、トピックについての記事を投稿しているにも関わらず、トピックが表示されず、ページタイトルとして記事名単独で表示されていたので、どのトピックに対しての投稿かということが分かるようにd3forumを編集しました。<br><div><pre><code>xoops_trust_path/modules/d3forum/include/vewpost.php 177行目
$topic4assign[&#039;title&#039;]を追加

&#039;xoops_pagetitle&#039; =&gt; join(&#039; - &#039;, array($post4assign[&#039;subject&#039;], $forum4assign[&#039;title&#039;], $xoopsModule-&gt;getVar(&#039;name&#039;))) ,
　↓
&#039;xoops_pagetitle&#039; =&gt; join(&#039; - &#039;, array($post4assign[&#039;subject&#039;], $topic4assign[&#039;title&#039;], $forum4assign[&#039;title&#039;], $xoopsModule-&gt;getVar(&#039;name&#039;))) ,</code></pre></div><br>例えば、Xoops Cube Legacyをphp7で運用する方法を模索というトピックに対して多くの記事を投稿していますが、<br><br>編集前<br>myx_backupモジュールphp7への対応 - XOOPS関連フォーラム - 旅と気ままなフォーラム - ソロツーリングと気ままな旅<br>編集後<br>Xoops Cube Legacyをphp7で運用する方法を模索 - myx_backupモジュールphp7への対応 - XOOPS関連フォーラム - 旅と気ままなフォーラム - ソロツーリングと気ままな旅<br><br>というようになりました。今後不具合がないか様子を見たいと思います。<br><br>追加----<br>早速内容を精査したところ、titleで上記の方法ではトピックのタイトルと投稿のタイトルがダブってしまい記述されるので、ダブらないように以下の部分全体を編集してみました。<br><div><pre><code>if($topic4assign[&#039;title&#039;] == $post4assign[&#039;subject&#039;]) {
$xoopsTpl-&gt;assign(
array(
&#039;category&#039; =&gt; $category4assign ,
&#039;forum&#039; =&gt; $forum4assign ,
&#039;topic&#039; =&gt; $topic4assign ,
&#039;next_topic&#039; =&gt; $next_topic4assign ,
&#039;prev_topic&#039; =&gt; $prev_topic4assign ,
&#039;post&#039; =&gt; $post4assign ,
&#039;posts&#039; =&gt; $posts ,
&#039;tree&#039; =&gt; $tree , // naao
&#039;tree_tp_count&#039; =&gt; $topics_count , // naao
&#039;page&#039; =&gt; &#039;viewpost&#039; ,
&#039;ret_name&#039; =&gt; &#039;post_id&#039; ,
&#039;ret_val&#039; =&gt; $post_id ,
&#039;uname&#039; =&gt; $poster_uname4disp ,

&#039;xoops_pagetitle&#039; =&gt; join(&#039; - &#039;, array($post4assign[&#039;subject&#039;], $forum4assign[&#039;title&#039;], $xoopsModule-&gt;getVar(&#039;name&#039;))) ,
&#039;xoops_meta_description&#039; =&gt; $d3forum_meta_description , // naao
&#039;xoops_breadcrumbs&#039; =&gt; $xoops_breadcrumbs ,
)
) ;
}else{
$xoopsTpl-&gt;assign(
array(
&#039;category&#039; =&gt; $category4assign ,
&#039;forum&#039; =&gt; $forum4assign ,
&#039;topic&#039; =&gt; $topic4assign ,
&#039;next_topic&#039; =&gt; $next_topic4assign ,
&#039;prev_topic&#039; =&gt; $prev_topic4assign ,
&#039;post&#039; =&gt; $post4assign ,
&#039;posts&#039; =&gt; $posts ,
&#039;tree&#039; =&gt; $tree , // naao
&#039;tree_tp_count&#039; =&gt; $topics_count , // naao
&#039;page&#039; =&gt; &#039;viewpost&#039; ,
&#039;ret_name&#039; =&gt; &#039;post_id&#039; ,
&#039;ret_val&#039; =&gt; $post_id ,
&#039;uname&#039; =&gt; $poster_uname4disp ,

&#039;xoops_pagetitle&#039; =&gt; join(&#039; - &#039;, array($post4assign[&#039;subject&#039;], $topic4assign[&#039;title&#039;], $forum4assign[&#039;title&#039;], $xoopsModule-&gt;getVar(&#039;name&#039;))) ,
&#039;xoops_meta_description&#039; =&gt; $d3forum_meta_description , // naao
&#039;xoops_breadcrumbs&#039; =&gt; $xoops_breadcrumbs ,
)
) ;
}</code></pre></div>11/28 トピックタイトルと投稿タイトルの順番を逆に変更しました。他にも良い方法があるとは思いますが思いつきませんでした。]]></content:encoded>
  </item>
    <item>
    <title>Gnaviモジュール不具合の対処</title>
    <link>https://www.onwil.com/modules/wilforum/index.php?post_id=820</link>
    <guid>https://www.onwil.com/modules/wilforum/index.php?post_id=820</guid>
    <description></description>
    <pubDate>Mon, 03 Jun 2024 15:29:08 +0900</pubDate>
    <category>XOOPS、パソコン関連</category>
    <category>XOOPS関連フォーラム</category>
    <content:encoded><![CDATA[<b>Google Chromeでは正常に地図が表示されない</b><br>Gnaviモジュールを上記のように編集したものの、Google Chromeのブラウザを使うと地図が表示されない場合が多々あり、調べてみると次のようなエラーが発生していました。<div><pre><code>map.js:168 Uncaught (in promise)
TypeError: Cannot read properties of null (reading &#039;value&#039;)
at ShowGMap (map.js:168:34)
at js?v=3&amp;key=AIzaSyDZF…ck=ShowGMap:232:509
at js?v=3&amp;key=AIzaSyDZF…ack=ShowGMap:232:21</code></pre></div>これはブラウザが読み込まれていない状態でマップのスクリプトが開始されるため正常な値が取得できなかったと解釈し、以下の部分でasync →　deferに変更しました。<br><div><pre><code>&lt;script async src=&#039;&quot;.$gnavi_googlemap_url.&quot;/maps/api/js?v=&quot;.$gnavi_gmapapi_ver.&quot;&amp;amp;key=&quot;.$gnavi_googlemapapi_key.&quot;&amp;amp;callback=ShowItemGMap&#039; &gt;&lt;/script&gt;

↓asyncをdeferに変更

&lt;script defer src=&#039;&quot;.$gnavi_googlemap_url.&quot;/maps/api/js?v=&quot;.$gnavi_gmapapi_ver.&quot;&amp;amp;key=&quot;.$gnavi_googlemapapi_key.&quot;&amp;amp;callback=ShowItemGMap&#039; &gt;&lt;/script&gt;</code></pre></div>今のところ正常に動作しているようです。これでブラウザが読み込まれてからスクリプトを開始することになるのでdeferに対応しているブラウザであれば大丈夫かと思います。<br><br>変更カ所は前投稿と同じく４カ所になります。<br>編集対象ファイル<br>・xoops_trust_path/modules/gnavi/admin/category.php<br>・xoops_trust_path/modules/gnavi/main/item.php<br>・xoops_trust_path/modules/gnavi/main/map.php<br>・xoops_trust_path/modules/gnavi/main/submit.php<br><br><br><b>同一記事でURLにカテゴリIDが付加される</b><br>さらに、同一記事であるにも関わらずカテゴリによって地図内のURL、記事のURLともにカテゴリIDが付加されるので以下のファイルの該当部分を削除しました。<br>■<b>テンプレートモジュール名_itemrow.html</b><br>このファイルで、リンクに付加されているカテゴリIDを3カ所削除しています。<br><div><pre><code>&lt;a href=&#039;&lt;{$mod_url}&gt;/index.php?lid=&lt;{$photo.lid}&gt;&lt;{if $category_id}&gt;&amp;amp;cid=&lt;{$category_id}&gt;&lt;{/if}&gt;&#039;

↓&lt;{if $category_id}&gt;&amp;amp;cid=&lt;{$category_id}&gt;&lt;{/if}&gt;部分を削除(3カ所)

&lt;a href=&#039;&lt;{$mod_url}&gt;/index.php?lid=&lt;{$photo.lid}&gt;&#039;</code></pre></div><br><br>■<b>xoops_trust_path/modues/gnavi/main/kml.php</b> 152行目辺り<br><div><pre><code>$desc = &quot;&lt;div align=&#039;center&#039; $h&gt;&lt;div class=&#039;image&#039;&gt;&lt;a href=&#039;$mod_url/index.php?lid=$lid$op_link&#039;&gt;&lt;img src=&#039;$imgsrc_photo&#039; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&quot;.$desc;
}

$desc.=&quot;&lt;div style=&#039;clear:both;&#039; align=&#039;right&#039;&gt;&lt;a href=&#039;$mod_url/index.php?lid=$lid$op_link&#039;&gt;&quot;._MD_GNAV_NAV_READMORE.&quot;&lt;/a&gt;&lt;/div&gt;&quot;;

↓$op_link削除

$desc = &quot;&lt;div align=&#039;center&#039; $h&gt;&lt;div class=&#039;image&#039;&gt;&lt;a href=&#039;$mod_url/index.php?lid=$lid&#039;&gt;&lt;img src=&#039;$imgsrc_photo&#039; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&quot;.$desc;
}

$desc.=&quot;&lt;div style=&#039;clear:both;&#039; align=&#039;right&#039;&gt;&lt;a href=&#039;$mod_url/index.php?lid=$lid&#039;&gt;&quot;._MD_GNAV_NAV_READMORE.&quot;&lt;/a&gt;&lt;/div&gt;&quot;;</code></pre></div><br>■<b>html/modules/モジュール名/js/map.js </b>357行目辺り<br><div><pre><code>gn_desc[lid]=&quot;&lt;div style=&#039;width:180px;&#039;&gt;&lt;a href=&#039;&quot;+gn_url+&quot;/index.php?lid=&quot;+lid+u+&quot;&#039;&gt;&quot;+name+&quot;&lt;/a&gt;&lt;br /&gt;&quot;+description+&quot;&lt;/div&gt;&quot;;

↓u+を削除

gn_desc[lid]=&quot;&lt;div style=&#039;width:180px;&#039;&gt;&lt;a href=&#039;&quot;+gn_url+&quot;/index.php?lid=&quot;+lid+&quot;&#039;&gt;&quot;+name+&quot;&lt;/a&gt;&lt;br /&gt;&quot;+description+&quot;&lt;/div&gt;&quot;;</code></pre></div><br>以上でリンクされているページは１つになっています。この後、さらにカテゴリIDがURLに追加される場合はその時に対処できればしたいと思います。]]></content:encoded>
  </item>
    <item>
    <title>GnaviモジュールのMap読み込みスピードアップ</title>
    <link>https://www.onwil.com/modules/wilforum/index.php?post_id=815</link>
    <guid>https://www.onwil.com/modules/wilforum/index.php?post_id=815</guid>
    <description></description>
    <pubDate>Mon, 13 May 2024 14:48:57 +0900</pubDate>
    <category>XOOPS、パソコン関連</category>
    <category>XOOPS関連フォーラム</category>
    <content:encoded><![CDATA[今さらですが、どうしてもGnaviモジュールで地図の読み込みが遅いのが気になり速くする方法を検索していると次のようなページが見つかりました。<br>引用：<div><blockquote>Google Maps API のヒント: ページの読み込み時間をスピードアップ 2015年10月29日木曜日 <a href="https://developers-jp.googleblog.com/2015/10/google-maps-api.html" rel="external">https://developers-jp.googleblog.com/2015/10/google-maps-api.html</a><br></blockquote></div><br>次のように記載されています。<br><div><pre><code>&lt;script src=&quot;https://maps.googleapis.com/maps/api/js&quot;&gt;&lt;/script&gt;
...
&lt;script&gt;
function initMap() {
var map = new google.maps.Map(document.getElementById(&#039;map&#039;), {
center: {lat: -34.397, lng:150.644},
zoom:8
});
}
google.maps.event.addDomListener(window, &#039;load&#039;, initMap);
&lt;/script&gt;

↓こうなりました。

&lt;script&gt;
function initMap() {
var map = new google.maps.Map(document.getElementById(&#039;map&#039;), {
center: {lat: -34.397, lng:150.644},
zoom:8
});
}
&lt;/script&gt;
&lt;script src=&quot;https://maps.googleapis.com/maps/api/js?callback=initMap&quot;
async defer&gt;&lt;/script&gt;</code></pre></div><br><br>これによると<br>google.maps.event.addDomListener(window, &#039;load&#039;, initMap);を削除し、<br>後述で<br>&lt;script src=&quot;<a href="https://maps.googleapis.com/maps/api/js?callback=initMap&quot;" rel="external">https://maps.googleapis.com/maps/api/js?callback=initMap&quot;</a><br>async defer&gt;&lt;/script&gt;<br>とページを全て読み込んだ後に必要なコマンドを呼び出すと解釈できます。早速編集することとしました。<br><br>Gnaviモジュールにはこの記述の編集対象ファイルが４カ所あります。<br>・xoops_trust_path/modules/gnavi/admin/category.php<br>・xoops_trust_path/modules/gnavi/main/item.php<br>・xoops_trust_path/modules/gnavi/main/map.php<br>・xoops_trust_path/modules/gnavi/main/submit.php<br><br>例えばxoops_trust_path/modules/gnavi/main/item.phpについて考えてみると<br><br>115行目に対象となる<br><br><div><pre><code>&lt;script src=&#039;&quot;.$gnavi_googlemap_url.&quot;/maps/api/js?v=&quot;.$gnavi_gmapapi_ver.&quot;&amp;amp;key=&quot;.$gnavi_googlemapapi_key.&quot;&amp;amp;callback=initMap&#039; type=&#039;text/javascript&#039;&gt;&lt;/script&gt;
このコードの
callback=initMapの部分を
↓
callback=ShowItemGMapに変更</code></pre></div><br>これを最後のスクリプトの位置に移動します。<br><br>127行目の<br><div><pre><code>google.maps.event.addDomListener(window, &#039;load&#039;, function(){ ShowItemGMap(); })
このコードを削除します</code></pre></div><br><br><b>上記をまとめるとitem.phpについては111行目～130行目を以下のように変更したことになります。</b><br><div><pre><code>変更前
//xoops_module_header
$xoops_module_header = $xoopsTpl-&gt;get_template_vars( &quot;xoops_module_header&quot; ) .&quot;\n&quot; .&quot;&lt;link rel=&#039;stylesheet&#039; type=&#039;text/css&#039; href=&#039;css/gnavi.css&#039;/&gt;&quot;;
if($gnavi_usegooglemap &amp;&amp; (floatval($photo[&#039;lng&#039;])&lt;&gt;0 || floatval($photo[&#039;lat&#039;])&lt;&gt;0 )){
$xoopsTpl-&gt;assign( &#039;map&#039; , _MD_GNAV_MAP_SHOW ) ;
$xoops_module_header .=&quot;&lt;script src=&#039;&quot;.$gnavi_googlemap_url.&quot;/maps/api/js?v=&quot;.$gnavi_gmapapi_ver.&quot;&amp;amp;key=&quot;.$gnavi_googlemapapi_key.&quot;&amp;amp;callback=initMap&#039; type=&#039;text/javascript&#039;&gt;&lt;/script&gt;
&lt;script src=&#039;js/map.js&#039; type=&#039;text/javascript&#039; charset=&#039;utf-8&#039;&gt;&lt;/script&gt;
&lt;script type=&#039;text/javascript&#039;&gt;
//&lt;![CDATA[
$gnavi_lang_java
$mykmls
gn_ilt=&quot;.$photo[&#039;lat&#039;].&quot;;
gn_ilg=&quot;.$photo[&#039;lng&#039;].&quot;;
gn_iz=&quot;.$photo[&#039;zoom&#039;].&quot;;
gn_it=&#039;&quot;.$photo[&#039;mtype&#039;].&quot;&#039;;
&quot;.$arricon.&quot;
google.maps.event.addDomListener(window, &#039;load&#039;, function(){ ShowItemGMap(); });
//]]&gt;
&lt;/script&gt;&quot;;
}

↓変更後
//xoops_module_header
$xoops_module_header = $xoopsTpl-&gt;get_template_vars( &quot;xoops_module_header&quot; ) .&quot;\n&quot; .&quot;&lt;link rel=&#039;stylesheet&#039; type=&#039;text/css&#039; href=&#039;css/gnavi.css&#039;/&gt;&quot;;
if($gnavi_usegooglemap &amp;&amp; (floatval($photo[&#039;lng&#039;])&lt;&gt;0 || floatval($photo[&#039;lat&#039;])&lt;&gt;0 )){
$xoopsTpl-&gt;assign( &#039;map&#039; , _MD_GNAV_MAP_SHOW ) ;
$xoops_module_header .=&quot;
&lt;script src=&#039;js/map.js&#039;&gt;&lt;/script&gt;
&lt;script&gt;
//&lt;![CDATA[
$gnavi_lang_java
$mykmls
gn_ilt=&quot;.$photo[&#039;lat&#039;].&quot;;
gn_ilg=&quot;.$photo[&#039;lng&#039;].&quot;;
gn_iz=&quot;.$photo[&#039;zoom&#039;].&quot;;
gn_it=&#039;&quot;.$photo[&#039;mtype&#039;].&quot;&#039;;
&quot;.$arricon.&quot;;

//]]&gt;
&lt;/script&gt;
&lt;script async src=&#039;&quot;.$gnavi_googlemap_url.&quot;/maps/api/js?v=&quot;.$gnavi_gmapapi_ver.&quot;&amp;amp;key=&quot;.$gnavi_googlemapapi_key.&quot;&amp;amp;callback=ShowItemGMap&#039; &gt;&lt;/script&gt;&quot;;
}</code></pre></div><br>なお、この下の行にあるRSSに関しても同様の場所にasyncを記述追加をしましたがその確認はしていません。<br><br><br>同様に残りの以下3カ所についても同様に変更しています。<br>・xoops_trust_path/modules/gnavi/admin/category.php<br>・xoops_trust_path/modules/gnavi/main/map.php<br>・xoops_trust_path/modules/gnavi/main/submit.php<br>callback=○○の部分については各ファイルによって違いがあります。<br><br>さて、結果ですが、PageSpeed Insightsを利用して計測しましたが読み込みが速くなっています。]]></content:encoded>
  </item>
    <item>
    <title>モバイルでadsenseコードが原因で遅くなる件の対策</title>
    <link>https://www.onwil.com/modules/wilforum/index.php?post_id=800</link>
    <guid>https://www.onwil.com/modules/wilforum/index.php?post_id=800</guid>
    <description></description>
    <pubDate>Mon, 25 Mar 2024 09:33:26 +0900</pubDate>
    <category>XOOPS、パソコン関連</category>
    <category>XOOPS関連フォーラム</category>
    <content:encoded><![CDATA[本サイトはパソコンでもモバイルでも見ることができるレスポンシブで作っています。前々から気になっていたのですが、<a href="https://pagespeed.web.dev/" target="_blank" rel="noopener">PageSpeed Insights</a>で本サイトを計測するとパソコンで見る場合にはそれほどスコアは気にならないのですが、モバイルで見ると極端にスコアが悪くなります。調べてみると大きな原因はadsenseにあるのが分かりました。<br><br>最近はその対策に関するサイトがすぐに見つけられるようになっています。いずれもサイトのページを先に読み込み、操作した時点で広告を表示しようというものです。<br><br>今回2つのサイトを参考にしましたので備忘録として残しておきたいと思います。<br><ol><li><a href="https://qiita.com/ichii731/items/677598548716301e11dc" target="_blank" rel="noopener">AdSenseを遅延読み込みさせるツール作ったらスコアが40点上がった</a>の記事にある<br><a href="https://tools.ic731.net/seo/adsense/" target="_blank" rel="noopener"><b>Google Adsense遅延読み込みコード生成ツール</b></a><br></li><li><a href="https://www.sonohigurashi.blog/20230325-google-adsense-lazy-loading/" target="_blank" rel="noopener">ちょっとよろしくないGoogle AdSenseの遅延ロード用コードが蔓延している件</a>にコードが掲載されています。</li></ol>どちらも試してみましたがモバイルのスコアが劇的に上がりました。動作もスコアもさほど変わりはありません。今のところ２のサイトコードを採用しています。]]></content:encoded>
  </item>
    <item>
    <title>altsys言語定数管理の操作不具合</title>
    <link>https://www.onwil.com/modules/wilforum/index.php?post_id=791</link>
    <guid>https://www.onwil.com/modules/wilforum/index.php?post_id=791</guid>
    <description></description>
    <pubDate>Sat, 17 Feb 2024 20:18:54 +0900</pubDate>
    <category>XOOPS、パソコン関連</category>
    <category>XOOPS関連フォーラム</category>
    <content:encoded><![CDATA[XoopsCubeLegacyのaltsysモジュールの言語定数管理を使って「旅と気ままなフォーラム」(d3forumモジュール)の言語定数を上書きすると一部の言語定数が消えてしまう現象が発生しました。<br><br>結果的に、原因は言語定数の一覧表が表示された時、上書き項目でtextareaの設定初期値では最初から空白、タブが入っていたため、そのまま更新ボタンをクリックしてしまうとデフォルト値が空白、タブに置き換わってしまい、一部の言語定数が消えてしまったというのが原因でした。従って、altsys_main_lang_admin.htmlのテンプレートを編集することで正常に上書きが可能となりました。<br><br>■テンプレートの編集<br>textareaタグの中に空白、タブが入らないようにする<br><div><pre><code>altsys_main_lang_admin.htmlの87行目辺り

&lt;{else}&gt;
&lt;textarea name=&quot;&lt;{$langfile_name|escape}&gt;&quot;
id=&quot;input_&lt;{$langfile_name|escape}&gt;&quot;
&lt;{if $langfile_uservalue}&gt;class=&quot;lang-custom&quot;&lt;{/if}&gt;&quot; data-self=&quot;size-x1&quot;&gt;
&lt;{$langfile_uservalue|escape}&gt;
&lt;/textarea&gt;
&lt;{/if}&gt;

↓変更

&lt;{else}&gt;
&lt;textarea name=&quot;&lt;{$langfile_name|escape}&gt;&quot;
　id=&quot;input_&lt;{$langfile_name|escape}&gt;&quot;
&lt;{if $langfile_uservalue}&gt;class=&quot;lang-custom&quot;&lt;{/if}&gt;&quot; data-self=&quot;size-x1&quot;&gt;&lt;{$langfile_uservalue|escape}&gt;&lt;/textarea&gt;
&lt;{/if}&gt;</code></pre></div>つまり、textareaタグ内にこの部分に空白を入れずに連ねて記述することで空白が入らなくなります。<br><div><pre><code>&lt;{if $langfile_uservalue}&gt;class=&quot;lang-custom&quot;&lt;{/if}&gt;&quot; data-self=&quot;size-x1&quot;&gt;&lt;{$langfile_uservalue|escape}&gt;&lt;/textarea&gt;</code></pre></div><br>あと、データベースのテーブルdb_altsys_language_constantsで値に空白があるものがあったのでPhpMyAdminを利用して削除しました。(更新ボタンを何度かクリックしたのでデータベースの値に空白が入っていました)<br><br>また、言語定数管理のリセットボタンは機能していないようです。変更が可能なので問題はないと思われます。]]></content:encoded>
  </item>
    <item>
    <title>d3forumトピック投稿一覧表の省略化</title>
    <link>https://www.onwil.com/modules/wilforum/index.php?post_id=790</link>
    <guid>https://www.onwil.com/modules/wilforum/index.php?post_id=790</guid>
    <description></description>
    <pubDate>Sat, 17 Feb 2024 16:28:55 +0900</pubDate>
    <category>XOOPS、パソコン関連</category>
    <category>XOOPS関連フォーラム</category>
    <content:encoded><![CDATA[当サイトの「旅と気ままなフォーラム」はXoopsCubeLegacyのd3forumモジュール(バージョン0.89)を利用しています。前々から気になっていたのですが、トピック投稿一覧表では全投稿を表示しているため長くなる場合があり、非常に見辛くなってしまいます。<br><br>そこで、そのトピック投稿一覧表のトップとなる親投稿に関しては全文を表示し、その子投稿については表示を省略した上で「詳細を見る！」というリンクを付加しトピック投稿一覧表を短縮できないかと編集してみました。<br><br>大まかな手順は、テンプレートinc_eachpost.htmlの本文を省略した新たなテンプレートinc_eachpost_s.htmlを作成し、一覧表ではこの省略したテンプレートを表示させるというものです。<br><br>今回この編集手順を記録し、今後のことも考え備忘録として残しておくことにしました。<br><br>■新たなテンプレートinc_eachpost_sを作成する<br><b>1.xoops_trust_path/templates/inc_eachpost_s.htmlファイルを作成</b><br>inc_eachpost.htmlのテンプレートをコピーし名前を変更してinc_eachpost_s.htmlとして新たなテンプレートを作ります。<br><br><b>2.xoops_trust_path/language/ja_utf8/main内に言語定数の追加(他言語も同様に追加すればなお良いと思います)</b><br><div><pre><code>// inc_eachpost.html
define(&#039;_MD_D3FORUM_UNIQUEPATHPREFIX&#039;,&#039;msg#&#039;);
define(&#039;_MD_D3FORUM_PARENTPOST&#039;,&#039;親投稿&#039;);
define(&#039;_MD_D3FORUM_CHILDPOSTS&#039;,&#039;子投稿&#039;);
define(&#039;_MD_D3FORUM_NOCHILDPOSTS&#039;,&#039;子投稿なし&#039;);
define(&#039;_MD_D3FORUM_READMORE&#039;,&#039;詳細を見る！&#039;); ←追加</code></pre></div><br><b>3.d3forumモジュールのアップデート</b><br>サイトにログインし、システム設定からd3forumモジュールのアップデートを行います。これで新たなテンプレートinc_eachpost_sと「詳細を見る！」言語定数が追加されます。<br><br>■各テンプレートを編集する<br><b>1.d3forum名_inc_eachpost_s.htmlテンプレートの編集</b><br>d3forum名_inc_eachpost.htmlとの違いは、テキスト内の文字列を strip_tags:false　で　HTML および PHP タグを取り除き、さらに　mb_strimwidth:0:256:&quot;...&quot;でテキストの文字を省略し最後に&quot;...&quot;を付加し「...詳細を見る！」としてリンクします。<br>実際には<div><pre><code>&lt;{$post.post_text&gt;の部分を
↓変更
&lt;{$post.post_text|strip_tags:false|mb_strimwidth:0:256:&quot;...&quot;}&gt;&lt;a href=&quot;&lt;{$mod_url}&gt;/index.php?post_id=&lt;{$post.id}&gt;&quot; id=&quot;post_path&lt;{$post.unique_path}&gt;&quot; &gt;&lt;{$smarty.const._MD_D3FORUM_READMORE}&gt;&lt;/a&gt;</code></pre></div>となります。さらにこのd3forum名_inc_eachpost_s.htmlテンプレートでは本文以外にも省略するため、投票ボタンも外しました。<br><br><br><b>2.d3forum名_main_listpostsテンプレートの編集</b><br>トピック投稿一覧表の一番最初の投稿は全文表示(d3forum名_inc_eachpost.html)のテンプレートを使い、２番目以降は本文を省略した表示(d3forum名_inc_eachpost_s.html))のテンプレートを使い分けます。<br><div><pre><code>&lt;!-- top of posts --&gt;
&lt;{foreach item=post from=$posts}&gt;
&lt;{include file=&quot;db:`$mydirname`_inc_eachpost.html&quot; post=$post caller=&quot;listposts&quot; inner_link_format=&quot;#post_id%s&quot;}&gt;
&lt;hr&gt;
&lt;{/foreach}&gt;
↓　変更

&lt;!-- top of posts --&gt;
&lt;{foreach item=post from=$posts name=loopname}&gt;
&lt;{if $smarty.foreach.loopname.index &lt; 1 }&gt;
&lt;{include file=&quot;db:`$mydirname`_inc_eachpost.html&quot; post=$post caller=&quot;listposts&quot; inner_link_format=&quot;#post_id%s&quot;}&gt;
&lt;{else}&gt;
&lt;{include file=&quot;db:`$mydirname`_inc_eachpost_s.html&quot; post=$post caller=&quot;listposts&quot; inner_link_format=&quot;#post_id%s&quot;}&gt;
&lt;{/if}&gt;
&lt;hr&gt;
&lt;{/foreach}&gt;\</code></pre></div>さらに、このままだとトピック投稿一覧表の投稿ツリーのリンクをクリックすると省略された投稿が表示されるため<br><div><pre><code>&lt;!-- start post tree --&gt;
～
この間の中央辺りにあるコード
&lt;a href=&quot;#post_id&lt;{$eachpost.id}&gt;&quot;
↓変更
&lt;a href=&quot;index.php?post_id=&lt;{$eachpost.id}&gt;&quot;
～
&lt;!-- end post tree --&gt;</code></pre></div>と変更します。<br><br><b>3.d3forum名_main_listtopics_over_categories.html,d3forum名_main_listtopics.htmlの編集</b><br>この２つのテンプレートについてもリンクをクリックすると省略された投稿が表示されるため、それぞれ以下のように編集します。<br><div><pre><code>d3forum名_main_listtopics.html(全トピック一覧リンク)　
120行目辺り
d3forum名_main_listtopics.htmlt(カテゴリトピックリンク)
168行目辺り

２つとも同様に
&lt;a href=&quot;&lt;{$mod_url}&gt;/index.php?topic_id=&lt;{$topic.id}&gt;#post_id&lt;{$topic.last_post_id}&gt;&quot;&gt;&lt;{$topic.title}&gt;&lt;/a&gt;
↓変更
&lt;a href=&quot;&lt;{$mod_url}&gt;/index.php?post_id=&lt;{$topic.last_post_id}&gt;&quot;&gt;&lt;{$topic.title}&gt;&lt;/a&gt;</code></pre></div><br>以上です。今後もし不具合があり編集あるいはもとに戻すことも可能なので備忘録として残しておきます]]></content:encoded>
  </item>
    <item>
    <title>Re: 画像掲示板の一覧表で詳細の文字列を丸める</title>
    <link>https://www.onwil.com/modules/wilforum/index.php?post_id=789</link>
    <guid>https://www.onwil.com/modules/wilforum/index.php?post_id=789</guid>
    <description></description>
    <pubDate>Sun, 11 Feb 2024 10:20:30 +0900</pubDate>
    <category>XOOPS、パソコン関連</category>
    <category>XOOPS関連フォーラム</category>
    <content:encoded><![CDATA[今さらですが、前回に続き、画像掲示板でログインして一覧表を表示すると記事が丸められなくなり、記事全てが表示されるのが気になり修正することにしました。今回はテンプレートを１つ追加することによってログインの如何に関わらず編集、追加のプレビューではすべてを表示し、一覧表では丸めて表示するという方法です。<br><br>具体的には、前回の&#039;sdescription&#039; を利用することは同じですが、myalbum_photo_in_list.htmと新たにmyalbum_photo_in_list_sというテンプレートを作り、使い分けることとしました。<br><br>■新たなテンプレートを作成する<br>1.myalbumモジュールのtemplatesフォルダのmyalbum_photo_in_list.htmlをコピーし、名前を変更し新たにmyalbum_photo_in_list_s.htmlを作成します。<br><br>2.これは意味があるのか定かではありませんが、同じくmyalbumモジュールのtemplatesフォルダmk_template.shのファイルに以下のコードを追加します。<br><div><pre><code>cp -a myalbum_photo_in_lists.html myalbum$1_photo_in_list_s.html</code></pre></div><br>3.myalbumモジュールのxoops_version.phpの// Templatesの場所に以下を追加します<br><div><pre><code>$modversion[&#039;templates&#039;][12][&#039;file&#039;] = &quot;myalbum{$mydirnumber}_photo_in_list_s.html&quot; ;
$modversion[&#039;templates&#039;][12][&#039;description&#039;] = &#039;&#039;;</code></pre></div><br>4.システム設定のモジュール管理にてmyalbumモジュールのアップデートを行います。(オリジナルのテンプレートを利用していると変更する場合があるので注意が必要です。)<br><br>■テンプレートの変更<br>以上でテンプレートmyalbum_photo_in_list_s.htmlが追加されます。myalbum_photo_in_list.htmlとmyalbum_photo_in_list_s.htmlのテンプレート内容は同一にし、以下の部分だけを変更します。<br><br>1.myalbum_photo_in_list.htmlのテンプレート<br><div><pre><code>&lt;{* DESCRIPTION *}&gt;
&lt;{if $photo.description}&gt;
&lt;table border=&#039;0&#039; cellpadding=&#039;0&#039; cellspacing=&#039;0&#039; width=&#039;100%&#039; class=&#039;outer&#039;&gt;
&lt;tr&gt;
&lt;td class=&#039;odd&#039;&gt;
&lt;{if $photo.description}&gt;
<span style="color: #ff0000;">&lt;{$photo.description}&gt;</span>
&lt;{/if}&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;{/if}&gt;</code></pre></div><br>2.myalbum_photo_in_list_s.htmのテンプレート<br><div><pre><code>&lt;{* DESCRIPTION *}&gt;
&lt;{if $photo.description}&gt;
&lt;table border=&#039;0&#039; cellpadding=&#039;0&#039; cellspacing=&#039;0&#039; width=&#039;100%&#039; class=&#039;outer&#039;&gt;
&lt;tr&gt;
&lt;td class=&#039;odd&#039;&gt;
&lt;{if $photo.description}&gt;
<span style="color: #ff0000;">&lt;{$photo.sdescription}&gt;</span>
&lt;{/if}&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;{/if}&gt;</code></pre></div><br>さらに<br>3.myalbum_viewcat_list.htmlのテンプレートで<br><div><pre><code>db:myalbum_photo_in_list.htm　→　db:myalbum_photo_in_list_s.htm</code></pre></div><br>4.myalbum_index.htmlのテンプレートで<br><div><pre><code>db:myalbum_photo_in_list.htm →　db:myalbum_photo_in_lists.htm</code></pre></div><br>これでログインするしないに関わらず一覧表では記事が丸められて表示されるようになりました。]]></content:encoded>
  </item>
    <item>
    <title>GPTBotの巡回</title>
    <link>https://www.onwil.com/modules/wilforum/index.php?post_id=764</link>
    <guid>https://www.onwil.com/modules/wilforum/index.php?post_id=764</guid>
    <description></description>
    <pubDate>Mon, 21 Aug 2023 08:22:39 +0900</pubDate>
    <category>XOOPS、パソコン関連</category>
    <category>XOOPS関連フォーラム</category>
    <content:encoded><![CDATA[最近、当弱小Webサイトのアクセス数が一挙に10倍以上に上がり驚いていました。原因を調べてみるとGPTBotのクローラー巡回でした。<br>このGPTBotは<br>引用：<div><blockquote>https://platform-openai-com.translate.goog/docs/gptbot?_x_tr_sl=auto&amp;_x_tr_tl=ja&amp;_x_tr_hl=ja&amp;_x_tr_pto=wapp<br>GPTBot ユーザー エージェントでクロールされた Web ページは、将来のモデルを改善するために使用される可能性があり、ペイウォール アクセスを必要とするソース、個人を特定できる情報 (PII) を収集することが知られているソース、またはポリシーに違反するテキストを含むソースを削除するためにフィルタリングされます。GPTBot がサイトにアクセスできるようにすると、AI モデルの精度が向上し、一般的な機能と安全性が向上します。以下では、GPTBot によるサイトへのアクセスを禁止する方法も紹介します。<br></blockquote></div>従って、このクローラーの違いは他のクローラーが検索サイトに登録をするのに対して、AI モデルの精度の向上を目的としている点です。Webページとしてはメリットはあまり無いようです。<br><br>当Webページは多くの人に見てもらうこと、参考にしてもらうことを目的としていますので害がなくプライバシーが守られるのであれば特に拒否する必要もないかと考えています。もし正しく利用され発展に少しでも寄与できるのであれば特に問題はないと思います。<br><br>ここには拒否する方法としてrobots.textに記述する方法が書かれています。しかし、この方法を利用する場合、既存のXoops Cube Legacyのrobots.textに具体的にどう追加記述したらよいのかよく分かりません。試してはいませんが、ひょっとしたら以下をprotectorのIP拒否リストに列挙すると効果があるかも知れません。<br>20.15.240.64/28<br>20.15.240.80/28<br>20.15.240.96/28<br>20.15.240.176/28<br>20.15.241.0/28<br>20.15.242.128/28<br>20.15.242.144/28<br>20.15.242.192/28<br>40.83.2.64/28]]></content:encoded>
  </item>
    <item>
    <title>Re: 再考-picoモジュールで記事の先頭にメニューを設置したい。</title>
    <link>https://www.onwil.com/modules/wilforum/index.php?post_id=735</link>
    <guid>https://www.onwil.com/modules/wilforum/index.php?post_id=735</guid>
    <description></description>
    <pubDate>Sat, 25 Feb 2023 05:02:39 +0900</pubDate>
    <category>XOOPS、パソコン関連</category>
    <category>XOOPS関連フォーラム</category>
    <content:encoded><![CDATA[この度、phpのバージョンアップを機にpicoモジュールで記事の先頭のメニューを再考しました。この記事のように先頭にメニューを表示するとメニューが多い場合は記事が下の方に表示され見にくいのでアコーディオンメニューにして記事ができるだけすぐに見えるようにしてみました。<br><br>前回のように新しくテンプレートを作成するのではなく既存のテンプレートを編集することにしました。<br><br>■編集するテンプレートは以下の2つです。<br>・モジュール名_block_subcategories.html(サブカテゴリー一覧ブロックのテンプレートです)<br>→メニューとして利用<br><div><pre><code>&lt;{* Dev-Mode Toggle *}&gt;
&lt;{if $xoops_isadmin}&gt;&lt;div class=&quot;ui-dev-mode&quot;&gt;&lt;{$smarty.template}&gt;&lt;/div&gt;&lt;{/if}&gt;

&lt;div class=&quot;acd-menu&quot;&gt;
&lt;label class=&quot;acd-label&quot; for=&quot;Panel-subcategories&quot;&gt;カテゴリ一覧&lt;/label&gt;
&lt;input type=&quot;checkbox&quot; id=&quot;Panel-subcategories&quot; class=&quot;on-off&quot;/&gt;
&lt;ul&gt;
&lt;{foreach item=category from=$block.categories}&gt;

&lt;li&gt;
&lt;a href=&quot;&lt;{$block.mod_url}&gt;/&lt;{$category.link}&gt;&quot;&gt;
&lt;{$category.title}&gt;
&lt;/a&gt;
&lt;/li&gt;
&lt;{/foreach}&gt;
&lt;/ul&gt;

&lt;/div&gt;</code></pre></div><br>・モジュール名__block_menu(メニューブロックのテンプレートです)<br>→カテゴリメニューとして利用<br><div><pre><code>&lt;{* Dev-Mode Toggle *}&gt;
&lt;{if $xoops_isadmin}&gt;&lt;div class=&quot;ui-dev-mode&quot;&gt;&lt;{$smarty.template}&gt;&lt;/div&gt;&lt;{/if}&gt;

&lt;{foreach item=category from=$block.categories}&gt;

&lt;{if $category.id == $smarty.get.cat_id }&gt;

&lt;{foreach key=key item=content from=$category.contents}&gt;

&lt;{if $block.mod_url|cat:&quot;/&quot;|cat:$content.link == $xoops_url|cat:$smarty.server.REQUEST_URI}&gt;

&lt;div class=&quot;acd-menu&quot;&gt;
&lt;label class=&quot;acd-label&quot; for=&quot;Panel1&quot;&gt;カテゴリ内メニュー&lt;/label&gt;
&lt;input type=&quot;checkbox&quot; id=&quot;Panel1&quot; class=&quot;on-off&quot;/&gt;
&lt;ul&gt;&lt;{foreach item=content from=$category.contents}&gt;
&lt;{if $smarty.server.QUERY_STRING == &#039;content_id=&#039;|cat:$content.id}&gt;
&lt;li style=&quot;background:#ffffcc;&quot;&gt;&lt;{$content.subject}&gt;&lt;/li&gt;
&lt;{else}&gt;
&lt;li&gt;&lt;a href=&quot;&lt;{$block.mod_url}&gt;/&lt;{$content.link}&gt;&quot; title=&quot;&lt;{$block.lang_lastupdated}&gt;:&lt;{$content.created_time_formatted}&gt;&quot;&gt;&lt;{$content.subject}&gt;&lt;/a&gt;&lt;/li&gt;
&lt;{/if}&gt;
&lt;{/foreach}&gt;
&lt;/ul&gt;

&lt;/div&gt;
&lt;{/if}&gt;
&lt;{/foreach}&gt;
&lt;{/if}&gt;
&lt;{/foreach}&gt;
&lt;hr&gt;</code></pre></div><br>■編集後、利用しているthemeのcssにアコーディオンメニューが利用できるようにコードを追加します。<br><div><pre><code>/* --------- acordion menuの為のcss ---------- */
.acd-menu {
height: auto;
width: auto;
margin: auto;
padding: auto;
background: #eee;
}

.acd-label {
background: #333;
color: #fff;
font-weight:600;
text-align:center;
padding: 10px;
display: block;
margin: 0;
border: 1px solid #fff;
cursor: pointer;
}

.acd-label:hover {
background: #ff0000;
}

input[type=&quot;checkbox&quot;].on-off{
display: none;
}

.acd-menu ul {
-webkit-transition: all 0.5s;
-moz-transition: all 0.5s;
-ms-transition: all 0.5s;
-o-transition: all 0.5s;
transition: all 0.5s;
margin:auto;
padding: 1rem;
list-style: none;
}

.acd-menu li {
padding: .3rem;

}

input[type=&quot;checkbox&quot;].on-off + ul{
display: none;
}

input[type=&quot;checkbox&quot;].on-off:checked + ul{
display: block;
}</code></pre></div><br>■ALTSYSブロック管理にて設定<br>ブロック管理にて記事の上の場所に2つのブロックを配置し、タイトル名はそのままだとダブって表示されるのでタイトルの後に「none」を入れて元のタイトルは表示しないようにします。<br><br>今のところpicoモジュールを利用しているものについて全部（ソロツーリングを楽しもう！、バイクメンテとD.I.Y、世界一周の旅を楽しもう！、趣味を楽しもう）に反映しています。ただし、この方法では子カテゴリまでは反映できますが、その下のカテゴリには反映されません。また、同様の方法でgnavi(ソロツーリングと旅の地図、世界の旅と地図、明石駅前観光と全国宿特集)にも反映しました。]]></content:encoded>
  </item>
    <item>
    <title>liaiseモジュールphp7への対応 </title>
    <link>https://www.onwil.com/modules/wilforum/index.php?post_id=729</link>
    <guid>https://www.onwil.com/modules/wilforum/index.php?post_id=729</guid>
    <description></description>
    <pubDate>Wed, 15 Feb 2023 06:46:34 +0900</pubDate>
    <category>XOOPS、パソコン関連</category>
    <category>XOOPS関連フォーラム</category>
    <content:encoded><![CDATA[問い合わせモジュールの1つで、他にもあるかもしれませんが今まで使っていたので編集し利用できるようになりました。<a href="https://ja.osdn.net/projects/xoops4u/releases/p13004" target="_blank" rel="noopener">XOOPS for you</a>サイトからliaise_131をダウンロードしたものです。画像認証capchaとセットで利用することができます。以下編集内容の記録です。<br><br>■php7バージョンアップ対応による修正(construct部分)<br><div><pre><code>・html/modules/liaise/class/forms.php line
68行目
function LiaiseFormsHandler(&amp;$db){
↓変更
function __construct(&amp;$db){</code></pre></div><br><div><pre><code>・html/modules/liaise/class/elementlender.php
50行目
function LiaiseElementRenderer(&amp;$element){
↓変更
function __construct(&amp;$element){</code></pre></div><br><div><pre><code>・html/modules/liaise/class/element.php
43行目
function LiaiseElements(){
$this-&gt;XoopsObject();
↓変更
function __construct(){
parent::__construct();
65行目
function LiaiseElementsHandler(&amp;$db) {
↓変更
function __construct(&amp;$db) {</code></pre></div><br><div><pre><code>・html/modules/liaise/class/uploader.php
115行目
function LiaiseMediaUploader($uploadDir=null, $maxFileSize=0, $allowedExtensions=0, $allowedMimeTypes=0, $maxWidth=0, $maxHeight=0){
↓変更
function __construct($uploadDir=null, $maxFileSize=0, $allowedExtensions=0, $allowedMimeTypes=0, $maxWidth=0, $maxHeight=0){</code></pre></div><br>■php7でeachコマンドが非推奨の件<br>each()が使われているパターン全ての箇所を変更<br>例)<br><div><pre><code>・html/liaise/class/elementrender.php
246
while( $i = each($ele_value) ){
↓変更
$i = ;
foreach($ele_value as $i[&#039;key&#039;] =&gt; $val){
$i[&#039;value&#039;] = $val;</code></pre></div>他にも同様のパターンがありますが全て同じパターンで編集しましたがうまく動作しているようです。<br><br>また、管理画面で<br>コンタクトフォーム作成で<br>「XOOPSのバージョンがこのモジュールの動作する条件を満たしていません。Liaiseは適正に働かないかもしれません。」<br>と表示されていましたが今の所うまくできているようです。ただし、PhpMyAdminでデータベースをインポートする際にはエラーが発生しました。]]></content:encoded>
  </item>
    <item>
    <title>d3forumモジュールphp7への対応</title>
    <link>https://www.onwil.com/modules/wilforum/index.php?post_id=728</link>
    <guid>https://www.onwil.com/modules/wilforum/index.php?post_id=728</guid>
    <description></description>
    <pubDate>Wed, 15 Feb 2023 06:39:59 +0900</pubDate>
    <category>XOOPS、パソコン関連</category>
    <category>XOOPS関連フォーラム</category>
    <content:encoded><![CDATA[XOOPS Cubeでダウンロードしたlegacy-php74に含まれているd3forumを利用しようと思いましたが、思いのほか使っていると崩れてきたりそもそもテンプレートが合わない部分がある為、XOOPS Xよりダウンロードした<a href="https://github.com/XoopsX/d3forum" target="_blank" rel="noopener">d3forum0.89.5</a>を利用することにしました。編集することはほぼなくそのまま使えそうでしたが一部変更しています。<br><br>■Warningが出ていたので編集<br>xoops_trust_path/modules/d3forum/d3forum.textsanitizer.php<br><div><pre><code>23行目
function &amp;getInstance()
↓変更
public static function &amp;getInstance()</code></pre></div><br><br>■Rssが正常に表示されない件<br>(d3forum0.89.5,最新のものも同様)<br><ol><li>create_functionが非推奨となり正常に動作せずRSSが取得できなかった<br>・xoops_trust_path/modules/d3forum/include/rss_functions.php<br><div><pre><code>135行目辺り　
$strcut = create_function ( &#039;$a,$b,$c&#039;, (function_exists(&#039;mb_strcut&#039;))?
            &#039;return mb_strcut($a,$b,$c);&#039;:
            &#039;return strcut($a,$b,$c);&#039;);

↓変更
if (function_exists(&#039;mb_strcut&#039;)) {
        $strcut = function($a,$b,$c) {return mb_strcut($a,$b,$c);};
        } else {
        $strcut = function($a,$b,$c) {return strcut($a,$b,$c);};
        }</code></pre></div></li><li>他にも１つRSSが取得できない問題があり、原因は各カテゴリの説明文に&lt;br&gt;、空白が入ると取得できないものでした。</li></ol>あとは<br>array()を&lbrack;&rbrack;に全て変換しました。<br> ]]></content:encoded>
  </item>
    <item>
    <title>Re: bulletinモジュールphp7への対応</title>
    <link>https://www.onwil.com/modules/wilforum/index.php?post_id=725</link>
    <guid>https://www.onwil.com/modules/wilforum/index.php?post_id=725</guid>
    <description></description>
    <pubDate>Sat, 11 Feb 2023 18:29:31 +0900</pubDate>
    <category>XOOPS、パソコン関連</category>
    <category>XOOPS関連フォーラム</category>
    <content:encoded><![CDATA[作業中に<a href="https://github.com/xoopscube" target="_blank" rel="noopener">Xoopscube</a>のサイトで新しく<a href="https://github.com/xoopscube/bulletin" target="_blank" rel="noopener">bulletinモジュール</a>最新版が出ていたのでこれを採用しました。]]></content:encoded>
  </item>
    <item>
    <title>Re: logcounterxモジュールphp7への対応</title>
    <link>https://www.onwil.com/modules/wilforum/index.php?post_id=724</link>
    <guid>https://www.onwil.com/modules/wilforum/index.php?post_id=724</guid>
    <description></description>
    <pubDate>Sat, 11 Feb 2023 18:24:19 +0900</pubDate>
    <category>XOOPS、パソコン関連</category>
    <category>XOOPS関連フォーラム</category>
    <content:encoded><![CDATA[作業中に<a href="https://github.com/xoopscube" target="_blank" rel="noopener">Xoopscube</a>のサイトで新しく<a href="https://github.com/xoopscube/logcounterx" target="_blank" rel="noopener">logcountexモジュール</a>が出ていたのでこれを採用しました。]]></content:encoded>
  </item>
    <item>
    <title>Re: Gnaviモジュールphp7への対応(追加)</title>
    <link>https://www.onwil.com/modules/wilforum/index.php?post_id=723</link>
    <guid>https://www.onwil.com/modules/wilforum/index.php?post_id=723</guid>
    <description></description>
    <pubDate>Sat, 11 Feb 2023 17:19:35 +0900</pubDate>
    <category>XOOPS、パソコン関連</category>
    <category>XOOPS関連フォーラム</category>
    <content:encoded><![CDATA[今回最も厄介だったのがこのGnaviモジュールでした。<br>以下の編集を追加しインストールしたものの地図表示では一覧表が表示されなかったり地図自体が一部しか表示されなかったりとGnavi1.06では不具合が生じたので、以前利用していたGnavi1.05に変更しました。Gnavi1.05も編集の方法はほぼ一緒です。私はパソコンですが、今の所正常に表示されています。<br><br>編集個所についてはwebphotoと同様<br>■編集基本パターン<br>・__construct,parent::__construct,public staticの変更パターン（ほぼ全てのファイル）<br><div><pre><code>class A exend B{
function A(){
this -&gt; B()
}
function &amp;getInstance(){
}
}
変更↓
class A exend B{
function __construct(){
parent::__construct()
}
public static function &amp;getInstance(){
}
}</code></pre></div>となります。<br><br>■以下前記事の追加として挙げておきます。<br>xoops_trust_path/libs/qrcode/qrcode_img.php<br><div><pre><code>17行目
function Qrcode_image(){
$this-&gt;Qrcode();
↓
function __construct(){
parent::__construct();</code></pre></div><br>xoops_trust_path/libs/qrcode/qrcode_img.php<br><div><pre><code>12行目
class Qrcode{
↓
class __construct{</code></pre></div><br>xoops_trust_path/modules/gnavi/admin/mygroupepermform.php<br><div><pre><code>82行目
$this-&gt;XoopsForm($title, &#039;groupperm_form&#039;, &#039;&#039; , &#039;post&#039;);
↓
parent::__construct($title, &#039;groupperm_form&#039;, &#039;&#039; , &#039;post&#039;);</code></pre></div><br>xoops_trust_path/modules/gnavi/class/GnaviExif.class.php<br><div><pre><code>8行目
function GnaviExif($file = null) {
↓
function __construct($file = null) {</code></pre></div><br>■サイトマップにGnaviが対応できなかったのでコードを編集しました。2024年4月17日各Gnaviモジュールでサイトマップが反映されないためさらに変更しました。<br>xoops_trust_path/modules/gnavi/include/sitemap.plugin.php<br><div><pre><code>&lt;?php
function b_sitemap_gnavi( $mydirname ){
$db = Database::getInstance();
$ret = sitemap_get_categoires_map($db-&gt;prefix($mydirname.&quot;_cat&quot;), &quot;cid&quot;, &quot;pid&quot;, &quot;title&quot;, &quot;index.php?cid=&quot;, &quot;title&quot;);
return $ret;
}

↓変更　sitemapのものを転用(2024年4月17日追加変更)

&lt;?php
// FILE :: myalbum.php
// AUTHOR :: suin &lt;tms@s10.xrea.com&gt;
// WEB :: AmethystBlue &lt;http://www.suin.jp/&gt;
// DATE :: 2005-02-15
function b_sitemap_gnavi($mydirname){
$db =&amp; Database::getInstance();
$block = sitemap_get_categories_map($db-&gt;prefix($mydirname.&quot;_cat&quot;), &quot;cid&quot;, &quot;pid&quot;, &quot;title&quot;, &quot;index.php?cid=&quot;, &quot;title&quot;);
return $block;
}</code></pre></div><br>■地図表示にてinfowindowで写真と文章が重なる現象がありました。<br>これは一般設定にて「サムネイル画像サイズ(pixel) 」を168pxにすると正常に表示されました。<br><br>■編集モードに遷移しないエラー(2023/03/11追加)<br>・xoops_trust_path/modules/gnavi/main/submit.php<br><div><pre><code>681行目
// Show the form
OpenTable() ;

↓変更
// Show the form
include_once( XOOPS_ROOT_PATH.&quot;/include/cp_functions.php&quot; ) ;
OpenTable() ;</code></pre></div>]]></content:encoded>
  </item>
    <item>
    <title>captchaモジュールphp7への対応</title>
    <link>https://www.onwil.com/modules/wilforum/index.php?post_id=721</link>
    <guid>https://www.onwil.com/modules/wilforum/index.php?post_id=721</guid>
    <description></description>
    <pubDate>Tue, 29 Nov 2022 05:51:43 +0900</pubDate>
    <category>XOOPS、パソコン関連</category>
    <category>XOOPS関連フォーラム</category>
    <content:encoded><![CDATA[captchaモジュールは登録の際、画像認証をするためのモジュールです。このサイトもcaptchaモジュールを利用しています。さて、でXoopsXより最新の<a href="https://github.com/XoopsX/captcha" target="_blank" rel="noopener">captchaモジュール</a>version0.22をローカル環境(サーバーxampp7.4.25、legacy-2.3を起用)にインストールし各ファイルを以下のように編集してみました。<br><br>■1.PHP7へのバージョンアップによる書式変更（__construct部分等）<br>・captcha/class/captcha_x/class.captcha_x.php<br><div><pre><code>104行目
function captcha_x () {
↓変更
function __construct() {</code></pre></div>・captcha/class/captcha_api.php<br><div><pre><code>33行目
function captcha_api()
↓変更
function __construct()</code></pre></div><br>■2.PHP7での配列書式変更<br>変更対象ファイル<br><div><pre><code>例)$name = array()
変更↓
$name = ;</code></pre></div><br>今の所うまく動作しているようです。]]></content:encoded>
  </item>
    <item>
    <title>logcounterxモジュールphp7への対応</title>
    <link>https://www.onwil.com/modules/wilforum/index.php?post_id=720</link>
    <guid>https://www.onwil.com/modules/wilforum/index.php?post_id=720</guid>
    <description></description>
    <pubDate>Sat, 19 Nov 2022 19:30:39 +0900</pubDate>
    <category>XOOPS、パソコン関連</category>
    <category>XOOPS関連フォーラム</category>
    <content:encoded><![CDATA[続いて、logcounterxモジュールphp7への対応です。他に編集したモジュールと同様、<a href="http://xoops.taquino.net/modules/mydownloads/" target="_blank" rel="noopener">xoops.taquino.net</a>さんのサイトよりlogcounterxジュール(バージョン2.74)をダウンロードし、<a href="http://pcboy.mydns.jp/xoopscube/modules/pico/index.php?content_id=29" target="_blank" rel="noopener">JJ1RLWのXOOPS Cube Site</a>さんのサイトを参考に編集しました。<br><br>JJ1RLWのXOOPS Cube Siteさんのサイトから<br>引用：<div><blockquote>logcounterx Ver 2.74のUTF-8、MySQL、PHP7対応<br><br>XOOPS Cubeで使っているモジュールのlogcounterx Ver 2.74のUTF-8、MySQL、PHP7対応するため、お得意の「ちょっとだけ改造」をしています。<br><br>eregi系関数が非推奨なった事への対応<br>admin/myblockform.php<br>admin/uaos.php<br>include/functions.php<br>eregi()をpreg_match()にすべて変更する。<br><br>例<br>eregi( &quot;MSIE[^;]*&quot; , $browser , $msie )<br>を<br>preg_match( &#039;/MSIE[^;]*/i&#039; , $browser , $msie )<br>に変更。<br><br><br>xpressを導入してWordPressを使うとにUTCとなることへの対応で、UTCからJSTを使う様に<br>blocks/count_up.php<br>56行目<br>date_default_timezone_set(&quot;Asia/Tokyo&quot;);<br>を追加。<br><br>eregi系関数が非推奨なった事への対応<br>98行目<br>if (eregi(&#039;Robot&#039;, lcx_ua2br($UserAgent))) {<br>を<br>if (preg_match(&#039;/Robot/i&#039;, lcx_ua2br($UserAgent))) {<br>に変更。<br><br>リモートアドレスが更新されない問題への対応<br>130-131行目<br>if (($RemoteAddr == $RemoteHost) &amp;&amp; ($CONF[&#039;USE_GET_HOST&#039;])) { $RemoteHost = gethostbyaddr($RemoteAddr); $slashedRH = addslashes($RemoteHost); } else { $slashedRH = &#039;&#039;; }<br>if ((trim($HttpReferer) != &#039;&#039;) &amp;&amp; !preg_match(&#039;/^(http:\/\/|https:\/\/|ftp:\/\/)/&#039;, trim($HttpReferer))) {<br>を<br>if (($RemoteAddr == $RemoteHost) &amp;&amp; ($CONF[&#039;USE_GET_HOST&#039;])) { $RemoteHost = gethostbyaddr($RemoteAddr); } else { $slashedRH = &#039;&#039;; }<br>if ((trim($HttpReferer) != &#039;&#039;) &amp;&amp; !preg_match(&#039;/^(http:\/\/|https:\/\/|ftp:\/\/)/i&#039;, trim($HttpReferer))) {<br>に変更。<br><br>137行目<br>$sql = &quot;INSERT INTO &quot;.$xoopsDB-&gt;prefix(&quot;logcounterx_log&quot;).<br>&quot; (remote_host, user_agent, path_info, referer, acccnt, uname, accday, acctime, accwday)&quot; .<br>&quot; VALUES &quot; .<br>&quot; (&#039;$slashedRH&#039;, &#039;&quot;.addslashes($UserAgent).&quot;&#039;, &#039;&quot;.addslashes($PathInfo).&quot;&#039;,&quot;.<br>を<br>$slashedRemoteAddr = addslashes($RemoteAddr);<br>$slashedRemoteHost = addslashes($RemoteHost);<br>$sql = &quot;INSERT INTO &quot;.$xoopsDB-&gt;prefix(&quot;logcounterx_log&quot;).<br>&quot; (remote_host, user_agent, rh_short, path_info, referer, acccnt, uname, accday, acctime, accwday)&quot; .<br>&quot; VALUES &quot; .<br>&quot; (&#039;$slashedRemoteAddr&#039;, &#039;&quot;.addslashes($UserAgent).&quot;&#039;, &#039;$slashedRemoteHost&#039;, &#039;&quot;.addslashes($PathInfo).&quot;&#039;,&quot;.<br>に変更。<br><br>xpressを導入してWordPressを使うとにUTCとなることへの対応で、UTCからJSTを使う様に<br>blocks/display.php<br>16行目<br>date_default_timezone_set(&quot;Asia/Tokyo&quot;);<br>を追加。<br><br>include/functions.php<br>解析できるOSを追加<br>19行目<br>if (eregi(&#039;Windows NT 5\.1&#039;, $agent) || eregi(&#039;WinNT 5\.1&#039;, $agent)) { return &#039;WinXP&#039;; }<br>if (eregi(&#039;Windows NT 6\.0&#039;, $agent) || eregi(&#039;WinNT 6\.0&#039;, $agent)) { return &#039;WinVista&#039;; }<br>if (eregi(&#039;Windows NT 6\.1&#039;, $agent) || eregi(&#039;WinNT 6\.1&#039;, $agent)) { return &#039;Windows7&#039;; }<br>if (eregi(&#039;Windows NT&#039;, $agent) || eregi(&#039;WinNT&#039;, $agent)) { return &#039;WinNT&#039;; }<br>を<br>if (preg_match(&#039;/Windows NT 5\.1/i&#039;,$agent) || preg_match(&#039;/WinNT 5\.1/i&#039;,$agent)) { return &#039;WinXP&#039;; }<br>if (preg_match(&#039;/Windows NT 5\.2/i&#039;,$agent) || preg_match(&#039;/WinNT 5\.2/i&#039;,$agent)) { return &#039;Win2003&#039;; }<br>if (preg_match(&#039;/Windows NT 6\.0/i&#039;,$agent) || preg_match(&#039;/WinNT 6\.0/i&#039;,$agent)) { return &#039;WinVista&#039;; }<br>if (preg_match(&#039;/Windows NT 6\.1/i&#039;,$agent) || preg_match(&#039;/WinNT 6\.1/i&#039;,$agent)) { return &#039;Windows7&#039;; }<br>if (preg_match(&#039;/Windows NT 6\.2/i&#039;,$agent) || preg_match(&#039;/WinNT 6\.2/i&#039;,$agent)) { return &#039;Windows8&#039;; }<br>if (preg_match(&#039;/Windows NT 6\.3/i&#039;,$agent) || preg_match(&#039;/WinNT 6\.3/i&#039;,$agent)) { return &#039;Windows8.1&#039;; }<br>if (preg_match(&#039;/Windows NT 10/i&#039;,$agent) || preg_match(&#039;/WinNT 10/i&#039;,$agent)) { return &#039;Windows10&#039;; }<br>if (preg_match(&#039;/Windows NT/i&#039;,$agent) || preg_match(&#039;/WinNT/i&#039;,$agent)) { return &#039;WinNT&#039;; }<br>に変更。<br><br>280行目<br>&quot; ref_query = &#039;$Query&#039;, rh_short = &#039;$RHShort&#039;, ref_short = &#039;$RefShort&#039;,&quot; .<br>を<br>&quot; ref_query = &#039;$Query&#039;, ref_short = &#039;$RefShort&#039;,&quot; .<br>に変更。<br><br>UTF-8への対応?<br>index.php<br>7行目<br>if (!defined(&#039;_CHARSET&#039;)) { define(&#039;_CHARSET&#039;, &#039;EUC-JP&#039;); }<br>を<br>if (!defined(&#039;_CHARSET&#039;)) { define(&#039;_CHARSET&#039;, &#039;UTF-8&#039;); }<br>に変更。<br><br>sql/mysql.sql<br>) TYPE = MyISAM;<br>を<br>) ENGINE = MyISAM;<br>にすべて変更。<br><br>user_agentの長さが不足してエラーとなる事への対応<br>36行目<br>user_agent varchar(150) NOT NULL default &#039;&#039;,<br>を<br>user_agent varchar(250) NOT NULL default &#039;&#039;,<br>に変更。<br><br>以上、「ちょっとだけ改造」でした。．．（＾＿＾；<br>※2016/05/17 OSを解析する部分を追加訂正しました。<br>最終更新:2018/07/31<br></blockquote></div><br>さらに、<br>■eregの対応<br>・logcounterx/index.php<br><div><pre><code>257,282行目
if (($Data[&#039;RowName&#039;] == &#039;unknown&#039;) || ereg(&#039;\+\+\+\+\+\+\+\+\+\+&#039;,$Data[&#039;RowName&#039;])) { continue; }
↓変更
if (($Data[&#039;RowName&#039;] == &#039;unknown&#039;) || preg_match(&#039;/\+\+\+\+\+\+\+\+\+\+/&#039;,$Data[&#039;RowName&#039;])) { continue; }</code></pre></div><br>■ログの再構築の際のエラー表示の解消<br>・include/function.php<br><div><pre><code>257行目
if (preg_match(&#039;/Slurp\.so/Goo/i&#039;,	$agent)) { return &#039;Robot (goo)&#039;; }
↓変更
if (preg_match(&#039;&lt;Slurp\.so/Goo&gt;i&#039;,	$agent)) { return &#039;Robot (goo)&#039;; }</code></pre></div><br>モジュールインストールの際<br>sql/mysql.sqlで<br>TYPE = MyISAM;　→　 ENGINE = MyISAM;としましたがインストールに失敗したので<br>TYPE = MyISAM;　→　  ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;とすればOKでした。<br><br>これで、インストール後logcounterxモジュールのデータベースを移行しテストしました。今のところ検索リストが表示されない以外は正常なようです。<br>]]></content:encoded>
  </item>
    <item>
    <title>theme_changerモジュールphp7への対応</title>
    <link>https://www.onwil.com/modules/wilforum/index.php?post_id=719</link>
    <guid>https://www.onwil.com/modules/wilforum/index.php?post_id=719</guid>
    <description></description>
    <pubDate>Wed, 16 Nov 2022 07:09:08 +0900</pubDate>
    <category>XOOPS、パソコン関連</category>
    <category>XOOPS関連フォーラム</category>
    <content:encoded><![CDATA[続いて、theme_changerモジュールphp7への対応です。他に編集したモジュールと同様、<a href="https://ja.osdn.net/projects/simsuin/releases/" target="_blank" rel="noopener">Suin on PHP</a>よりtheme_changerモジュール(theme_changer_026)をダウンロードし、ローカル環境(サーバーxampp7.4.25、legacy-2.3を起用)で一部書式変更(theme_changer/sql/mysql.sql TYPE=MyISAM; → ENGINE=MyISAM)した上でインストール)し、Fatalエラーを除去してみました。<br><br>結果的にはメニューで主要部分である「対応/編集/削除」の機能は問題なさそうですが、「グループ/ブロック管理」の部分については正常に機能しません。この部分に関してはaltsysモジュールのブロック管理と同じ機能なので、altsysモジュールのmyblocksadminをコピーしたものを編集しtheme_changerモジュールのmyblocksadminと置換し、管理メニュー(index.php)を編集することでエラーは発生しなくなりました。<br><br>■altsysモジュールのブロック管理を利用<br>・xoops_trust_path/lib/altsys/myblocksadminをコピーしたものを編集<br><div><pre><code>42行目に挿入
// header
xoops_cp_header();

↓変更
// header
include_once( XOOPS_ROOT_PATH.&#039;/include/cp_header.php&#039; );
xoops_cp_header();</code></pre></div><div><pre><code>45行目
altsys_include_mymenu();
↓コメントアウト
//altsys_include_mymenu();</code></pre></div><div><pre><code>23行目
include_once __DIR__ . &#039;/class/MyBlocksAdminForXCL21.class.php&#039;;
$myba =&amp; MyBlocksAdminForXCL21::getInstance()

↓変更 追加
include_once XOOPS_TRUST_PATH.&#039;/libs/&#039;.$mytrustdirname. &#039;/class/MyBlocksAdminForXCL21.class.php&#039;;
include_once XOOPS_ROOT_PATH .&#039;/modules/&#039;.$mydirname. &#039;/language/&#039;.$xoopsConfig[&#039;language&#039;].&#039;/modinfo.php&#039;;
$myba =&amp; MyBlocksAdminForXCL21::getInstance();</code></pre></div><div><pre><code>14行目
require_once __DIR__ . &#039;/class/AltsysBreadcrumbs.class.php&#039;;
require_once __DIR__ . &#039;/include/gtickets.php&#039;;
include_once __DIR__ . &#039;/include/altsys_functions.php&#039;;
include_once __DIR__ . &#039;/include/mygrouppermform.php&#039;;
include_once XOOPS_ROOT_PATH . &#039;/class/xoopsblock.php&#039;;

↓変更 追加
require &#039;../../../mainfile.php&#039; ;
if (! defined(&#039;XOOPS_TRUST_PATH&#039;)) {
    die(&#039;set XOOPS_TRUST_PATH in mainfile.php&#039;) ;
}
$mydirname = basename(dirname(__DIR__)) ;
$mydirpath = dirname(__DIR__) ;
// require $mydirpath.&#039;/mytrustdirname.php&#039; ; // set $mytrustdirname
$mytrustdirname = &#039;altsys&#039; ;

//require XOOPS_TRUST_PATH.&#039;/libs/&#039;.$mytrustdirname.&#039;/index.php&#039; ;

require_once XOOPS_TRUST_PATH.&#039;/libs/&#039;.$mytrustdirname. &#039;/class/AltsysBreadcrumbs.class.php&#039;;
include_once &quot;../include/gtickets.php&quot; ;
include_once XOOPS_TRUST_PATH.&#039;/libs/&#039;.$mytrustdirname. &#039;/include/altsys_functions.php&#039;;
include_once XOOPS_TRUST_PATH.&#039;/libs/&#039;.$mytrustdirname. &#039;/include/mygrouppermform.php&#039;;
include_once XOOPS_ROOT_PATH . &#039;/class/xoopsblock.php&#039;;</code></pre></div>以上の編集したものをhtml/modules/theme_changer/admin/myblocksadminsと置換する<br><br>■php7への対応と管理メニューの編集<br>・theme_changer/admin/index.php<br><div><pre><code>423行目
while( list($k, $v) = each($adminmenu) )
↓変更
foreach ($adminmenu as $k =&gt; $v)</code></pre></div><div><pre><code>48行目
//Gチケットシステム呼び出し
include_once( XOOPS_ROOT_PATH.&#039;/modules/&#039;.$mydirname.&#039;/include/gtickets.php&#039; );

↓変更と追加
// Assign to template for Admin Breadcrumbs
$dirname = ucfirst( $mydirname );

//Gチケットシステム呼び出し
include_once( XOOPS_ROOT_PATH.&#039;/modules/&#039;.$mydirname.&#039;/include/gtickets.php&#039; );

// display
require_once XOOPS_TRUST_PATH . &#039;/libs/altsys/class/D3Tpl.class.php&#039;;
$tpl = new D3Tpl();
$tpl-&gt;assign(
    [
        &#039;adminmenu&#039; =&gt; $adminmenu,
        &#039;dirname&#039;   =&gt; $dirname,
    ]
);</code></pre></div><div><pre><code>53,180,204,255,326,369,381,418行目
xoops_cp_header();
↓変更
xoops_cp_header();
$tpl-&gt;display( &#039;db:altsys_inc_menu.html&#039; );</code></pre></div><br>■言語ファイルの作成<br>運用されている文字コードja_utf8のフォルダがないので<br>theme_changer/languege/japaneseのフォルダをコピーし、<br>名前をja_utf8に変更して追加<br><br>■mysqlファイルの編集<br>・theme_changer/sql/mysql<br><div><pre><code>TYPE=MyISAM
↓変更
ENGINE=MyISAM</code></pre></div><br>以上で今の所正常に動作しているようです。不具合があれば削除または追加で対応したいと思います。<br><br>]]></content:encoded>
  </item>
    <item>
    <title>webphotoモジュールphp7への対応 </title>
    <link>https://www.onwil.com/modules/wilforum/index.php?post_id=718</link>
    <guid>https://www.onwil.com/modules/wilforum/index.php?post_id=718</guid>
    <description></description>
    <pubDate>Sat, 22 Oct 2022 01:03:16 +0900</pubDate>
    <category>XOOPS、パソコン関連</category>
    <category>XOOPS関連フォーラム</category>
    <content:encoded><![CDATA[続いて、webphotoモジュールphp7.45への対応です。他に編集したモジュールと同様、最新の<a href="https://github.com/XoopsX/myalbum-p" target="_blank" rel="noopener">webphotoモジュール</a>(webphoto-master)version2.65をダウンロードし、編集後、ローカル環境(サーバーxampp7.4.25、legacy-2.3を起用)でインストールし実際にテスト稼働させたところエラー表示は解消されましたが、登録された投稿を削除する際、「このエリアへのアクセスは、ログイン若しくは許可された権限が必要です。」と表示され削除することができません。運用するには致命的です。残念ながらこの具体的な解消方法は分かりませんでした。<br><br>そこで、１つ前の<a href="https://github.com/XoopsModulesArchive/webphoto" target="_blank" rel="noopener">webphotoモジュール</a>(webphoto-master)version2.61をダウンロードし、ほぼ同様の方法で編集しインストールしたところ上記の部分については解消されたのでこれを採用することにしました。今回は同じ名前のファイルがいくつもあり、膨大な箇所があったのでポイントだけを記述することにしました。ただし、この方法でエラー表示は解消し稼働を確認しましたが合っているかどうかは不明です。<br><br>■変更基本パターン<br>・__construct,parent::__construct,public staticの変更パターン（ほぼ全てのファイル）<br><div><pre><code>class A	exend B{
function A(){
	this -&gt; B()
}
function &amp;getInstance(){
}
}
変更↓
class A	exend B{
function __construct(){
	parent::__construct()
}
public static function &amp;getInstance(){
}
}</code></pre></div><br>例)<br>Warning [PHP7]: Declaration of &amp; webphoto_mime_handler::getInstance($dirname, $trust_dirname) should be compatible with &amp; webphoto_lib_error::getInstance() in file C:/xampp_7425/htdocs/xoops_trust_path/modules/webphoto/class/handler/mime_handler.php line 47 (1)<br><br>■エラーがshould be compatibleの場合、引数を合わせる<br>例)<br><div><pre><code>function &amp;getInstance( $dirname, $trust_dirname )
変更↓
public static function &amp;getInstance( $dirname = null, $trust_dirname = null )</code></pre></div><br>■php非推奨コードの処理<br>・xoops_trust_path/modules/webphoto/class/lib/pathinfo.php line 151 (1)<br><div><pre><code>if ( !get_magic_quotes_gpc() ) { return $str; }
変更↓
//if ( !get_magic_quotes_gpc() ) { return $str; }</code></pre></div><br>■無効なコードの変更（合っているかどうか不明）<br>・xoops_trust_path/class/webphoto/playlist.php line 449,458<br><div><pre><code>get_rows_public_by_kind →無効なコード
変更↓
get_rows_from_id_array</code></pre></div><br>■trueを削除<br>・xoops_trust_path/modules/webphoto/PEAR/Net/POP3.php line 54,55,56<br><div><pre><code>define(&#039;NET_POP3_STATE_DISCONNECTED&#039;,  1, true);
変更↓
define(&#039;NET_POP3_STATE_DISCONNECTED&#039;,  1 );</code></pre></div><br>■version2.65の同ファイルと入れ替え<br>・xoops_trust_path/modules/webphoto/class/lib/server_info.php<br><br>あと、array() →[]への変更が必要ですが、膨大な量のためこのままにしておくことにしました。<br><br>■22/10/31追加 php7.45対応(implodeの中が逆)<br>・xoops_trust_path/modules/webphoto/class/inc/uri.php 203,205行目<br><div><pre><code>if ( $this-&gt;_cfg_use_pathinfo ) {
		$str = implode( $arr, &#039;/&#039; ) .&#039;/&#039; ;
	} else {
		$str = $amp. implode( $arr, $amp ) ;
	}
変更↓

if ( $this-&gt;_cfg_use_pathinfo ) {
		$str = implode( &#039;/&#039;, $arr ) .&#039;/&#039; ;
	} else {
		$str = $amp. implode( $amp, $arr ) ;
	}</code></pre></div><br>]]></content:encoded>
  </item>
    <item>
    <title>myalbum-pモジュールphp7への対応</title>
    <link>https://www.onwil.com/modules/wilforum/index.php?post_id=717</link>
    <guid>https://www.onwil.com/modules/wilforum/index.php?post_id=717</guid>
    <description></description>
    <pubDate>Sat, 01 Oct 2022 07:39:38 +0900</pubDate>
    <category>XOOPS、パソコン関連</category>
    <category>XOOPS関連フォーラム</category>
    <content:encoded><![CDATA[続いて、myalbum-pモジュールphp7への対応です。他に編集したモジュールと同様、<a href="https://github.com/XoopsX/myalbum-p" target="_blank" rel="noopener">XoopsX</a>より最新のmyalbum-pモジュール(myalbum-p-master)version2.89をダウンロードし、ローカル環境(サーバーxampp7.4.25、legacy-2.3を起用)でインストールし、エラーが出るかどうかのチェックをしました。以下の部分を編集することでエラーは今の所解消されています。また、稼働するかどうか怪しかったのでデータベースも移行してテストしてみました。今の所うまく稼働しています。<br><br>■1.PHP7へのバージョンアップによる書式変更（__construct部分等）<br>・myalbum/include/gtickets.php<br><div><pre><code>13行目
function XoopsGTicket()
変更↓
function __construct()</code></pre></div><br>・myalbum/class/myalbum.textsanitizer.php<br><div><pre><code>22行目
function MyAlbumTextSanitizer()
変更↓
function __construct()

24行目
parent::MyTextSanitizer() ;
変更↓
parent::__construct() ;

43行目
function &amp;getInstance()
変更↓
public static function &amp;getInstance()</code></pre></div><br>・myalbum/include/gtickets.php<br><div><pre><code>13行目
function XoopsGTicket()
変更↓
function __construct()</code></pre></div><br>・myalbum/admin/mygrouppermform.php<br><div><pre><code>81行目
function MyXoopsGroupPermForm($title, $modid, $permname, $permdesc)
変更↓
function __construct($title, $modid, $permname, $permdesc)

250行目
function MyXoopsGroupFormCheckBox($caption, $name, $groupId, $values = null)
変更↓
function __construct($caption, $name, $groupId, $values = null)</code></pre></div><br>・myalbum/class/myuploader.php<br><div><pre><code>97行目
function MyXoopsMediaUploader($uploadDir, $allowedMimeTypes, $maxFileSize, $maxWidth=null, $maxHeight=null, $allowedExtensions=null )
変更↓
function __construct($uploadDir, $allowedMimeTypes, $maxFileSize, $maxWidth=null, $maxHeight=null, $allowedExtensions=null )</code></pre></div><br>■2.legacyバージョンアップによるpath変更<br>・myalbum/admin/import.php<br><div><pre><code>8行目
include_once XOOPS_ROOT_PATH.&#039;/modules/system/constants.php&#039; ;
変更↓
include_once XOOPS_ROOT_PATH.&#039;/modules/legacy/include/xoops2_system_constants.inc.php&#039; ;</code></pre></div><br>・myalbum/admin/export.php line 8 (1)<br><div><pre><code>8行目
include_once XOOPS_ROOT_PATH . &#039;/modules/system/constants.php&#039; ;
変更↓
include_once XOOPS_ROOT_PATH.&#039;/modules/legacy/include/xoops2_system_constants.inc.php&#039; ;</code></pre></div><br>・myalbum/admin/groupperm_global.php<br><div><pre><code>11行目
include_once( XOOPS_ROOT_PATH.&quot;/modules/system/language/&quot;.$xoopsConfig[&#039;language&#039;].&quot;/admin.php&quot; ) ;
変更↓
include_once( XOOPS_ROOT_PATH.&quot;/modules/legacy/language/&quot;.$xoopsConfig[&#039;language&#039;].&quot;/admin.php&quot; ) ;</code></pre></div><br>■3.OpenTable()が無効になる件<br>・myalbum/editphoto.php<br><div><pre><code>194行目
// Editing Display
include_once( XOOPS_ROOT_PATH.&quot;/include/cp_functions.php&quot; ) ; //追加
include(XOOPS_ROOT_PATH.&quot;/header.php&quot;);
OpenTable() ;</code></pre></div><br>・myalbum/submit.php<br><div><pre><code>244行目
else {
include_once( XOOPS_ROOT_PATH.&quot;/include/cp_functions.php&quot; ) ; //追加
include( XOOPS_ROOT_PATH . &quot;/header.php&quot; ) ;
OpenTable() ;</code></pre></div><br>■4.PHP7へのバージョンアップによる書式変更(get_magic_quotes_gpc()が無効になったため)<br>・myalbum/class/myalbum.textsanitizer.php<br><div><pre><code>163行目　コマンド自体を無効に対処
//if (get_magic_quotes_gpc()) {
$text = stripslashes($text);
//}</code></pre></div><br>■5.その他PHP7での配列書式変更<br>変更対象ファイル<br>array()は殆どのファイルにて多数存在するので省略します<br><div><pre><code>例)$name = array()
変更↓
$name =[] ;</code></pre></div><br>■6.インストール時の上書き禁止ファイル<br>以下のファイルが梱包されていますが既にlegacy-2.3にて標準装備されているため上書きはしないようにすること<br>・xoops_trust_path/libs/smarty/plugins/function.d3comment.php<br>・xoops_trust_path/libs/smarty/plugins/function.xoopsdhtmltarea.php<br>・xoops_trust_path/libs/smarty/plugins/function.d3forum_comment_postscount.php<br>・xoops_trust_path/libs/smarty/plugins/function.function.d3forum_comment_topicscount.php<br><br>以上です。データベースの移行は、myx-buckupモジュールの復元を利用すると文字化けしたのでPhpMyAdminを利用したところ正常に移行できました。<br><br><br>---2023/2/11追加---<br>本サイト立ち上げ後にmyx-buckupモジュールでバックアップすると文字化けはありませんでした。<br>さらに<br>■サイトマップにmyalbumモジュールが対応できなかったのでコードを編集しました。<br>html/modules/myalbum/include/sitemap.plugin.php<br><div><pre><code>&lt;?php
if( ! defined( &#039;XOOPS_ROOT_PATH&#039; ) ) exit ;

$mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
if( ! preg_match( &#039;/^(\D+)(\d*)$/&#039; , $mydirname , $regs ) ) echo ( &quot;invalid dirname: &quot; . htmlspecialchars( $mydirname ) ) ;
$mydirnumber = $regs[2] === &#039;&#039; ? &#039;&#039; : intval( $regs[2] ) ;

eval( &#039;

function b_sitemap_&#039;.$mydirname.&#039;(){
$xoopsDB =&amp; Database::getInstance();

$block = sitemap_get_categoires_map($xoopsDB-&gt;prefix(&quot;myalbum&#039;.$mydirnumber.&#039;_cat&quot;), &quot;cid&quot;, &quot;pid&quot;, &quot;title&quot;, &quot;viewcat.php?cid=&quot;, &quot;title&quot;);

return $block;
}

&#039; ) ;
?&gt;

↓変更

&lt;?php

if( ! defined( &#039;XOOPS_ROOT_PATH&#039; ) ) exit ;

//$mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
//if( ! preg_match( &#039;/^(\D+)(\d*)$/&#039; , $mydirname , $regs ) ) echo ( &quot;invalid dirname: &quot; . htmlspecialchars( $mydirname ) ) ;
//$mydirnumber = $regs[2] === &#039;&#039; ? &#039;&#039; : intval( $regs[2] ) ;


function b_sitemap_myalbum(){
$db =&amp; Database::getInstance();
$block = sitemap_get_categories_map($db-&gt;prefix(&quot;myalbum_cat&quot;), &quot;cid&quot;, &quot;pid&quot;, &quot;title&quot;, &quot;viewcat.php?cid=&quot;, &quot;title&quot;);
return $block;
}

?</code></pre></div>]]></content:encoded>
  </item>
    </channel>
</rss>