Io non so se hai copiato la Mod dal Forum ufficiale, perchè se è così non può funzionare nemmeno lì, a meno che tu non abbia aggiornato la cache e quindi visualizzi la pagina senza le modifiche.
In sostanza il problema sta nella Lista dei Topics più visti. L'ultima modifica prevedeva la possibilità di scegliere il periodo. Tu hai inserito la parte che stabilisce il periodo ma poi hai ripetuto la query:
Codice: Seleziona tutto
//---------- 10 Topics più Visti start -----------//
// modifica Mod: inserisce la selezione del periodo di valutazione
$data_cor = time() ; // timestamp data corrente
$data_6 = ($data_cor - 15811200) ; // timestamp di 182 giorni fa
$data_12 = ($data_cor - 31536000) ; // timestamp di 365 giorni fa
$data_views = $_POST['sel_views'] ; // opzione selezionata
// assegnazione dell'opzione scelta, per default (nessuna selezione) è 6 mesi
if ($data_views == '' || $data_views == '1')
{
$template->assign_var('TIME_SELECTED', '1');
$data_ini = $data_6 ;
}
if ($data_views == '2' )
{
$template->assign_var('TIME_SELECTED', '2');
$data_ini = $data_12 ;
}
if ($data_views == '3')
{
$template->assign_var('TIME_SELECTED', '3');
$data_ini = '0' ;
}
// fine modifica Modifica periodo di valutazione
$sql2 = "SELECT tt.topic_id, tt.forum_id, tt.topic_title, tt.topic_first_poster_name, tt.topic_views,tt.topic_time,
ft.forum_id, ft.forum_name
FROM " . TOPICS_TABLE . " tt, " . FORUMS_TABLE . " ft
WHERE tt.forum_id = ft.forum_id
AND tt.topic_time > $data_ini
ORDER BY tt.topic_views DESC LIMIT 0,$list_rec";
$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 < $list_view)
{
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'];
++$n2 ;
}else{
break ;
}
}
}
//---------- 10 Topics più visti end -----------//
// fine modifica Modifica periodo di valutazione
$sql2 = "SELECT tt.topic_id, tt.forum_id, tt.topic_title, tt.topic_first_poster_name, tt.topic_views,tt.topic_time,
ft.forum_id, ft.forum_name
FROM " . TOPICS_TABLE . " tt, " . FORUMS_TABLE . " ft
WHERE tt.forum_id = ft.forum_id
AND tt.topic_time > $data_ini
ORDER BY tt.topic_views DESC LIMIT 0,$list_rec";
$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 < $list_view)
{
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'];
++$n2 ;
}else{
break ;
}
}
}
//---------- 10 Topics più visti end -----------//
$data_cor = time() ; // timestamp data corrente
$data_6 = ($data_cor - 15811200) ; // timestamp di 182 giorni fa
$data_12 = ($data_cor - 31536000) ; // timestamp di 365 giorni fa
$data_views = $_POST['sel_views'] ; // opzione selezionata
// assegnazione dell'opzione scelta, per default (nessuna selezione) è 6 mesi
if ($data_views == '' || $data_views == '1')
{
$template->assign_var('TIME_SELECTED', '1');
$data_ini = $data_6 ;
}
if ($data_views == '2' )
{
$template->assign_var('TIME_SELECTED', '2');
$data_ini = $data_12 ;
}
if ($data_views == '3')
{
$template->assign_var('TIME_SELECTED', '3');
$data_ini = '0' ;
}
// fine modifica Modifica periodo di valutazione
$sql2 = "SELECT tt.topic_id, tt.forum_id, tt.topic_title, tt.topic_first_poster_name, tt.topic_views,tt.topic_time,
ft.forum_id, ft.forum_name
FROM " . TOPICS_TABLE . " tt, " . FORUMS_TABLE . " ft
WHERE tt.forum_id = ft.forum_id
AND tt.topic_time > $data_ini
ORDER BY tt.topic_views DESC LIMIT 0,$list_rec";
$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 < $list_view)
{
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'];
++$n2 ;
}else{
break ;
}
}
}
//---------- 10 Topics più visti end -----------//
// fine modifica Modifica periodo di valutazione
$sql2 = "SELECT tt.topic_id, tt.forum_id, tt.topic_title, tt.topic_first_poster_name, tt.topic_views,tt.topic_time,
ft.forum_id, ft.forum_name
FROM " . TOPICS_TABLE . " tt, " . FORUMS_TABLE . " ft
WHERE tt.forum_id = ft.forum_id
AND tt.topic_time > $data_ini
ORDER BY tt.topic_views DESC LIMIT 0,$list_rec";
$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 < $list_view)
{
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'];
++$n2 ;
}else{
break ;
}
}
}
//---------- 10 Topics più visti end -----------//
Se segui il codice vedi che la parte che interessa i Topics più visti inizia con
//---------- 10 Topics più Visti start -----------//
Poi c'è la nuova parte che stabilisce il periodo che inizia con:
// modifica Mod: inserisce la selezione del periodo di valutazione
che termina con la riga:
// fine modifica Modifica periodo di valutazione
A questo punto inizia la query che termina con la riga:
//---------- 10 Topics più visti end -----------//
Qui termina la parte dei Topics più visti ma tu hai inserito nuovamente la query, in pratica tutta questa parte è in più perchè doppia:
Codice: Seleziona tutto
// fine modifica Modifica periodo di valutazione
$sql2 = "SELECT tt.topic_id, tt.forum_id, tt.topic_title, tt.topic_first_poster_name, tt.topic_views,tt.topic_time,
ft.forum_id, ft.forum_name
FROM " . TOPICS_TABLE . " tt, " . FORUMS_TABLE . " ft
WHERE tt.forum_id = ft.forum_id
AND tt.topic_time > $data_ini
ORDER BY tt.topic_views DESC LIMIT 0,$list_rec";
$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 < $list_view)
{
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'];
++$n2 ;
}else{
break ;
}
}
}
//---------- 10 Topics più visti end -----------//