Ich nehme an das erste ist für den Sort Search Results Mod oder?Weil das scheint nicht zu funzen ich bekomme diese fehlermeldung wenn ich da nach Bewertung sortiere:saerdnaer hat geschrieben:@JLoop©: für die suche musst fu folgendes:durch folgendesCode: Alles auswählen
$sql .= 'IF(rating = NULL, 0, rating)';
ersetzen.Code: Alles auswählen
$sql .= 'IF(rating = NULL, 0, rating) ' . $sort_order . ', t.topic_last_post_id';
und für die topic sortierung folgendes:durch folgendesCode: Alles auswählen
$order_by = "IF(rating = NULL, 0, rating) $sort_order";
ersetzenCode: Alles auswählen
$order_by = "IF(rating = NULL, 0, rating) $sort_order, t.topic_last_post_id $sort_order";
Code: Alles auswählen
Could not obtain search results
DEBUG MODE
SQL Error : 1064 You have an error in your SQL syntax near 'GROUP BY t.topic_id IF(rating = NULL, 0, rating) , t.topic_last_post_id DESC LIM' at line 8
SELECT t.*, f.forum_id, f.forum_name, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_username, p2.post_username AS post_username2, p2.post_time , AVG(rating) AS rating FROM phpbb_topics t, phpbb_forums f, phpbb_users u, phpbb_posts p, phpbb_posts p2, phpbb_users u2 LEFT JOIN phpbb_rate_results r ON r.topic_id = t.topic_id WHERE t.topic_id IN (87, 89, 91, 113) AND t.topic_poster = u.user_id AND f.forum_id = t.forum_id AND p.post_id = t.topic_first_post_id AND p2.post_id = t.topic_last_post_id AND u2.user_id = p2.poster_id ORDER BY GROUP BY t.topic_id IF(rating = NULL, 0, rating) , t.topic_last_post_id DESC LIMIT 0, 50
Line : 794
File : search.php
Code: Alles auswählen
default:
$sql .= ( $show_results == 'posts' ) ? 'p.post_time' : 'p2.post_time';
break;
Ich habe es schon so probiert das ich des:
Code: Alles auswählen
$sql .= ' IF(rating = NULL, 0, rating) ' . $sort_order . ', t.topic_last_post_id';
Code: Alles auswählen
$sql .= ' IF(rating = NULL, 0, rating) ' . $sort_order . ', ( $show_results == 'posts' ) ? 'p.post_time' : 'p2.post_time';

Grüße JLoop