Page 1 of 1

PhocaDownload plugin show unpublished files

Posted: 21 Nov 2016, 00:02
by worknmn
Hello.
Version joomla! 3.6.4.
Phocadownload plugin 3.1.2

Then i use "File list", it show also unpublished files.

I found in 261 string from phocadownload.php(main file of plugin)

Code: Select all

						if ((int)$id > 0) {
							$query .= ' WHERE c.id = '.(int)$id;
							//$query .= ' WHERE c.id = '.(int)$id . ' AND a.published = 1 AND a.approved = 1';
						} else {
							//$query .= ' WHERE a.published = 1 AND a.approved = 1';
						}
You have resolve problem, but why you comment string with published check?

Re: PhocaDownload plugin show unpublished files

Posted: 22 Nov 2016, 22:55
by Jan
Hi, this is because in article the article access rules are valid. There are users, who want to display unacessible files in plugin. So if you add plugin code with list of unpublished files, it mostly means you really want to display them. If you don't want to display them, you will not paste the plugin there.

It is really hard do decide which part is right. Some users say, when I want to display the plugin, I want to display it even the files are not accessible - user will see the files and click on login to download them. Others say, they just want to have the same rule like in component.

This is why the code is not removed but commented only, so everybody can decide which rule he/she will follow. :idea:

Jan

Re: PhocaDownload plugin show unpublished files

Posted: 25 Nov 2016, 18:00
by worknmn
Thank you for answer.
I think need use plugin options for this feature.