Filter the of Downloads for every user in phoca dowloads

Phoca Download - download manager
chokens86
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 07 Jun 2011, 12:00

Filter the of Downloads for every user in phoca dowloads

Post by chokens86 »

Hi,

I would like to know if anybody here knows how to filter the number of downloads for every user in a particular category in phoca. I appreciated help and suggestions.

Thanks
chok
SonRiab
Phoca Professional
Phoca Professional
Posts: 258
Joined: 02 Jun 2011, 09:29
Contact:

Re: Filter the of Downloads for every user in phoca dowloads

Post by SonRiab »

To make it a more clearer:

You want a statistic displaying which (registered) user downloaded how many in a specific category?
I think Phoca Download does not track downloads per user (witout looking at the code! :wink: ).
I think it is possible, but not implemented. So you have to code it youself.
chokens86
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 07 Jun 2011, 12:00

Re: Filter the of Downloads for every user in phoca dowloads

Post by chokens86 »

Hi SonRiab,

Thanks for the reply, actually what I wanted to happen is that, once the user logged in, they can see their downloads. And for example, there will be 5 images for an instance, there will only be 2 images that they can choose to download among the five. Either of the 5 but limited to 2 downloads only. Is that possible to phoca?
SonRiab
Phoca Professional
Phoca Professional
Posts: 258
Joined: 02 Jun 2011, 09:29
Contact:

Re: Filter the of Downloads for every user in phoca dowloads

Post by SonRiab »

As far as I can say from the code:

PD can track the number of user-downloads per file
but there is no possibility to block downloads for users who reached a limit.
PD checks only if the user has access rights to the category.
So it is possible to view the number of downloads per user! (see Components->Phoca Download->Files->User Statistic)
Blocking downloads should also be possible but you must code it by yourself.
Last edited by SonRiab on 08 Jun 2011, 01:32, edited 1 time in total.
chokens86
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 07 Jun 2011, 12:00

Re: Filter the of Downloads for every user in phoca dowloads

Post by chokens86 »

Can you give me some idea on how to code the blocking of downloads per category?
SonRiab
Phoca Professional
Phoca Professional
Posts: 258
Joined: 02 Jun 2011, 09:29
Contact:

Re: Filter the of Downloads for every user in phoca dowloads

Post by SonRiab »

The important part is the sql query which could look like that (just an example!!!) :

SELECT SUM(`count`) FROM `jos_phocadownload_user_stat`, `jos_phocadownload` WHERE `fileid`=`jos_phocadownload`.`id` AND `jos_phocadownload`.`catid`={category id} AND `userid`={user id}

Now you have the number of user-downloads in the category so you can decide if the user is allowed to download or not.
I am not sure where is the best place to insert this query and the check!
Maybe the query should be insert as a new function to phocadownload.php in the components/com_phocadownload/helpers folder and the rest in the default.php located in components/com_phocadownload/views/category.
But I am not willing to code this hack at the moment and I do not want to give further instructions to code it!
Thx for your understanding.
chokens86
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 07 Jun 2011, 12:00

Re: Filter the of Downloads for every user in phoca dowloads

Post by chokens86 »

:x I barely need help on this. Hope you could help me. :cry:
SonRiab
Phoca Professional
Phoca Professional
Posts: 258
Joined: 02 Jun 2011, 09:29
Contact:

Re: Filter the of Downloads for every user in phoca dowloads

Post by SonRiab »

Sorry but other things have a higher priority at the moment! So I have not the time for hacking this!
chokens86
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 07 Jun 2011, 12:00

Re: Filter the of Downloads for every user in phoca dowloads

Post by chokens86 »

SonRiab,

Thanks for that info you gave me. I will try to find ways to insert that code to where it would be.
I appreciate your help a lot.
sethwcaton
Phoca Member
Phoca Member
Posts: 11
Joined: 04 May 2013, 18:12

Re: Filter the of Downloads for every user in phoca dowloads

Post by sethwcaton »

I have a similar request, in that I want the Super Administrator in the backend to be able to choose a user and see a list of all files that user has downloaded. If this isn't already a feature somehow, it would be a welcome addition.

From the looks of it, one could write a query that would run and show all files a user has downloaded. I know almost nothing about writing the PHP code needed to run the query, but perhaps there's a Joomla extension for running simple queries like that?

If you would, please respond to my original post about this with perhaps a sample query that could do what I'd like to do: viewtopic.php?f=31&t=23305
Post Reply