We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40226
    • 10 Posts
    Hi all
    Am new to Modx Revo plus a beginner in php codes. I need to have a page by listing out some documents from the server for user to download any of them. Once the user has chosen which file to be downloaded, the page should verify if the user has logged onto the homepage(if yes, downloading will starts automatically) else the page will need to get the user to login or register as a new user to the website before this particualr user can download any of the files. Once the downloading is started, there should be a piece of data sent to the website contact person's email by stating which files has been downloaded and who has downloaded it.

    I have tried around with the FormIt command and it seems that my form is not going anywhere(not receiving the notification email, only the must select one of the checkboxes message is working) even after I have clicked on the submit button with selected file(s) but just remaining at the same page..Please refer to my attachment , it seems that this page is not allows me to paste in all my codes here,thanks


    PLEASE HELP AND GUIDE ME ON THIS sad(
    THANKSSSSSSS [ed. note: newbie2000 last edited this post 14 years, 4 months ago.]
      • 813 ☆ A M B ☆
      • 326 Posts
      I'd recommend checking out this extra: http://modx.com/extras/package/filelister. Does that do what you need?
        • 40226
        • 10 Posts
        Hi aladage,
        I have tried using the FileLister by using the example code(from http://rtfm.modx.com/display/ADDON/FileLister ) to run on a test page and no data appears but just the Files and Directories titles are shown. I'm totally lost in how to get this working on using the Modx, from FileListert(it was at 1st giving me the error "Fatal error: Call to undefined function mcrypt_module_open() in C:\Inetpub\vhosts\mywebsite.com\httpdocs\core\components\filelister\model\filelister\filelister.class.php on line 183" and the error disappear after I changed the path at the Filelister command) , I have found the FormIt and thought this might be easier to get it work compare to FileLister but it seems that nothing working at the moment and i have no idea where has gone wrong. The website im working on is already running by using the Modx Revolution 2.0.7 for designing. However, this new task is assigned to me and I have no one to refer to but just depending on the info searching through the internet on this modx.
        Please help me out, i really need to solve this issue badly.

        many thanksssssssss
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          FormIt is for forms, like a contact form; it won't be of any help to you for what you want to do.

          From the error, it looks like your version of PHP doesn't supply the mcrypt library.

            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 40226
            • 10 Posts
            Hi Susan,
            So, the FileLister is the correct command i should use in my scenario here? The mcrypt library?? you mean when i tried to run the Filelister command by copy and paste the example(http://rtfm.modx.com/display/ADDON/FileLister )) and the result is only showing the titles of the html table without listing out the files from my server is all due to this mcrypt library problem?? :O
            But on the existing and live running website, there are snippets like the FormItAutoReponsder, FormItRetriever, etc running for some of the webpages on the website which I'm going to work on, is the mcrypt library used for running all these snippets commands??
            Please advice me on how to get this fixed.
            many thanksssssssssss

            [ed. note: newbie2000 last edited this post 14 years, 4 months ago.]
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              FileLister is a snippet that manages listing files on the server for download. FormIt is a different snippet that manages forms. They have nothing at all to do with each other.

              The error "Fatal error: Call to undefined function mcrypt_module_open() in C:\Inetpub\vhosts\mywebsite.com\httpdocs\core\components\filelister\model\filelister\filelister.class.php on line 183" led me to believe that the mcrypt functions for PHP are not available in your version of PHP. These are not part of MODx, they are part of PHP itself.

              Here's what I put on my page:
              [[!FileLister? &path=`files/` &toPlaceholder=`files`]]
              <h2>Files</h2>
               
              <p>Current Path: <span>[[+filelister.path]]</span></p>
               
              <table>
              <thead>
              <tr>
                <th>Name</th>
                <th>Filesize</th>
                <th>Last Modified</th>
              </tr>
              </thead>
              <tfoot>
              <tr>
                <th colspan="3">
                  Files: [[+filelister.total.files]]
                  | Directories: [[+filelister.total.directories]]
                </th>
              </tr>
              <tbody>
              [[+files]]
              </tbody>
              </table>


              And here's what I got...
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                To determine if your PHP does have mcrypt or not, go to Reports, then System Info, and click the "View" link for phpinfo(). You need to see something like this in the Configure Command block; you should also find Mcrypt in the alphabetical listing of included libraries.
                  Studying MODX in the desert - http://sottwell.com
                  Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                  Join the Slack Community - http://modx.org
                  • 40226
                  • 10 Posts
                  Hi Susan,
                  Yes, i got what ya mean by the FormIt. While for the FileLister, i was having the fatal error at 1st when i typed in the path as [[!FileLister? &path=`assets/files/`]], but after i have changed the path to [[!FileLister? &path=`files/assets/files/`]], there is no more error appearing on my test page when i test run it again, however, there is no files being listed out on my screen either but just the titles of the table.
                  For your information, all my pdf files location are at (by clicking on the Files tab which is next to the Resources and Element tabs in the Modx page), under the Files tab, there is Files - assets - files - all my pdf docs are sitting here.
                  Please help.
                  Many thanksssssss
                    • 40226
                    • 10 Posts
                    Hi Susan,
                    Yes, i got what ya mean by the FormIt. While for the FileLister, i was having the fatal error at 1st when i typed in the path as
                     [[!FileLister? &path=`assets/files/`]] 
                    , but after i have changed the path to
                    [[!FileLister? &path=`files/assets/files/`]]
                    , there is no more error appearing on my test page when i test run it again, however, there is no files being listed out on my screen either but just the titles of the table.
                    For your information, all my pdf files location are at (by clicking on the Files tab which is next to the Resources and Element tabs in the Modx page), under the Files tab, there is Files - assets - files - all my pdf docs are sitting here.
                    Please help.
                    Many thanksssssss [ed. note: newbie2000 last edited this post 14 years, 4 months ago.]