Downloadcontrol+wdir scenario

Third Party Plugins to CMSimple - how to install, use and create plugins

Moderator: Tata

Tata
Posts: 3109
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Downloadcontrol+wdir scenario

Post by Tata » Sat Apr 23, 2016 9:13 am

I can't by some reason get the downloadcontrol rinning. But it is that I have probably wrong understood the downloadcontrol concept. The scenario is about like this:
I have a dir structue:
userfiles
-- downloads
-- protected
---- documents-a
---- documents-b
---- documents-c
-- public

and a page structure
DOCUMENTS
-- Documents A (shall be protected)
-- Documents B (shall be protected)
-- Documents C (shall be protected)
-- Others (shall be public)

Code: Select all

<h1>Downloads</h1>
{{{submenu();}}}
<h2>Protected</h2>
{{{submenu();}}}
{{{expand();}}}
<h3>Documents A</h3>
{{{wdir('/downloads/protected/documents-a/');}}}
<h3>Documents B</h3>
{{{wdir('/downloads/protected/documents-b/');}}}
<h3>Documents C</h3>
{{{wdir('/downloads/protected/documents-c/');}}}
The pages are expandable by expandcontract plugin. To make the documents easily downloadable, I use wdir_xh. There are documents which I want to know only how many times they were downloaded and by the protected documents I want to know who has them downloaded.
How shall I combine these two plugins?
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

cmb
Posts: 13274
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: Downloadcontrol+wdir scenario

Post by cmb » Wed Apr 27, 2016 11:59 am

Tata wrote:I can't by some reason get the downloadcontrol rinning.To make the documents easily downloadable,
[…]I use wdir_xh. There are documents which I want to know only how many times they were downloaded and by the protected documents I want to know who has them downloaded.
How shall I combine these two plugins?
Short answer: you can't. Wdir_XH shows links to files regardless whether it's possible to access them – the plugin simply doesn't know that Downloadcontrol uses different URLs to access the protected files.

I see three possible solutions:
  1. Wdir_XH would have to be extended to also offer protected downloads
  2. Downloadcontrol would have to be extended to offer a directory listing (instead of single download buttons only)
  3. Wdir_XH would be able to get the necessary info from Downloadcontrol
The third option might be best regarding modularity, but that would require some public API offered by Downloadcontrol, and maintaining a public API is often somewhat painful and restricting. svasti, what do you think?
Christoph M. Becker – Plugins for CMSimple_XH

Tata
Posts: 3109
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: Downloadcontrol+wdir scenario

Post by Tata » Tue May 10, 2016 6:04 am

Would it be possible to extend Wdir_XH at least by the counter column "Downloaded"? This wouldn't be that complpicated.
I can also imagine following:
To see the list of files similar to Wdir_XH frontend in the backend too, extended by the column "Protected" with a checkbox. In frontend then a warning "You must register to download this file." would be returned.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

svasti
Posts: 1649
Joined: Wed Dec 17, 2008 5:08 pm

Re: Downloadcontrol+wdir scenario

Post by svasti » Tue May 10, 2016 2:34 pm

Tata wrote:I have a dir structue:
userfiles
-- downloads
-- protected
---- documents-a
---- documents-b
---- documents-c
-- public
This doesn't work. The "protected" folder must be a subfolder of downloads or downloads itself (which would be not so practical)
It is supposed to be this way:
userfiles
-- downloads (is public, no separate public folder necessary)
---- protected
------ documents-a
------ documents-b
------ documents-c
Tata wrote:There are documents which I want to know only how many times they were downloaded and by the protected documents I want to know who has them downloaded.
Downloadcontrol counts how often and who is downloading. It records the IP-adress, and if you use register_XH/Memberpages it records the name of the downloader.
Tata wrote: In frontend then a warning "You must register to download this file." would be returned.
Downloadcontrol also does this. Alternatively there is the setting in which the downloader is asked to give his/her name first before downloading. This name will be recorded.
cmb wrote:Downloadcontrol would have to be extended to offer a directory listing (instead of single download buttons only)
Downloadcontrol already offers directory listings. Just give a folder name in the plugin call. E.g. without argument {{{downloadcontrol}}} the whole protected folder is listed.
cmb wrote:maintaining a public API is often somewhat painful and restricting. svasti, what do you think?
I have never done this... one could try. However I think in this particular case Downloadcontrol offers already everything that Tata is asking for. I concede that Wdir_XH looks nicer and additionally gives the date of last change, but otherwise Downloadcontrol also gives file sizes in folder listings and there are even two styles of folder listings (links or buttons) to choose from.

cmb
Posts: 13274
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: Downloadcontrol+wdir scenario

Post by cmb » Tue May 10, 2016 3:04 pm

svasti wrote:However I think in this particular case Downloadcontrol offers already everything that Tata is asking for. I concede that Wdir_XH looks nicer and additionally gives the date of last change, but otherwise Downloadcontrol also gives file sizes in folder listings and there are even two styles of folder listings (links or buttons) to choose from.
Great! I wasn't aware of this feature. So I don't see a need to provide a public API or extend Wdir_XH. :)
Christoph M. Becker – Plugins for CMSimple_XH

Tata
Posts: 3109
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: Downloadcontrol+wdir scenario

Post by Tata » Wed May 11, 2016 7:51 pm

I still thing about a plugin combining features of existing ones (Wdir_XH, dlcounter,Downloadcontrol, protecteddownload). Just I have no clue, which one should be the first step plugin for extension. But the result could be like this:
[ external image ]
In the backend there could be - except of all srandard settings - also the choise:
- which columns should be shown in frontend
- if the names in frontend should be trunctated or overflow-x should be used instead

The radio buttons should be dimed if the files shall be downloadbale without restriction.

A couple of years ago, joining this admirable forum, I said I often know WHAT but fon't know HOW.
Does anybodyknow HOW and would try THIS?
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

svasti
Posts: 1649
Joined: Wed Dec 17, 2008 5:08 pm

Re: Downloadcontrol+wdir scenario

Post by svasti » Sun May 15, 2016 9:03 am

Interesting, now it's getting a little clearer to me what you are looking for. I actually already started to improve the folder download of Downloadcontrol. ...
However you may not get everything.
I personally don't need it... still using Christoph's dlcounter instead of Downloadcontrol :lol:

Tata
Posts: 3109
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: Downloadcontrol+wdir scenario

Post by Tata » Sun May 15, 2016 9:21 am

My intention is basicaly to combine the Wdir + Dlcounter + Downloadcontrol (protecteddownload) in one plugin.
If only Wdir + Dlcounter would be combined - it would be excellent already - protected files could be placed on a protected page (supported by memberspages or register).
Downloadcontrol is undoubthly excellent. It is only about getting all relevant aspects in a "tabel-lilke" shape.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

svasti
Posts: 1649
Joined: Wed Dec 17, 2008 5:08 pm

Re: Downloadcontrol+wdir scenario

Post by svasti » Fri Jun 10, 2016 4:18 pm

Try out the new Downloadcontrol 1.7 beta

If you give as 1st argument a folder name (or nothing = basic protected folder) or a comma separated list of files, the plugin creates a table with a list similar to Wdir.

However you cannot set password protection etc per file in such a table of files. This protection has to be set per table.
So if you have different types of files, you have to make different downloadcontrol tables. One for all password protected files, one for free files.
You can also ask for login or for the name and location of the downloader.
It is not exactly what you wanted, but it comes close I think.

Tata
Posts: 3109
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: Downloadcontrol+wdir scenario

Post by Tata » Fri Jun 10, 2016 4:22 pm

Thank you for thinking about my idea. Will give a try this weekend.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

Post Reply