·您现在的位置: 云翼网络 >> 文章中心 >> 网站建设 >> 网站建设问答 >> phpBB 3.0.5 SEO插件与短消息Bug的解决办法

phpBB 3.0.5 SEO插件与短消息Bug的解决办法

作者:佚名      网站建设问答编辑:admin      更新时间:2022-07-23

最近在研究英文站,人气上来了顺便整个论坛玩玩,装的是 phpBB 3.0.5 + phpBB SEO 超级大插件,发现两个超级小 Bug ,特意记录一下。

Bug 1

描述: 安装 phpBB SEO 模块以后板块以及其他内页不显示样式和图片

原因:开启伪静态以后,论坛版块的链接是类似 http://www.nbavg.com/nba-2k10-patches-downloads-f5/ 这样的二级目录,而之前的样式和图片只是通用在一级目录(默认的两个主题都无错,第三方主题才有错误)

解决方法:修改模板的 overall_head.html ,在 《head》 之后加入 Base 元素,比如:

<base href=”http://www.nbavg.com” />

即可显示所有的图片和样式, HTML 代码的 Base 元素原理见此。

这个小Bug是绝大多数第三方主题没有考虑进去的,嗯哼,第三方主题下载来以后还得自行 SEO, 比如 overall_head.html 里的几个 Meta 标记都需要自己修改,汗一个,那么多作者怎么都不考虑或者参考默认自带的两个主题嘛。

Bug 2

描述:

论坛的PM(短消息)查看信息的时候出现如下错误信息:

[phpBB Debug] PHP Notice: in file /includes/functions_privmsgs.php on line 1818: implode() [function.implode]: Invalid arguments passed
[phpBB Debug] PHP Notice: in file /includes/functions_privmsgs.php on line 1818: implode() [function.implode]: Invalid arguments passed
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3824: Cannot modify header information – headers already sent by (output started at /includes/functions.php:3247)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3826: Cannot modify header information – headers already sent by (output started at /includes/functions.php:3247)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3827: Cannot modify header information – headers already sent by (output started at /includes/functions.php:3247)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3828: Cannot modify header information – headers already sent by (output started at /includes/functions.php:3247)

原本以为是 phpBB SEO 的问题,搜索一番才得知是 phpBB 3.0.5 的缘故,短消息记录大于两条就会出现这个傻逼的错误,汗,难道官方没人管?

解决方法,用非记事本打开 includes/functions_privmsgs.php 文件,按照以下步骤修改

找到 1767 行: $rowset = array_values($rowset);

修改为: $rowset1 = array_values($rowset);

找到 1769 行:for ($i = 0, $size = sizeof($rowset); $i < $size; $i++)

修改为: for ($i = 0, $size = sizeof($rowset1); $i < $size; $i++)

找到 1771 行: $row = &$rowset[$i];

修改为: $row = &$rowset1[$i];

方法来自这里。

保存,OK,大功告成,phpBB 3.0.5 也发布有段时间了,这两个小 Bug 应该尽快修复,尤其是第三方主题制作人员,应该多考虑用户使用其他的插件,比如 PHPBB SEO 在国外很流行,可以把论坛全部伪静态,友好 SEO ,但是你主题总得满足大家的需求,官网的两款默认主题就挺好的。

其实,无论是 phpBB 还是 WordPress 这样国外很流行的程序,还是每个人编写的小程序,很多细小的 Bug 不应该完全由用户去发现,假如你的程序要大家用,用户体验才是最重要的,这点 WordPress 做得非常出色,希望其他程序也能多听听用户的意见。

作者:Showfom 原文链接

[相关阅读]

phpBB发布自2000年,是全球互联网应用最为广泛的开源社区软件之一。目前最新版本为3.0.5。