Forums / Cotonti / Support / Announcments at the top

Trustmaster
#14641 2009-07-21 05:02
This code is for 0.0.6, sorry. 0.0.5 doesn't have poll_code. The query for 0.0.5 would be just:
$sql = sed_sql_query("(SELECT t.* FROM $db_forum_topics AS t
WHERE t.ft_sectionid='$s' $cond
AND t.ft_sticky = 1 AND t.ft_state = 1
ORDER by ft_".$o." ".$w.")
UNION
(SELECT t.* FROM $db_forum_topics AS t
WHERE t.ft_sectionid='$s' $cond
AND t.ft_sticky = 1 AND t.ft_state = 0
ORDER by ft_".$o." ".$w.")
UNION
(SELECT t.* FROM $db_forum_topics AS t
WHERE t.ft_sectionid='$s' $cond
AND t.ft_sticky = 0 AND t.ft_state = 0
ORDER by ft_".$o." ".$w.")
UNION
(SELECT t.* FROM $db_forum_topics AS t
WHERE t.ft_sectionid='$s' $cond
AND t.ft_sticky = 0 AND t.ft_state = 1
ORDER by ft_".$o." ".$w.")
LIMIT $d, ".$cfg['maxtopicsperpage']);
May the Source be with you!