esperitox
Saerdnaers Topics Order Hack - Nach Bewertung sortieren?
Forumsregeln
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.0, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.0, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
Hier ein dump:
esperitox
Code: Alles auswählen
INSERT INTO phpbb_rate_results VALUES (2, 87, 5, '50875136', 1051531580);
INSERT INTO phpbb_rate_results VALUES (2, 122, 4, '50875136', 1051531600);
INSERT INTO phpbb_rate_results VALUES (2, 121, 3, '50875136', 1051531613);
INSERT INTO phpbb_rate_results VALUES (2, 120, 2, '50875136', 1051531626);
INSERT INTO phpbb_rate_results VALUES (2, 118, 1, '50875136', 1051531639);
INSERT INTO phpbb_rate_results VALUES (5, 87, 4, 'd951eddf', 1051610420);
INSERT INTO phpbb_rate_results VALUES (5, 120, 5, 'd951eddf', 1051613637);
INSERT INTO phpbb_rate_results VALUES (3, 87, 4, 'd951eddf', 1051614115);
INSERT INTO phpbb_rate_results VALUES (3, 117, 5, 'd951eddf', 1051614146);
INSERT INTO phpbb_rate_results VALUES (5, 117, 5, 'd951eddf', 1051614190);
dann mal so:
Code: Alles auswählen
$order_by = "rating_avg > 0 $sort_order, rating_avg $sort_order, t.topic_last_post_id $sort_order";
$toh_sql1 = ', AVG(r.rating) AS rating_avg';Nope gibt wieder die fehlermeldung:
esperitox
Code: Alles auswählen
SQL Error : 1054 Unknown column 'rating_avg' in 'order clause'
SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_time, p.post_username , AVG(r.rating) AS rating_avg FROM phpbb_topics t, phpbb_users u, phpbb_posts p, phpbb_users u2 LEFT JOIN phpbb_rate_results r ON r.topic_id = t.topic_id WHERE t.topic_poster = u.user_id AND p.post_id = t.topic_last_post_id AND p.poster_id = u2.user_id AND t.topic_type = 3 GROUP BY t.topic_id, u.user_id, u2.user_id ORDER BY rating_avg > 0 DESC, rating_avg DESC, t.topic_last_post_id DESC
Line : 485
File : /is/htdocs/*****/www.flashmetal.de/board/viewforum.phpund
Code: Alles auswählen
$order_by = "rating_avg $sort_order, t.topic_last_post_id $sort_order";
$toh_sql1 = ', AVG(r.rating) AS rating_avg';-
Qxavier