Non avevo modificato la terza query, sostituisci il file php con questo (sempre che il terzo forum sia 214):Shanks le roux ha scritto:Ho inserito i tuoi codici ma niente..Nella prima e nella seconda colonna escono solo degli autori nella terza nulla..
Codice: Seleziona tutto
<?php
// MOD Topten Topics : Topics più recenti di 3 Forums diversi
// created by Micogian (Bingo)
if (!defined('IN_PHPBB'))
{
exit;
}
// configurazione: indicare i records da elaborare e quelli da visualizzare
$list_rec = 20 ; // numero di records da estrarre dalla tabella (alcuni topics potrebbero non aver il permesso di lettura)
$list_view = 10 ; // numero dei recods da visualizzare nella Lista/aumentare il numero dei Topics
//---------- 10 Topics più Recenti Forum 212 - start -----------//
$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.forum_id = '212'
AND 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,$list_rec";
$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 < $list_view)
{
if (strlen($row1['topic_title']) > 28)
{
$topic_title1 = substr($row1['topic_title'],0,27) . "...";
}else{
$topic_title1 = $row1['topic_title'];
}
$last_topic1_link[$n1] = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=" . $row1['forum_id'] . "&t=" . $row1['topic_id']);
$last_topic1_title[$n1] = $row1['topic_title'];
$last_topic1_title_short[$n1] = $topic_title1;
$last_topic1_forum[$n1] = $row1['forum_name'];
$last_topic1_author[$n1] = $row1['topic_first_poster_name'];
//$last_topic1_data[$n1] = $user->format_date($row1['topic_time'], "|d M|");
++$n1 ;
}else{
break ;
}
}
}
//---------- 10 Topics più Recenti Forum 212 - end -----------//
//---------- 10 Topics più Recenti Forum 213 - start -----------//
$sql2 = "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.forum_id = '213'
AND 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,$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'];
}
$last_topic2_link[$n2] = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=" . $row2['forum_id'] . "&t=" . $row2['topic_id']);
$last_topic2_title[$n2] = $row2['topic_title'];
$last_topic2_title_short[$n2] = $topic_title2;
$last_topic2_forum[$n2] = $row2['forum_name'];
$last_topic2_author[$n2] = $row2['topic_first_poster_name'];
++$n2 ;
}else{
break ;
}
}
}
//---------- 10 Topics più Recenti Forum 213 - end -----------//
//---------- 10 Topics più Recenti Forum 214 - start -----------//
$sql3 = "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.forum_id = '214'
AND 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,$list_rec";
$result3 = $db->sql_query($sql3);
$n3 = 0;
while ($row3 = $db->sql_fetchrow($result3))
{
if ($auth->acl_get('f_read', $row3['forum_id']) == 1)
{
if ($n3 < $list_view)
{
if (strlen($row3['topic_title']) > 28)
{
$topic_title3 = substr($row3['topic_title'],0,27) . "...";
}else{
$topic_title3 = $row3['topic_title'];
}
$last_topic_link[$n3] = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=" . $row3['forum_id'] . "&t=" . $row3['topic_id']);
$last_topic_title[$n3] = $row3['topic_title'];
$last_topic_title_short[$n3] = $topic_title3;
$last_topic_forum[$n3] = $row3['forum_name'];
$last_topic_author[$n3] = $row3['topic_first_poster_name'];
++$n3 ;
}else{
break ;
}
}
}
//---------- 10 Topics più Recenti Forum 214 - end -----------//
// Crea l'array "topten_list" che contiene le Variabili per il Template
for ($x = 0; $x < $list_view; ++$x)
{
$template->assign_block_vars('topten_list',array(
'LAST_TOPIC1_LINK' => $last_topic1_link[$x],
'LAST_TOPIC1_TITLE' => $last_topic1_title[$x],
'LAST_TOPIC1_TITLE_SHORT' => $last_topic1_title_short[$x],
'LAST_TOPIC1_FORUM' => $last_topic1_forum[$x],
'LAST_TOPIC1_AUTHOR' => $last_topic1_author[$x],
'LAST_TOPIC2_LINK' => $last_topic2_link[$x],
'LAST_TOPIC2_TITLE' => $last_topic2_title[$x],
'LAST_TOPIC2_TITLE_SHORT' => $last_topic2_title_short[$x],
'LAST_TOPIC2_FORUM' => $last_topic2_forum[$x],
'LAST_TOPIC2_AUTHOR' => $last_topic2_author[$x],
'LAST_TOPIC3_LINK' => $last_topic3_link[$x],
'LAST_TOPIC3_TITLE' => $last_topic3_title[$x],
'LAST_TOPIC3_TITLE_SHORT' => $last_topic3_title_short[$x],
'LAST_TOPIC3_FORUM' => $last_topic3_forum[$x],
'LAST_TOPIC3_AUTHOR' => $last_topic3_author[$x],
));
}
?>