Active
Project:
Public Download Count
Version:
7.x-1.0
Component:
Documentation
Priority:
Critical
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
9 Mar 2011 at 05:04 UTC
Updated:
16 Jun 2011 at 21:59 UTC
Hi Friends,
I haven't found any where mentioning how to enable or configure the download count for the file located in an external server.
For example
I have two files on amazon cloud server one is
http://mycloud.s3.amazonaws.com/myfile.exe and
http://mycloud.s3.amazonaws.com/myfile.zip
I have a simple HTML button in my Drupal7 site pointing to this download URL.
Thanks in advance
Comments
Comment #1
pixture commentedAre these buttons in a block or node or views field? PDC module does not support anything other than these. In addition, PDC module only works with anchor tag. Please check this first.
Comment #2
Bright Web Design commentedThank you so much for your reply.
Sorry for not mentioning about where I put the button,
The buttons I have created are in a block with full HTML filter.
The block is placed just below the top menu. (Highlighted region.)
I have also added the file extension "exe" in the file format settings.
Here is the code I have put in my block;
Is there anything I have to do more to work this module?
Thanks in advance.
Comment #3
pixture commentedSorry but what I told you is wrong. PDC module does not support anchor link in blocks because it requires node id (nid) for the record keeping purpose. Here's the way to walk around the issue (assuming you can use PHP filter).
In your block configuration page, select the PHP filter for the input format instead of Filtered/Full HTML. Then add the code something like below.
The code above passes all your block HTML code to pubdlcnt_filter() function. pubdlcnt_filter() function will convert all valid anchors so that PDC module can trace the download count. With this code, you should be able to record the download count of the files in the blocks.
Second parameter of the pubdlcnt_filter() function is a node ID. In case of blocks, there's no node ID, so I used 0 as a dummy node ID.
Please give it a try.
Comment #4
Bright Web Design commentedThat didn't produce any report of downloads.
What happens if I create a custom front--page.tpl.php and add my html download link button instead of block? Does that support this module?
Thanks for your kind help.
Comment #5
pixture commented> What happens if I create a custom front--page.tpl.php and add my html download link button instead of block? Does that support this module?
You can pass any HTML code to pubdlcnt_filter() function from anywhere (block, static page generated by views, modules, theme templates). pubdlcnt_filter() just extract anchor tags included in the passed HTML code and convert them.
Comment #6
Bright Web Design commentedI am really sorry to say this, the one way you suggested me above with block didn't work at all.
Sorry for taking this much time to reply, I am in Japan and the situation was so bad here.
If you can give some other way to work this well, it would be greatly appreciated.
Thanks in advance.
Best Wishes
Comment #7
Bright Web Design commentedDoes anyone know how to make this module to count the downloads from Amazon Cloud Server which I linked from my Drupal site's Block.
If anyone can give me an idea to set this up would be greatly appreciated.
Thanks in advance.
Comment #8
Bright Web Design commentedIt Works with block;
I just used the "block id" instead of "nod id".
Now I can see in the source code php has been added by the pdc module.
However I don't get any download count data on the report section. I think it's because of localserver
Let me try it on the live site.
Will be back with the result soon.
Thank you so much pixture
Comment #9
Bright Web Design commentedDear Pixture,
How I configured "pudlcnt" module
However I can't see any download count statics on the report area of the "pubdlcnt" module.
Is there anything else I should do to display the download count?
Also if you check the code above it says "nid=4" though I set the "block id" is that the reason for not displaying the result?
Is there anyway to enable this module to work with the "block id" too?
Looking forward to see some tips to work this with "blocks id".
Thank you so much
Comment #10
Bright Web Design commentedI have tried everything but nothing shows the download count.
I can see the "(0)" count number always but nothing shows in the report section.
I have even created it on the page instead of block and still it doesn't work for me.
Please suggest me a solution to work this great module! I really need this module.
Best Wishes for your development works.
Comment #11
BenK commentedSubscribing