Forum Replies Created

Viewing 1 replies (of 1 total)
  • I am also VERY interested in making this change. I tracked it down to the getTopRated function, but it looks like it would require a complicated change to the SQL.

    Will someone please help us?


    $query = "
    SELECT *, {$bayesian_formula} AS bayesian_rating
    FROM {$wpdb->posts}
    LEFT JOIN(
    SELECT DISTINCT post_id,
    (SELECT CAST(meta_value AS DECIMAL(10)) FROM {$wpdb->postmeta} WHERE {$wpdb->postmeta}.post_id = meta.post_id AND meta_key ='votes') AS votes,
    (SELECT CAST(meta_value AS DECIMAL(10,2)) FROM {$wpdb->postmeta} WHERE {$wpdb->postmeta}.post_id = meta.post_id AND meta_key ='rating') AS rating
    FROM {$wpdb->postmeta} meta )
    AS newmeta ON {$wpdb->posts}.ID = newmeta.post_id
    WHERE post_status = 'publish' AND post_type = '{$post_type}' {$where}
    GROUP BY ID
    ORDER BY {$sortby} {$order}
    LIMIT {$offset}, {$number}
    ";

Viewing 1 replies (of 1 total)