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
Filter the of Downloads for every user in phoca dowloads
-
- Phoca Newbie
- Posts: 5
- Joined: 07 Jun 2011, 12:00
-
- Phoca Professional
- Posts: 258
- Joined: 02 Jun 2011, 09:29
- Contact:
Re: Filter the of Downloads for every user in phoca dowloads
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!
).
I think it is possible, but not implemented. So you have to code it youself.
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!

I think it is possible, but not implemented. So you have to code it youself.
-
- Phoca Newbie
- Posts: 5
- Joined: 07 Jun 2011, 12:00
Re: Filter the of Downloads for every user in phoca dowloads
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?
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?
-
- Phoca Professional
- Posts: 258
- Joined: 02 Jun 2011, 09:29
- Contact:
Re: Filter the of Downloads for every user in phoca dowloads
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.
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.
-
- Phoca Newbie
- Posts: 5
- Joined: 07 Jun 2011, 12:00
Re: Filter the of Downloads for every user in phoca dowloads
Can you give me some idea on how to code the blocking of downloads per category?
-
- Phoca Professional
- Posts: 258
- Joined: 02 Jun 2011, 09:29
- Contact:
Re: Filter the of Downloads for every user in phoca dowloads
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.
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.
-
- Phoca Newbie
- Posts: 5
- Joined: 07 Jun 2011, 12:00
Re: Filter the of Downloads for every user in phoca dowloads


-
- Phoca Professional
- Posts: 258
- Joined: 02 Jun 2011, 09:29
- Contact:
Re: Filter the of Downloads for every user in phoca dowloads
Sorry but other things have a higher priority at the moment! So I have not the time for hacking this!
-
- Phoca Newbie
- Posts: 5
- Joined: 07 Jun 2011, 12:00
Re: Filter the of Downloads for every user in phoca dowloads
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.
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.
-
- Phoca Member
- Posts: 11
- Joined: 04 May 2013, 18:12
Re: Filter the of Downloads for every user in phoca dowloads
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
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