Coder Social home page Coder Social logo

jako / filedownloadr Goto Github PK

View Code? Open in Web Editor NEW

This project forked from goldsky/filedownload-r

1.0 1.0 1.0 7.36 MB

Display a list of downloadable files without revealing the file url.

License: GNU General Public License v2.0

PHP 92.96% JavaScript 1.91% HTML 3.49% CSS 0.82% SCSS 0.83%

filedownloadr's Introduction

Hi, I’m Thomas Jakobi 👋

I am a german web-developer & designer based in Münsterland, Germany. I am the developer and/or maintainer of around 35 open source extras for MODX. I am the owner of Treehill Studio, an agency developing premium extras for MODX.

Open Source

I love open source and I commit some of my spare time in open source projects. Most of these projects are extensions to MODX, a content management system to build fast, secure websites.

If you like my work, you can sponsor me on GitHub Sponsors. You can also buy me a coffee (or two) on Ko-fi. I also offer paid coding of custom MODX extras.

Thomas's GitHub stats

Current work

My last open source extra for MODX was TwoFactorX, a MODX extra that adds a two-factor authentication to the MODX manager. Behind the curtain I am working on Cursus, a premium booking system for MODX on base of Agenda.

filedownloadr's People

Contributors

goldsky avatar jako avatar jasonabird avatar

Watchers

 avatar  avatar  avatar

filedownloadr's Issues

Installation stuck

I am trying to install/update to the newest version on 2.8.5 but it gets always stuck at this point:

Screenshot 2023-09-22 at 10 00 01

No code snippet examples

Can you please add some examples to the documentation of suggested use cases for this?

Adding the following to a modx page does nothing:

[[FileDownload 
&getDir=`assets` 
&browseDirectories=`'1`]]

Can you suggest anything?

I'm using ModX 3 with the default starter template, and so even trying other options, I get nothing.

The rendered HTML:

<div class="container">
    <section>
        <h1>test</h1>
         test content 
         
    </section>

The TEXTAREA for the content:

 test content

 [[!FileDownload?
                &getDir=`assets/vendors`
                &tplFile=`tplDownloadForm`
                &downloadByOther=`0`
                &extShown=`jpg`
                &dateFormat=`d.m.Y`
                ]]

Cheers,
Steve

Snippet FileDownloadLink: Default template doesn't work in MODX 3

The default template

'tpl' => '@CODE: <a href="[[+link]]">[[+filename]]</a>',

doesn't get parsed correctly, because @CODE: (with the colon at the end) is not in the list of valid types:

private $_validTypes = [
'@CHUNK',
'@FILE',
'@CODE',
'@INLINE'
];

Also, the availability of pdoTools is not detected correctly in MODX 3:

if (class_exists('pdoTools') && $pdo = $this->modx->getService('pdoTools')) {


Related topic in the MODX forum: https://community.modx.com/t/filedownloadr-3-0-0-snippet-filedownloadlink-isnt-working/6757

Supplying file descriptions with &chkDesc does not work (except for the first file)

Supplying descriptions in a descriptions chunk does not work except for the first file. The reason is a wrong usage of array_walker, which in its current implementation is effectively a no-op and hence does not actually trim the line breaks before string comparison. The first occurrence is here:

array_walk($linesX, function ($val) {

Instead of

        array_walk($linesX, function ($val) {
            return trim($val);
        });

we probably want

        array_walk($linesX, function (&$val) {
            $val = trim($val);
        });

to actually trim the array elements in-place.

After I applied the above change(s), descriptions work again for all files.

There are several instances throughout the code in FileDownloadR.php with the same issue, and it looks like this problem may affect other options, as well.

USergroups dont seem to work

Hi, i have a page with this tag on it

[[!FileDownload? &mediaSourceId=`4` &groupByDirectory=`1` &userGroups=`1,2,3,4` ]]

This will give me a small login form on the page (name, password) when i fill this in the form disappears and the message You need to login to download files. appears. But not a list of links.

I do login in as a member of usergroup 4. When i remove the &userGroups=1,2,3,4 part the list does show up. So im not able to show this list of files only to a selected usergroup. Do i need to set something specific for these usergroups?

Using MODX 2.8.5

Any ideas?

RDG

&imgTypes property has no effect (defaults are always used)

Supplying a custom image file association chunk does not work. The FileDownloadR always uses the default mapping.

This is because the association is only set in the constructor (__construct()``), but not re-fetched/re-evaluated per call instance (in initConfig()```), so a property set in a call does never take effect.

Not being intimate with the code, I cannot suggest a good fix. In testing, I remedied the defect by adding the lines

        $config['imgType'] = (!empty($config['imgType'])) ? $config['imgType'] : 'fdimages';

and

        $this->imgTypes = $this->getImagetypes(); // re-fetch, just before the closing } of initConfig()

in initConfig() of FileDownloadR.php, but am not confident this is correct and/or does introduce possible other issues…?

Thanks for looking into this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.