电脑安全

您当前的位置:主页 > 电脑安全 >

Discuz论坛2.5 升级到PHP MySQL新版遇到的问题-网络编

来源:[db:来源]标题:   设置为    编辑:电脑技术全能网 时间:2019-09-20 06:25

原标题:Discuz论坛2.5 升级到PHP MySQL新版遇到的问题-网络编
   1 中文成绩,在应用MySQL实例设置东西的应用,将应用的字符集设置为GBK,而不要设置为UTF-82 MySQL装置后暗码无奈拜访成绩:mysql> SET PASSWORD FOR -> 'some_user'@'some_host' = OLD_PASSWORD('newpwd');3 PHP有Warning在php.ini外面找到bug_combat_warning = 1 两行,1 改成 04 MySQL 对SQL拔出履行更强的格局检讨.以是假如某个列是整数,就不能应用''来拔出.因而修正Discuz的一个函数以下function updatesession() { if(empty($GLOBALS['sessionupdated'])) { global $db, $sessionexists, $sessionupdated, $sid, $onlineip, $discuz_uid, $discuz_user, $timestamp, $groupid, $styleid, $invisible, $discuz_action, $fid, $tid, $onlinehold, $logincredits, $table_sessions, $table_members, $user_lastactivity, $onlinehold; if($sessionexists == 1) { $db->query("UPDATE $table_sessions SET uid='$discuz_uid', username='$discuz_user', groupid='$groupid', styleid='$styleid', invisible='" . ($invisible==""?0:1) . "', action='$discuz_action', lastactivity='$timestamp', fid='" . ($fid==""?0:1) . "', tid='" . ($tid==""?0:1) . "' WHERE sid='$sid'"); if ($onlinehold && $user_lastactivity && $timestamp - $user_lastactivity > $onlinehold) { $db->query("UPDATE $table_members SET lastvisit=lastactivity, lastactivity=$timestamp WHERE uid='$discuz_uid'", 'UNBUFFERED'); } } else { $ips = explode('.', $onlineip); $db->query("DELETE FROM $table_sessions WHERE sid='$sid' OR lastactivity<($timestamp-$onlinehold) OR ('$discuz_uid'<>'0' AND uid='$discuz_uid') OR (uid='0' AND ip1='$ips[0]' AND ip2='$ips[1]' AND ip3='$ips[2]' AND ip4='$ips[3]' AND lastactivity>$timestamp-60)"); $db->query("INSERT INTO $table_sessions (sid, ip1, ip2, ip3, ip4, uid, username, groupid, styleid, invisible, action, lastactivity, fid, tid) VALUES ('$sid', '$ips[0]', '$ips[1]', '$ips[2]', '$ips[3]', '$discuz_uid', '$discuz_user', '$groupid', '$styleid', '" . ($invisible==""?0:1) . "', '$discuz_action', '$timestamp', '" . ($fid==""?0:1) . "', '" . ($tid==""?0:1) . "')"); if($discuz_uid) { $db->query("UPDATE $table_members SET credit=credit ".intval($logincredits).", lastip='$onlineip', lastvisit=lastactivity, lastactivity=$timestamp WHERE uid='$discuz_uid'", 'UNBUFFERED'); } } $sessionupdated = 1; }}

上一篇:史上最简! IIS 下安装 PHP-网络编程

下一篇:没有了