Project:Download Count
Version:6.x-2.x-dev
Component:Miscellaneous
Category:feature request
Priority:critical
Assigned:WorldFallz
Status:closed (fixed)

Issue Summary

I was hoping that the download_count module would allow me to add a sort criteria for my views to sort them by download counts (number of downloads); however, I cannot figure out how to add download counts as a criteria to sort my views. Has anyone been able to filter or sort their views by the number of downloads? It would be very useful for showing which downloads are the most popular, not by node views, but by the number of actual downloads.

Thanks!

Comments

#1

Category:support request» feature request

This is next on my list.

#2

Tracking.

#3

Version:5.x-1.x-dev» 6.x-1.3

Hi!

I made some modifications on this module to fit my needs, I hope this help.

As I don't have familiarity with CVS tools, I will attach a zip with all sources, instead of a path file.

Regards,
André

AttachmentSize
download_count_with_views.zip 14.61 KB

#4

Can you please tell me what version this is changed against? I ask because I'm looking to apply the CCK patch as well, and I need to know what you started with for this (6.x-1.3 release, 6.x-1.x-dev, or CVS) (I see that it's 6.x-1.3 5.27.2009)

BTW, a patch file is made by running "diff" - e.g.:
diff -up path/to/file/example.module path/to/file/exampleNew.module > mypatchname.patch
(See: http://drupal.org/patch/create - there are also user comments on patch and diff there as well)

Once you generate a patch you should check that it works by applying it to your original:
patch -p0 < path/file.patch ...and then test your new module.
Note - the file to be patched is specified inside the patch file -- that's why you don't see your module file in that command. So let's say you ran the diff on two files in the local directory without specifying any path; then place the patch file in the same dir as the file(s) to be patched, and while in that folder run the above patch command. Or if you were in a parent directory and ran diff on files in separate subdir's, then do the same again for patch. And so on.

Also, if you're doing anything on a windoze box then make sure your end-of-line char's are not ^M's by using a unix style text editor (textpad for example) and/or running dos2unix on any files you modify before you diff or patch.

#5

Version:6.x-1.3» 6.x-1.x-dev

Update: this is on the todo list for the new 6.x-2.x version.

#6

Version:6.x-1.x-dev»

#7

Status:active» fixed

already doable with views 3 using the new 'grouping' feature. Very slick.

#8

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

#9

Version:» 6.x-2.x-dev
Status:closed (fixed)» active

WorldFallz, should we assume you won't provide a Views 2 handler for sorting by number of downloads and for displaying number of downloads, then? I'm not ready to move to Views 3 yet, as I imagine many people are.. But it'd be great to have this functionality.

#10

I'm struggling with with this and have been going back and forth with it. Using views 2 would also require some custom handler code or the views_groupby module which I've found to be pretty buggy. I'm having very little free time these days so unless someone provides a views2 patch, I dont think I can justify expending the time. I still have to make some time, albeit much much less, to make a good starting default view for views 3.

#11

Understood. Thanks for the clarification! If I have time I will look into it, but it doesn't seem likely. :(

#12

Priority:normal» critical
Assigned to:Anonymous» wundo

Good morning,
I'm finishing the development of this feature ;)

Fabiano

#13

Here is the patch for ordering by # of downloads, I'm planning to add a field for the # of downloads latter today. If there is any other integration that you think would be nice, please let me know.

AttachmentSize
download_count_views2_support.patch 2.84 KB
views_handler_sort_by_download_counter.inc_.patch 547 bytes

#14

Status:active» needs review

#15

awesome-- thanks for taking this on. I should get to this later this evening!

#16

Hi, sorry to ask but does someone have a zip patched download file module that is working that they can link to this post. I tried to apply the patch but I get a bunch of errors so not sure how that happen as I'm am use to patching different modules all the time. Thanks.

#17

#16: "A bunch of errors" isn't really helpful.

  1. Be sure you are using the latest dev version
  2. Try using the -p0 option to apply the first patch: patch -p0 < download_count_views2_support.patch.
  3. It looks like the second file is not a true patch, so instead try just downloading it in the module directory and rename it to views_handler_sort_by_download_counter.inc.

#18

just an update-- i'm hoping to get to this soon. thanks for the patience ;-)

#19

Here are the errors I get from this patch using 6.x-2.x-dev:

$ patch -p0 < download_count_views2_support.patch
patching file download_count.module
Hunk #1 FAILED at 181.
1 out of 1 hunk FAILED -- saving rejects to file download_count.module.rej
patching file includes/download_count.views.inc
Hunk #1 FAILED at 35.
Hunk #2 succeeded at 66 with fuzz 2 (offset 2 lines).
Hunk #3 FAILED at 129.

#20

good idea , I`m looking for that

#21

I'm also very interested to get this functionality. I hope soon this extension will be available.

Thanks

#22

#17: Yep the second file isn't a patch is a brand new file.

#23

#19: I probably need to re-roll it, I will take a look at it latter.

#24

Same problem as #19.

#25

Status:needs review» needs work

I'm working on this now-- but I'm getting broken/missing handler with views. Hopefully I'll get it figured out soon. In addition to the download count sort option I plan to add a download count 'field' as well.

If anyone has any updates/corrections now is the time to post 'em-- thanks.

#26

Assigned to:wundo» WorldFallz
Status:needs work» needs review

http://drupal.org/cvs?commit=467264

I just expanded views2 support with field, filter, and sort handlers as well as 2 default sample views.

I struggled a bit getting the handlers to work properly so I'd appreciate any code review and testing on these new changes.

#27

Status:needs review» fixed

well, it seems to be working so far. If anyone encounters any problems, create a new issue.

#28

Ahh, thank you. I will test and post back the results when I have added to a test site.

#29

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.