Forums

[Plugin: WP-DownloadManager] Least downloads option? (3 posts)

  1. rmsylte
    Member
    Posted 2 years ago #

    I love the widget -- but I'd like to have the option of "Least Downloaded" so that I can help to drive traffic to my files that lack visibility because of low downloads. Is there some way to adjust the php in one of the files to do this?

    http://wordpress.org/extend/plugins/wp-downloadmanager/

  2. rmsylte
    Member
    Posted 2 years ago #

    And, now that I think about it, a RANDOM downloads selection in the widget would also be great!

  3. MichaelH
    Volunteer
    Posted 2 years ago #

    Didn't test this but in wp-downloadmanger.php you could try copying the function get_most_downloaded to a function called get_least_downloaded, then change this:

    $files = $wpdb->get_results("SELECT * FROM $wpdb->downloads WHERE file_permission != -2 ORDER BY file_hits DESC LIMIT $limit");

    to this:

    $files = $wpdb->get_results("SELECT * FROM $wpdb->downloads WHERE file_permission != -2 ORDER BY file_hits ASC LIMIT $limit");

Topic Closed

This topic has been closed to new replies.

About this Topic