laut https://www.phpbb.de/kb/phpBB32_upgrade_from_31 soll man beim Update auf 3.2 - wegen PHP 7 - in der config.php das
Code: Alles auswählen
$dbms = 'mysql';
Code: Alles auswählen
$dbms = 'phpbb\db\driver\mysqli';
Das würde für das Forum selbst soweit auch funktionieren. Allerdings habe ich ein php-script um mir auf den redaktionellen Seiten (außerhalb /phpBB - Ordner) die "aktuellen Themen" anzeigen zu lassen. Diese "aktuelle-themen.inc.pgp" liegt im Ordner phpBB/.
Wenn ich in der config.php auf mysqli umstelle, kommt bei den "aktuellen Themen" eine Fehlermeldung:
Code: Alles auswählen
[phpBB Debug] PHP Warning: in file [ROOT]/aktuelle-themen.inc.php on line 40: mysql_query(): Access denied for user ''@'localhost' (using password: NO)
[phpBB Debug] PHP Warning: in file [ROOT]/aktuelle-themen.inc.php on line 40: mysql_query(): A link to the server could not be established
SQL Statement Error: Access denied for user ''@'localhost' (using password: NO)
Code: Alles auswählen
$result = mysql_query($sql);
Code: Alles auswählen
<div>
<?php
// ############ Edit below ########################################
$topic_length = '30'; // length of topic title
$topic_limit = '10'; // limit of displayed topics
$special_forums = '0'; // specify forums ('0' = no; '1' = yes)
$forum_ids = ''; // IDs of forums; separate them with a comma
//$config_path = '/phpBB/'; // path to config.php
//$root_path = 'http://www.meine-domain.de/phpBB/'; // link path
// ############ Edit above #######################################
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './phpBB/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include_once($phpbb_root_path . 'common.' . $phpEx);
//$path = dirname(__FILE__);
//include_once($path.$config_path .'config.php');
//mysql_connect($dbhost, $dbuser, $dbpasswd) OR die('Unable to select server.');
//mysql_select_db($dbname) OR die('Unable to select database.');
// ############## output ##############
echo '<table border="0" cellpadding="0" cellspacing="0" style="width: 100%">
<tr>
<td>
<h3 style="background-color:#00aa00; color:#ffffff" ><img src="/bilder/ffffff.gif" alt="fff"> FORUM ... aktuelle Themen »</h3><br>
</td>
</tr>';
// ############## output ##############
$where_forums = ( $special_forums == '0' ) ? '' : 't.forum_id NOT IN ('. $forum_ids .') AND ';
$sql = "SELECT t.*, f.forum_id, f.forum_name, p2.post_time
FROM ". $table_prefix ."topics t, ". $table_prefix ."forums f, ". $table_prefix ."posts p, ". $table_prefix ."posts p2, ". $table_prefix ."users u2
WHERE $where_forums f.forum_id = t.forum_id AND p.post_id = t.topic_first_post_id AND p2.post_id = t.topic_last_post_id AND u2.user_id = p2.poster_id
ORDER BY t.topic_last_post_id DESC LIMIT $topic_limit";
$result = mysql_query($sql);
if( !$result )
{
die('SQL Statement Error: '. mysql_error());
exit();
}
$line = array();
while( $row = mysql_fetch_array($result) )
{
$line[] = $row;
}
for( $i = 0; $i < count($line); $i++ )
{
$forum_id = $line[$i]['forum_id'];
$forum_url = $root_path .'phpBB/viewforum.php?f='. $forum_id;
$topic_id = $line[$i]['topic_id'];
$topic_url = $root_path .'phpBB/viewtopic.php?t='. $topic_id;
$topic_title = ( strlen($line[$i]['topic_title']) < $topic_length ) ? $line[$i]['topic_title'] : substr(stripslashes($line[$i]['topic_title']), 0, $topic_length) .'...';
$last_url = '<a href="'. $root_path .'phpBB/viewtopic.php?p='. $line[$i]['topic_last_post_id'] .'#'. $line[$i]['topic_last_post_id'] .'" target="_blank">'. $last_author .'</a>';
// ############## output ##############
echo '<tr>
<td><p><img src="/phpBB/styles/prosilver/theme/images/icon_online.gif" alt="latest"> <strong><a href="'. $topic_url .'">'. $topic_title .'</a></strong></p></td>
</tr><tr class="aktuelle-themen_mobile-hide">
<td><p class="klein" style="color:#888">aus: <a href="'. $forum_url .'" style="color:#888">'. $line[$i]['forum_name'] .'</a></td>
</tr>
<tr><td> </td></tr>';
// ############## output ##############
}
echo '</table>';
mysql_close();
?>
</div>
VIELEN DANK!
Uwe