:::
網站模組更新

20250430模組用AI修正網站模組PHP的錯誤,心得分享!

discuss pic 2025-04-30 16:14:18

原先沒想到會再碰 PHP ,但是網站搬到新機器 PHP8 ,我的 XOOPS 就跑不動了,幾過老師的幫忙,終於網站可以跑,但我有一些模組,跑不了,我最珍貴的是「信望愛大辭典」,因為有許多我的資料,今天老師說可以用 AI 來處理程式語法的錯誤,這是我從來沒碰過,心裏想 AI 有那麼厲害嗎?今天我終於測試成功,我把我錯誤 PHP 語法的模組更正了。我的解決方法如下:

1.開啟 XOOPS 的 PHP 除錯模式。

2.找到 PHP 行的錯誤。把錯誤的語法,請 AI 幫忙改。

3.最後改成功了。

建造一個快樂、幸福、卓越的教會
:::

QR Code 區塊

http%3A%2F%2Fwww.ch.fhl.net%2Fxoops%2Fmodules%2Ftad_discuss%2Fdiscuss.php%3FBoardID%3D1%26DiscussID%3D2

誰在線上

104人線上 (3人在瀏覽互動討論區)

會員: 0

訪客: 104

更多…

2021/9/25統計訪客國旗

free counters

2021/9/25統計訪客地圖

