ich würde gern eine Abfrage/Anzeige in der "Forums-Vorschau" bei meinem Portal ändern ..
die Abfrage die derzeit drin ist :
Code: Alles auswählen
//
// Recent hot topics
//
$sql = 'SELECT topic_title, forum_id, topic_id
FROM ' . TOPICS_TABLE . '
WHERE topic_approved = 1
AND topic_replies >=' . $config['hot_threshold'] . '
' . $sql_where . '
ORDER BY topic_time DESC';
$result = $db->sql_query_limit($sql, $CFG['max_topics']);
while( ($row = $db->sql_fetchrow($result)) && ($row['topic_title'] != '') )
{
// auto auth
if ( ($auth->acl_get('f_read', $row['forum_id'])) || ($row['forum_id'] == '0') )
{
$template->assign_block_vars('latest_hot_topics', array(
'TITLE' => character_limit($row['topic_title'], $CFG['recent_title_limit']),
'FULL_TITLE' => censor_text($row['topic_title']),
'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&t=' . $row['topic_id'])
)
);
}
}
$db->sql_freeresult($result);
Link zum bessren Verständniss: http://diebadener2.di.funpic.de/
unten ist die "Vorschau"
edit: mir is a fehler unterlaufen .. jetzt ist der code da , der gebraucht wird
und ich hab noch einen code.. mit dem das warscheinlich nocht besser , noch leichter geht :
Code: Alles auswählen
//
// Recent announcements
//
$sql = 'SELECT topic_title, forum_id, topic_id
FROM ' . TOPICS_TABLE . '
WHERE topic_status <> 2
AND topic_approved = 1
AND ( topic_type = 2 OR topic_type = 3 )
' . $sql_where . '
ORDER BY topic_time DESC';
$result = $db->sql_query_limit($sql, $CFG['max_topics']);
while( ($row = $db->sql_fetchrow($result)) && ($row['topic_title'] != '') )
{
// auto auth
if ( ($auth->acl_get('f_read', $row['forum_id'])) || ($row['forum_id'] == '0') )
{
$template->assign_block_vars('latest_announcements', array(
'TITLE' => character_limit($row['topic_title'], $CFG['recent_title_limit']),
'FULL_TITLE' => censor_text($row['topic_title']),
'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&t=' . $row['topic_id'])
)
);
}
}
$db->sql_freeresult($result);
geändert werden
also hier :
Code: Alles auswählen
WHERE topic_status <> 2
AND topic_approved = 1
AND ( topic_type = 2 OR topic_type = 3 )
Code: Alles auswählen
$template->assign_block_vars('latest_announcements', array(
erledigt... bin durch den zweiten code selbst auf die lösung gekommen ( mal in die datenbank zu guggen und dann zu testen welcher topicstatus/topictyp der richtige ist)