Show Items According to Views

Discussion in 'Programming' started by SidhuZ, Oct 20, 2013.

  1. #1
    Heello
    This is Our Website http://www.piratex.us You can see that whenever u refresh the page the torrents on index page are changed.
    I want them to be showed according to the View.For Last 48hrs Uploaded Torrents.The Torrents Having Most views for each category Will be shown to index page.
    Currently I'm using this code for showing torrents
    What changes Should I have to make for Above Part to Work?
    ----------------------------------------------------------------------------------------
    $query = "SELECT torrents.id, torrents.anon, torrents.announce, torrents.category, torrents.leechers, torrents.nfo, torrents.seeders, torrents.name, torrents.times_completed, torrents.size, torrents.added, torrents.comments, torrents.numfiles, torrents.filename, torrents.owner, torrents.external, torrents.freeleech, categories.name AS cat_name, categories.image AS cat_pic, categories.parent_cat AS cat_parent, users.username, users.privacy, IF(torrents.numratings < 2, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id WHERE  parent_cat='$cat' AND visible = 'yes' AND banned = 'no' ORDER BY show_id ASC LIMIT 10";
    PHP:
    [1]: http://www.piratex.us
     
    SidhuZ, Oct 20, 2013 IP