Seite 1 von 1
Intro + Portal MOD: Einen Beitrag aus der Top-Liste entferne
Verfasst: 04.11.2006 23:40
von Elektron
Hallo,
ich möchte gerne einen bestimmten Beitrag aus der Top-Liste löschen. Dieser beitrag erreicht zwar die nötige Anzahl an Beiträgen jedoch möchte ich diesen speziellen Beitrag nicht in der Top-Liste aufgeführt haben.
Was muss ich hierfür tun?
Danke
Gruß Elektron
Verfasst: 06.11.2006 10:23
von Elektron
Hat niemand eine Idee oder poste ich im falschen Bereich?
Meine andere Alterantive wäre,(was ich aber nicht gerne mag) den Beitrag in mehrere Beiträge zu teilen, damit dieser somit aus der Top-List fällt.
Gruß Elektron
Verfasst: 06.11.2006 10:33
von Dr.Death
Hi,
verlinke mal Deine verwendetet portal.php
Und gib hier mal die auszuschliesende TOPIC ID an.
Verfasst: 06.11.2006 10:58
von Elektron
Topic ID 3220
Bin zwar etwas php-Blind aber ich denke es muss wohl in diesem Bereich rein:
Code: Alles auswählen
// BEST TOPICS START
if( $introportalmod_config['topposts_active'] == "1" )
{
$beste_topics = $introportalmod_config['topposts_limit'];
$sql = "SELECT topic_id,topic_title,topic_replies
FROM " . TOPICS_TABLE . " t
LEFT JOIN " . FORUMS_TABLE . " f
ON t.forum_id=f.forum_id
WHERE f.auth_view < 2
ORDER BY topic_replies DESC
LIMIT $beste_topics";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain user/online forums information', '', __LINE__, __FILE__, $sql);
}
while ($row = $db->sql_fetchrow($result))
{
$topic_id=$row['topic_id'];
if( $introportalmod_config['topposts_active'] == "1" )
{
$template->assign_block_vars("best_topics", array(
'TOPIC_TITLE' => $row['topic_title'],
'REPLIES' => $row['topic_replies'],
'VIEWTOPIC' => append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id"))
);
}
}
$template->assign_block_vars('switch_topposts_active', array());
}
// BEST TOPICS END
Gruß Elektron
Verfasst: 06.11.2006 12:19
von Dr.Death
Dann ist es einfach:
In dem BLOCK:
Code: Alles auswählen
$sql = "SELECT topic_id,topic_title,topic_replies
FROM " . TOPICS_TABLE . " t
LEFT JOIN " . FORUMS_TABLE . " f
ON t.forum_id=f.forum_id
WHERE f.auth_view < 2
ORDER BY topic_replies DESC
LIMIT $beste_topics";
füge eine zusätzliche AND Bedingung nach der WHERE Zeile ein:
Endergebnis:
Code: Alles auswählen
$sql = "SELECT topic_id,topic_title,topic_replies
FROM " . TOPICS_TABLE . " t
LEFT JOIN " . FORUMS_TABLE . " f
ON t.forum_id=f.forum_id
WHERE f.auth_view < 2
AND topic_id != 3220
ORDER BY topic_replies DESC
LIMIT $beste_topics";
Verfasst: 06.11.2006 12:33
von Elektron
Super Danke hat geklappt.
Danke für die schnelle Hilfe.
Gruß Elektron