全部 錯誤訊息 (6) 已棄用 (0) 資料庫語法 (48) 區塊 (7) 額外資訊 (2) 計時(6)
錯誤訊息
警告: Undefined array key "tad_discuss_adm" 在檔案中的第 /home/church/ch_fhl/xoops_data/caches/smarty_compile/2583987f_tad_discuss_school2019_default^2ad1d05119b53c6c950a395c13e5d216a2be0ec1_0.db.taddiscussbootstrap.tpl.php 列 72
警告: Undefined array key "system_version" 在檔案中的第 /home/church/ch_fhl/xoops_data/caches/smarty_compile/2583987f_tad_discuss_school2019_default^5ef93687678e869990d930219d157f1842bf89db_0.file.theme.tpl.php 列 31
警告: Attempt to read property "value" on null 在檔案中的第 /home/church/ch_fhl/xoops_data/caches/smarty_compile/2583987f_tad_discuss_school2019_default^5ef93687678e869990d930219d157f1842bf89db_0.file.theme.tpl.php 列 31
警告: Undefined array key "" 在檔案中的第 /home/church/ch_fhl/xoops_data/caches/smarty_compile/2583987f_tad_discuss_school2019_default^5ef93687678e869990d930219d157f1842bf89db_0.file.theme.tpl.php 列 429
警告: Undefined array key "tlogin" 在檔案中的第 /home/church/ch_fhl/xoops_data/caches/smarty_compile/2583987f_tad_discuss_school2019_default^054a3d032f3b8c807fdb4b3c0b1e88eadc67542c_0.file.menu_login.tpl.php 列 103
警告: Attempt to read property "value" on null 在檔案中的第 /home/church/ch_fhl/xoops_data/caches/smarty_compile/2583987f_tad_discuss_school2019_default^054a3d032f3b8c807fdb4b3c0b1e88eadc67542c_0.file.menu_login.tpl.php 列 103
已棄用
資料庫語法
0.000119 - SET SQL_BIG_SELECTS = 1
0.000740 - SELECT * FROM config WHERE (`conf_modid` = '0' AND `conf_catid` = '1') ORDER BY conf_order ASC
0.000251 - SELECT sess_data, sess_ip FROM session WHERE sess_id = '4ouk431u7e1nahh8t855t5fs10'
0.000465 - SELECT COUNT(*) FROM group_permission WHERE (`gperm_modid` = '1' AND (`gperm_groupid` = '3') AND `gperm_name` = 'module_read' AND `gperm_itemid` = '561')
0.000373 - SELECT * FROM config WHERE (`conf_modid` = '561') ORDER BY conf_order ASC
0.000310 - DELETE FROM protector_access WHERE expire < UNIX_TIMESTAMP()
0.006732 - SELECT COUNT(*) FROM protector_access WHERE ip='18.191.136.109' AND request_uri='/xoops/modules/tad_discuss/discuss.php?BoardID=1&DiscussID=2'
0.006529 - SELECT COUNT(*) FROM protector_access WHERE ip='18.191.136.109'
0.000307 - INSERT INTO protector_access SET ip='18.191.136.109', request_uri='/xoops/modules/tad_discuss/discuss.php?BoardID=1&DiscussID=2', expire=UNIX_TIMESTAMP()+'60'
0.000396 - SELECT * FROM config WHERE (`conf_modid` = '0' AND `conf_catid` = '5') ORDER BY conf_order ASC
0.000319 - SELECT * FROM config WHERE (`conf_modid` = '0' AND `conf_catid` = '3') ORDER BY conf_order ASC
0.000661 - SELECT DISTINCT gperm_itemid FROM group_permission WHERE gperm_name = 'block_read' AND gperm_modid = 1 AND gperm_groupid IN (3)
0.000988 - SELECT b.* FROM newblocks b, block_module_link m WHERE m.block_id=b.bid AND b.isactive=1 AND b.visible=1 AND m.module_id IN (0,561) AND b.bid IN (592,1176,1175,1174,1329,1351,1325,1350,590,591,410,1171,1169,1170,1287,1339,1328,1337,1324,1336,1331,1326,1323,1340,165,164,167,166,1338,844,12,11,10,9,8,1327,1289,7,6,5,4,3,2,1237,1,1055,620,619,823,820,422,1181,1182,1183,1334,1173,417,1267,1330,1296,1341,368,588,217,212,1172,1322,483,108,1354,1352,1333,1342,1288,1332,1184,1214,1215,1355,1141,1140,1358,1357,1139,1356,1343,1294,635,597,634,596,1302,1301,1300,1299,1298,1270,1265,1264,1263,1262,1261,1260,1259,1258,1256,1257,1254,1253,1252,1251,1250,1248,1247,1245,1244,1243,1242,1241,1240,1239,1268,1189,1188,1187,1186,1166,1168,595,1290,1130,1129,1266,594,1353,1269,1335,1091,1092,1165,1167,593,1087,1051,1297,1295,1086,1049,1048,1026,1025,1027,1028,1029,1030,1056,1047,1046,1006,971,800,798,799) ORDER BY b.weight, m.block_id
0.000521 - SELECT f.*, s.tpl_source FROM tplfile f LEFT JOIN tplsource s ON s.tpl_id=f.tpl_id WHERE (`tpl_tplset` = 'default' AND `tpl_file` = 'tadtools_qrcode_block.tpl') ORDER BY tpl_refid
0.000313 - SELECT COUNT(*) FROM online WHERE online_uid=0 AND online_ip='18.191.136.109'
0.000225 - INSERT INTO online (online_uid, online_uname, online_updated, online_ip, online_module) VALUES (0, '', 1746076576, '18.191.136.109', 561)
0.000300 - SELECT * FROM online
0.000215 - SELECT COUNT(*) FROM online WHERE `online_module` = '561'
0.000444 - SELECT f.*, s.tpl_source FROM tplfile f LEFT JOIN tplsource s ON s.tpl_id=f.tpl_id WHERE (`tpl_tplset` = 'default' AND `tpl_file` = 'system_block_online.tpl') ORDER BY tpl_refid
0.000364 - SELECT cfgname, cfgvalue FROM logcounterx_cfg
0.000354 - DELETE FROM logcounterx_ip WHERE acctime < 1746075976
0.000162 - SELECT accip FROM logcounterx_ip WHERE accip = '18.191.136.109'
0.000195 - INSERT INTO logcounterx_ip (accip, acctime) VALUES ('18.191.136.109', 1746076576)
0.000236 - UPDATE logcounterx_count SET cnt = (cnt + 1), robot = (robot + 1) WHERE ymd = '1111-11-11'
0.000158 - SELECT cnt FROM logcounterx_count WHERE ymd = '2025/05/01'
0.000148 - UPDATE logcounterx_count SET cnt = (cnt + 1), robot = (robot + 1) WHERE ymd = '2025/05/01'
0.000164 - UPDATE logcounterx_hours SET cnt = (cnt + 1), robot = (robot + 1) WHERE hour = '13'
0.000195 - SELECT cnt FROM logcounterx_count WHERE ymd = '1111-11-11'
0.000225 - INSERT INTO logcounterx_log (remote_host, user_agent, path_info, referer, acccnt, uname, accday, acctime, accwday) VALUES ('', 'Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)', '/xoops/modules/tad_discuss/discuss.php?BoardID=1&DiscussID=2', '', 9851590, '', '2025-05-01', '13:16:16', '4')
0.008336 - SELECT MAX(acccnt), COUNT(recid) FROM logcounterx_log
0.000671 - SELECT f.*, s.tpl_source FROM tplfile f LEFT JOIN tplsource s ON s.tpl_id=f.tpl_id WHERE (`tpl_tplset` = 'default' AND `tpl_file` = 'system_block_dummy.tpl') ORDER BY tpl_refid
0.000361 - SELECT `conf_value` FROM `config` WHERE `conf_name` = 'allow_register'
0.000300 - SELECT `mid`, `name`, `dirname` FROM `modules` WHERE `isactive` = 1 AND `hasmain` = 1 AND `weight` != 0 ORDER BY `weight`
0.000190 - SELECT `conf_value` FROM `config` WHERE `conf_title` = '_MD_AM_DEBUGMODE'
0.000241 - SELECT COUNT(*) FROM `priv_msgs` WHERE `to_userid` = 0 AND `read_msg`=0 GROUP BY `to_userid`
0.000881 - SELECT `menuid`, `itemname`, `itemurl`, `target`, `icon`, `link_cate_name`, `link_cate_sn`, `read_group`, `of_level` FROM `tad_themes_menu` WHERE `status` = 1 ORDER BY `of_level`, `position`
0.000304 - SELECT * FROM config WHERE (`conf_modid` = '443') ORDER BY conf_order ASC
0.000344 - SELECT COUNT(*) FROM group_permission WHERE (`gperm_modid` = '561' AND (`gperm_groupid` = '3') AND `gperm_name` = 'forum_read' AND `gperm_itemid` = '1')
0.000261 - select * from tad_discuss where DiscussID='2' or ReDiscussID='2' order by ReDiscussID , DiscussDate
0.000257 - select * from tad_discuss where DiscussID='2' or ReDiscussID='2' order by ReDiscussID , DiscussDate LIMIT 0, 20
0.000289 - SELECT * FROM users WHERE uid = '1'
0.000185 - SELECT * FROM smiles
0.000243 - select * from `tad_discuss_files_center` where `col_name`='DiscussID' and `col_sn`='2' order by sort
0.000337 - SELECT COUNT(*) FROM group_permission WHERE (`gperm_modid` = '561' AND (`gperm_groupid` = '3') AND `gperm_name` = 'forum_post' AND `gperm_itemid` = '1')
0.000178 - SELECT `tt_theme`,`tt_use_bootstrap`,`tt_bootstrap_color`,`tt_theme_kind` FROM `tadtools_setup` WHERE `tt_theme` = 'school2019'
0.000469 - SELECT f.*, s.tpl_source FROM tplfile f LEFT JOIN tplsource s ON s.tpl_id=f.tpl_id WHERE (`tpl_tplset` = 'default' AND `tpl_file` = 'tad_discuss_discuss.tpl') ORDER BY tpl_refid
0.000459 - SELECT f.*, s.tpl_source FROM tplfile f LEFT JOIN tplsource s ON s.tpl_id=f.tpl_id WHERE (`tpl_tplset` = 'default' AND `tpl_file` = 'tad_discuss_bootstrap.tpl') ORDER BY tpl_refid
0.000338 - SELECT f.*, s.tpl_source FROM tplfile f LEFT JOIN tplsource s ON s.tpl_id=f.tpl_id WHERE (`tpl_tplset` = 'default' AND `tpl_file` = 'system_notification_select.tpl') ORDER BY tpl_refid
總計: 48
區塊
通知選項: 沒有快取
本頁面行動條碼: 沒有快取
書籍目錄: 沒有快取
線上使用者: 沒有快取
紀錄區塊: 沒有快取
自訂區塊(HTML): 沒有快取
自訂區塊(HTML): 沒有快取
總計: 7
額外資訊
包含檔案: 228 檔案
使用記憶體: 1799048 bytes
計時
XOOPS 使用 0.053 秒來載入。
XOOPS Boot 使用 0.004 秒來載入。
Module init 使用 0.015 秒來載入。
XOOPS output init 使用 0.024 秒來載入。
Module display 使用 0.006 秒來載入。
Page rendering 使用 0.004 秒來載入。