😂瞎G8折腾忘记备份,把rarefav的数据库保存了,但是文件没保存,没了,我说反正是为了方便自己,干脆换个简单快捷的程序,就试了试Xiuno BBS,虽然早就停更了,但是不得不说,这程序是真的牛B.不过毕竟是早就停更的程序,在高版本的PHP中有些被弃用的函数无法使用,于是就着手解决了一下.大概率我不会用Xiuno BBS来接着做RareFav,只是遇到了,解决,记录.


解决PHP7.4+安装Xiuno BBS爆get_magic_quotes_gpc()函数错误

症状如下:

//报错信息
Deprecated: Function get_magic_quotes_gpc() is deprecated in .....

1.打开/xiunophp/xiunophp.min.php/xiunophp/xiunophp.php.找到这两个文件的第20行.如下

$get_magic_quotes_gpc = get_magic_quotes_gpc();

替换为

$get_magic_quotes_gpc = 0;

2.打开/xiunophp/xn_html_safe.func.php 分别在第785行,第938行,第951行.找到rawtext{....}替换为rawtext[....],算了,我怕有些人看不懂,我放个代码片段上来.如下:

//说白了,就是把{}替换成[],因为数组{}也被弃用了..
//替换前
function scanCharacter() {
        if ($this->position < $this->length) {
            return $this->rawtext{$this->position++};
        }
    }
//替换后的代码片段
function scanCharacter() {
        if ($this->position < $this->length) {
            return $this->rawtext[$this->position++];
        }
    }
//注意有3个地方需要替换,785行,938行,951行

解决php8.1下http_url_path报错

找到xiunophp/misc.func.php文件大约1035行到1045行.进行如下替换

替换前

// 获取 http://xxx.com/path/
function http_url_path() {
    $port = _SERVER('SERVER_PORT');
    //$portadd = ($port == 80 ? '' : ':'.$port);
    $host = _SERVER('HTTP_HOST');  // host 里包含 port
    $https = strtolower(_SERVER('HTTPS', 'off'));
    $proto = strtolower(_SERVER('HTTP_X_FORWARDED_PROTO'));
    $path = substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['PHP_SELF'], '/'));
    $http = (($port == 443) || $proto == 'https' || ($https && $https != 'off')) ? 'https' : 'http';
    return  "$http://$host$path/";
}

替换后

// 获取 http://xxx.com/path/
function http_url_path() {
    $port = _SERVER("SERVER_PORT");
    //$portadd = ($port == 80 ? "" : ":".$port);
    $host = _SERVER("HTTP_HOST");  // host 里包含 port
    $https = strtolower(_SERVER("HTTPS", "off"));
    $proto = _SERVER("HTTP_X_FORWARDED_PROTO") ? strtolower(_SERVER("HTTP_X_FORWARDED_PROTO")) : ""; //加判断
    $path = substr($_SERVER["PHP_SELF"], 0, strrpos($_SERVER["PHP_SELF"], "/"));
    $http = (($port == 443) || $proto == "https" || ($https && $https != "off")) ? "https" : "http";
    return  "$http://$host$path/";
}

MySql8.0写入数据库报错

前面都解决了,最后安装到写入数据库的时候又出现了Server Response Empty!报错.解决办法超级简单,因为Mysql8.0和之前的版本有蛮多不同.如下:

打开/install/install.sql.将78行的rank替换为ˋrankˋ.参考下面的

替换前

name char(16) NOT NULL default '',            # 版块名称
rank tinyint(3) unsigned NOT NULL default '0',    # 显示,倒序,数字越大越靠前
threads mediumint(8) unsigned NOT NULL default '0',    # 主题数

替换后

name char(16) NOT NULL default '',            # 版块名称
`rank` tinyint(3) unsigned NOT NULL default '0',    # 显示,倒序,数字越大越靠前
threads mediumint(8) unsigned NOT NULL default '0',    # 主题数