Code: Alles auswählen
$order_by = "IF( r.rating = NULL, 0 , 1 ) $sort_order, rating_avg $sort_order, t.topic_last_post_id $sort_order";
$toh_sql1 = ', AVG(r.rating) AS rating_avg';
Code: Alles auswählen
$order_by = "IF( r.rating = NULL, 0 , 1 ) $sort_order, rating_avg $sort_order, t.topic_last_post_id $sort_order";
$toh_sql1 = ', AVG(r.rating) AS rating_avg';
Code: Alles auswählen
$order_by = "IF( r.rating = NULL, 0 , 1 ) $sort_order, rating_avg $sort_order, t.topic_last_post_id $sort_order";
$toh_sql1 = ', AVG(r.rating) AS rating_avg';
$toh_sql1 = ', AVG(rating) AS rating';
Code: Alles auswählen
$order_by = "IF( r.rating = NULL, 0 , 1 ) $sort_order, rating_avg $sort_order, t.topic_last_post_id $sort_order";
$toh_sql1 = ', AVG(r.rating) AS rating_avg';
Code: Alles auswählen
case 'rating':
$order_by = "IF( r.rating = NULL, 0 , 1 ) $sort_order, rating_avg $sort_order, t.topic_last_post_id $sort_order";
$toh_sql1 = ', AVG(r.rating) AS rating_avg';
$toh_sql2 = 'LEFT JOIN ' . RATE_TABLE . ' r ON r.topic_id = t.topic_id ';
$toh_sql3 = 'GROUP BY t.topic_id, u.user_id, u2.user_id';
break;