Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm using this plugin (http://wordpress.org/extend/plugins/wp-downloadmanager/) as my download manager. While it's very simplistic and does great for what i need, the statistics to output on the site lack a little.

The only useful function really is: Display Most downloaded (of all time). While i do use this, it would be handy to have a Most downloaded this week or this month as new files get lost on the all time ranks.

I've dug through the code and found this query for the most downloaded function:

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

I'm not sure if it's possible as i haven't a clue about mysql but can we simply add something to that line to query most downloaded files during this week or month?

More info on the plugin here: http://lesterchan.net/wordpress/readme/wp-downloadmanager.html (Click on the usage tab)

Thanks

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Simple answer: No.

Complex answer: After looking at the plugin's source code, the downloads table used to store the stats is not structured such that you could just edit this single query to give you that kind of information. It would take a much more extensive rewrite of the plugin to handle your request.

Possible Workaround: The plugin has a function called get_recent_downloads which looks like it outputs a list of the newest files.

share|improve this answer
    
Thanks for the info. Shame that the author didn't write it in a way to allow such a function. Never-mind. –  Blackbird Feb 21 '11 at 18:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.