Seite 1 von 1

Themen-Sortierung in einem Forum

Verfasst: 24.09.2004 16:44
von ThomasB
Tag,

ich suche ne Lösung für folgendes Problem:

Ich hab ein Unterforum für News. Die Threads werden ja normalerweise nach dem letzten Beitrag sortiert. D.h. der Thread mit dem neuesten Beitrag ist oben.
In diesem News Forum sollen die Threads sich aber nicht verschieben, damit die News ihre Chronologie behalten. Ich will die Threads aber nicht sperren. Die User sollen zu den News antworten können.

Ich hoffe, ihr habt verstanden worum es mir geht.

Jemand ne Idee wie ich das umsetzen könnte? Danke. :)

Verfasst: 24.09.2004 16:56
von Acid
viewforum.php

Code: Alles auswählen

#
#------[ FINDE ]------------------------
#
// Grab all the basic data (all topics except announcements)
// for this forum
//

#
#------[ DARUNTER EINFÜGEN ]------------------------
#
# ForenID anpassen

$topic_sorting = ( $forum_id == '1' ) ? "t.topic_id DESC" : "t.topic_last_post_id DESC";

#
#------[ FINDE ]------------------------
#
	ORDER BY t.topic_type DESC, t.topic_last_post_id DESC 

#
#------[ MIT FOLGENDEM ERSETZEN ]------------------------
#
	ORDER BY t.topic_type DESC, $topic_sorting

Verfasst: 24.09.2004 19:25
von ThomasB
Funktioniert! Danke für die schnelle Hilfe. :)

Wie müsste die Zeile aussehen, wenn ich das für ein weiteres Forum haben möchte?

Also die hier:

Code: Alles auswählen

$topic_sorting = ( $forum_id == '1' ) ? "t.topic_id DESC" : "t.topic_last_post_id DESC"; 

Verfasst: 24.09.2004 19:33
von Acid
$topic_sorting = ( $forum_id == '1' || $forum_id == '2' ) ? "t.topic_id DESC" : "t.topic_last_post_id DESC";
Oder ein wenig übersichtlicher (wenn´s dann irgendwann vielleicht noch mehr Foren werden)..
$topic_sorting = ( in_array($forum_id, array(1,2)) ) ? "t.topic_id DESC" : "t.topic_last_post_id DESC";

Verfasst: 24.09.2004 19:41
von ThomasB
Funktioniert auch. Danke nochmal für den tollen Support.