mettere in ordine alfabetico tutti i topic in un determinato forum..
pero questa script e stata pensata per leggere soltanto i topic dentro i subforum, pero io non voglio che legga i subforum... ma solo i forum
dice da modificare la quary della script per leggere i topic nei forum e non nei subforum ma non riesco a capire come...
ecco la quary
Codice: Seleziona tutto
//QUERY DI SELEZIONE DEI DATI
$sql = "SELECT
pt.topic_id, pt.icon_id, pt.topic_title, pt.topic_views, pt.topic_first_poster_name, pt.topic_time, pf.parent_id, pf.forum_id, pf.forum_name AS forum_name_cor,
UCASE(LEFT(TRIM(LEADING '[' FROM pt.topic_title), 1)) AS first_char
FROM ". TOPICS_TABLE." pt,". FORUMS_TABLE. " pf
WHERE pt.forum_id = pf.forum_id
AND pf.parent_id = $forum_id AND
pt.topic_type = 0
ORDER BY UCASE(TRIM(LEADING '[' FROM pt.topic_title))";
$db->sql_query($sql);
$result = $db->sql_query($sql);
$current_char = '';
$template->assign_block_vars('topic_list', array(
'TOPIC_ICON_IMG' => '',
'TOPIC_TITLE' => "%",
'TOPIC_LINK' => '',
'FORUM_NAME' => "%",
'TOPIC_AUTHOR' => "%",
'VIEWS' => "%"
));
$string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
while ($row = $db->sql_fetchrow($result))
{
if (strchr("0123456789", $row['first_char']) && $current_char == ''){
$current_char = '0';
$template->assign_block_vars('topic_list', array(
'TOPIC_ICON_IMG' => '',
'TOPIC_TITLE' => "0-9",
'TOPIC_LINK' => '',
'TOPIC_AUTHOR' => '',
'VIEWS' => ''
));
} else if (strchr($string, $row['first_char']) ){
if ($row['first_char'] != $current_char) {
chapter($current_char, $row['first_char']);
$current_char = $row['first_char'];
}
}
$template->assign_block_vars('topic_list', array(
'TOPIC_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['img'] : 'misc/empty.gif',
'TOPIC_TITLE' => $row['topic_title'],
'TOPIC_LINK' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't='.$row['topic_id']),
'FORUM_NAME_COR' => $row['forum_name_cor'],
'VIEWS' => $row['topic_views'],
'TOPIC_AUTHOR' => $row['topic_first_poster_name'],
'FIRST_POST_TIME' => date("d.m.Y",$row['topic_time']) //$user->format_date($row['topic_time'])
));
}
$db->sql_freeresult($result);
chapter($current_char, "-");
forte te puoi dirmi cosa devo modificare per far leggere alla script solo i topic del forum e non dei sub