Io ne ho 150000 nel mio Forum e non ho questi problemi.
Fai un'altra prova: devi creare 3 file diversi, non centrano nulla con il Template, sono file php che danno il risultato subito:
1) prova_topics.php
Codice: Seleziona tutto
<?php
/**
*
* @package phpBB3
* @version $Id$
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* @ignore
*/
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
//include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('');
page_header('pagina di prova');
//---------- 10 Topics più Recenti start -----------//
// configurazione: numero dei recods da visualizzare nella Lista
$lista = 10 ; // sostituire il numero della variabile $lista se si desidera diminuire/aumentare il numero dei Topics
$lista_dati = 20 ; // numero di topics da estrarre dalla tabella (alcuni topics potrebbero non aver il permesso di lettura)
function mese_cor($data_cor)
{
$data_short = str_replace("Jan","gen", $data_cor);
$data_short = str_replace("Feb","feb", $data_cor);
$data_short = str_replace("Mar","mar", $data_cor);
$data_short = str_replace("Apr","apr", $data_cor);
$data_short = str_replace("Mag","mag", $data_cor);
$data_short = str_replace("Jun","giu", $data_cor);
$data_short = str_replace("Jul","lug", $data_cor);
$data_short = str_replace("Aug","ago", $data_cor);
$data_short = str_replace("sep","set", $data_cor);
$data_short = str_replace("Oct","ott", $data_cor);
$data_short = str_replace("Nov","nov", $data_cor);
$data_short = str_replace('Dec','dic', $data_cor);
return $data_short;
}
$sql1 = "SELECT tt.topic_id, tt.forum_id, tt.topic_title, tt.topic_time, tt.topic_moved_id, tt.topic_first_poster_name,
ft.forum_id, ft.forum_name
FROM " . TOPICS_TABLE . " tt, " . FORUMS_TABLE . " ft
WHERE tt.topic_type = 0
AND tt.topic_moved_id = 0
AND tt.forum_id = ft.forum_id
ORDER BY tt.topic_time DESC LIMIT 0,$lista_dati";
$result1 = $db->sql_query($sql1);
$n1 = 0;
while ($row1 = $db->sql_fetchrow($result1))
{
if ($auth->acl_get('f_read', $row1['forum_id']) == 1)
{
if ($n1 < $lista)
{
if (strlen($row1['topic_title']) > 28)
{
$topic_title1 = substr($row1['topic_title'],0,27) . "...";
}else{
$topic_title1 = $row1['topic_title'];
}
$last_topic_link[$n1] = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=" . $row1['forum_id'] . "&t=" . $row1['topic_id']);
$last_topic_title[$n1] = $row1['topic_title'];
$last_topic_title_short[$n1] = $topic_title1;
$last_topic_forum[$n1] = $row1['forum_name'];
$last_topic_author[$n1] = $row1['topic_first_poster_name'];
$last_topic_data[$n1] = date("d M",$row1['topic_time']);
echo $last_topic_data[$n1] . " <a style='font-weight: bold' href='" . $last_topic_link[$n1] . "' title='" . $last_topic_title[$n1] . "(in: " . $last_topic_forum[$n1] . ")'>" . $last_topic_title_short[$n1] . "</a> <span style='color: #708090'>(di " . $last_topic_author[$n1] . ")<span><br>";
++$n1 ;
}
}
}
//---------- 10 Topics più Recenti end -----------//
?>
Codice: Seleziona tutto
<?php
/**
*
* @package phpBB3
* @version $Id$
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* @ignore
*/
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
//include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('');
page_header('Lista ultimi posts');
//---------- 10 Ultimi posts start -----------//
// configurazione: numero dei recods da visualizzare nella Lista
$lista = 10 ; // sostituire il numero della variabile $lista se si desidera diminuire/aumentare il numero dei Topics
$lista_posts = 50 ; // numero di posts da estrarre dalla tabella (il numero è più alto perchè viene inserito un solo post per topic)
$sql4 = "SELECT pt.post_id, pt.topic_id, pt.forum_id, pt.post_subject, pt.post_time, pt.poster_id,
tt.topic_id, tt.topic_title,
ut.user_id, ut.username,
ft.forum_id, ft.forum_name
FROM " . POSTS_TABLE . " pt, " . TOPICS_TABLE . " tt, " . FORUMS_TABLE . " ft, " . USERS_TABLE . " ut
WHERE pt.poster_id = ut.user_id
AND pt.forum_id = ft.forum_id
AND tt.topic_id = pt.topic_id
ORDER BY pt.post_time DESC LIMIT 0,$lista_posts";
$result4 = $db->sql_query($sql4);
$n4 = 0 ;
$lista_topics = '' ;
while ($row4 = $db->sql_fetchrow($result4))
{
if ($auth->acl_get('f_read', $row4['forum_id']) == 1)
{
if( strpos($lista_topics, $row4['topic_id']) == '0' AND $n4 < $lista )
{
if (strlen($row4['topic_title']) > 28)
{
$post_title = substr($row4['topic_title'],0,27) . "...";
}else{
$post_title = $row4['topic_title'];
}
$last_post_link[$n4] = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=" . $row4['forum_id'] . "&t=" . $row4['topic_id'] . "#p" . $row4['post_id']);
$last_post_title[$n4] = $row4['topic_title'];
$last_post_title_short[$n4] = $post_title;
$last_post_forum[$n4] = $row4['forum_name'];
$last_post_author[$n4] = $row4['username'];
$lista_topics .= "," . $row4['topic_id'] ;
echo "<a style='font-weight: bold' href='" . $last_post_link[$n4] . "' title='" . $last_post_title[$n4] . " (in: " . $last_post_forum[$n4] . "')>" . $last_post_title_short[$n4] . "</a><span style='color: #708090'> (di " . $last_post_author[$n4] . ")</span><br>";
++$n4 ;
}
}
}
//---------- 10 Ultimi posts end -----------//
?>
Codice: Seleziona tutto
<?php
/**
*
* @package phpBB3
* @version $Id$
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* @ignore
*/
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
//include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('');
if ($user->data['user_id'] == ANONYMOUS)
{
login_box('', $user->lang['LOGIN']);
}
page_header('Topics più visti');
// configurazione: numero dei recods da visualizzare nella Lista
$lista = 10 ; // sostituire il numero della variabile $lista se si desidera diminuire/aumentare il numero dei Topics
$lista_dati = 20 ; // numero di topics da estrarre dalla tabella (alcuni topics potrebbero non aver il permesso di lettura)
//---------- 10 Topics più Visti start -----------//
$sql2 = "SELECT tt.topic_id, tt.forum_id, tt.topic_title, tt.topic_first_poster_name, tt.topic_views,
ft.forum_id, ft.forum_name
FROM " . TOPICS_TABLE . " tt, " . FORUMS_TABLE . " ft
WHERE tt.forum_id = ft.forum_id
ORDER BY tt.topic_views DESC LIMIT 0,$lista_dati";
$result2 = $db->sql_query($sql2);
$n2 = 0 ;
while ($row2 = $db->sql_fetchrow($result2))
{
if ($auth->acl_get('f_read', $row2['forum_id']) == 1)
{
if ($n2 < $lista)
{
if (strlen($row2['topic_title']) > 28)
{
$topic_title2 = substr($row2['topic_title'],0,27) . "...";
}else{
$topic_title2 = $row2['topic_title'];
}
$view_topic_link[$n2] = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=" . $row2['forum_id'] . "&t=" . $row2['topic_id']);
$view_topic_title[$n2] = $row2['topic_title'];
$view_topic_title_short[$n2] = $topic_title2;
$view_topic_forum[$n2] = $row2['forum_name'];
$view_topic_author[$n2] = $row2['topic_first_poster_name'];
$view_topic_views[$n2] = $row2['topic_views'];
echo $view_topic_views[$n2] . " <a style='font-weight: bold' href='" . $view_topic_link[$n2] . "' title='" . $view_topic_title[$n2] . " (in: " . $view_topic_forum[$n2] . ")'>" . $view_topic_title_short[$n2] . "</a> <span style='color: #708090'>(di " . $view_topic_author[$n2] . ")</span><br>";
++$n2 ;
}
}
}
//---------- 10 Topics più visti end -----------//
?>
Ripeto che non crea nessuna tabella, solo l'elenco dei 10 topics come dovrebbe farlo per la Lista.
Così vedi quanto stanno ad aprirsi. Il più complesso è certamente prova_posts.
Non serve nessun aggiornamento della cache.