We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4749
    • 623 Posts
    This is a great snippet. Just about the only thing that’s missing is the ability to template the output. Is that in the works? grin
      The MODx has you...
      Utah Web Design
      • 23018
      • 353 Posts
      In fact this is one of the things I’m planing to change in the future.

      Unfortunately I’m a bit tied up in the moment, so you have to be patient. Also, before I can even touch that one, I have to find the time to continue my backend clean up. 6 months ago I was really confident, that I would be able to finish this one once and for all, but then loads of work popped out of nowhere... Old story, isn’t it?

      As far as it goes right now, there are nuts and bolts here and there to accomplish many different things. Have a look at the documentation and study the code. You will see, that there is quite a lot you can do with the snippet as it is.


      So, please keep the faith for now.

      Regards,

      pepebe
        Homepage: pepebe.de | MODX snippets (and other stuff) at github: https://gist.github.com/pepebe
        • 19368
        • 40 Posts
        I have hacked this around to use with imageflow (http://imageflow.finnrudolph.de/)

        I edited the code so that it didn’t display subdirectories and rather than list names of images in a directory, it actually displays them.

        The link code was also messed with to add the necessary goodies for imageflow and voila.

        Now all that I need to do is drop image-name.jpg and thumb_image-name.jpg into a folder and using your code it builds the list of images, displays them and it looks sweet.

        Right now it is a work in progress (should be finished in a couple of days), but you can see the idea here. http://duthyhomes.com.au/gallery.php

        I can see that there is a lot of room for options for people who want to use this as a framework of some sort, so I encourage you to add more and more parameters.

        Interested in the code?
          • 23018
          • 353 Posts
          Hi MIcrobe

          of course I’m interested in your additions. Post them here, so we can have a look.

          As it is now, the snippet is far from perfect. What I want to have in the end is something like a wayfinder snippet for files with full templating control and all the other bells and whistles. With something like this we could create awesome galleries, download lists and much more.

          Regards,

          pepebe
            Homepage: pepebe.de | MODX snippets (and other stuff) at github: https://gist.github.com/pepebe
            • 29076
            • 615 Posts
            This is a great snippet, and I hope you will find time to finish this as much as possible in the nearest future. I need this functionality on my sites, but I’m not able to do the programming my self.

            Thanks for sharing. smiley
              I think, thererfor I am! But what I am, and why...?
              • 3722
              • 171 Posts
              Awesome! This worked right out of the box.
              I like that a lot.

              I modified the phpFileTree.inc.php file to open the links in a new window (target="_blank"):
              Line 97
              "\n\t\t\t\t\t".           '<a href="'.$thisURL.'" target="_blank">'.htmlspecialchars($this_file).'</a>'.

              Line 137
              $inner  =   "\n\t\t\t\t\t\t".   '<a href="'.$thisURL.'" target="_blank">'.$fName.'</a>';


              THANKS!
              BG66
                • 23018
                • 353 Posts
                Thx bobbyG

                I’m glad you like it.

                I don’t want to be a smartass, but don’t forget, that you have to use a transitional doctype for that attribute if you use xhtml (don’t know how html5 handels the target attribute...).

                Nevertheless, this is a reasonable addition to the script.

                I will add this to the next version (along with some templating). I think we should add another parameter to the snippet call (&target=``).

                The next version is already in the pipeline, but you have to wait until the end of september for that one. I still have a tight schedule and as my wife always tells me: First Bucks then Bugs...

                Kind regards,

                pepebe
                  Homepage: pepebe.de | MODX snippets (and other stuff) at github: https://gist.github.com/pepebe
                  • 21417
                  • 486 Posts
                  Hello pepebe,

                  Wow, this is awesome - it is pretty well exactly what I was hoping to use for an intranet with PDF archives in the assets/files directory.

                  I have it reading the directory ok - the correct file names comes up on the page but the href value is empty so the links don’t work.

                  The HTML source looks like this:

                  <ul class="php-file-tree">
                  	<li class="dir"><h3>/files/test/</h3>
                  		<ul>
                  					<li class="file ext-pdf">
                  						<a href="">Name 1.pdf</a>
                  
                  					</li>
                  					<li class="file ext-pdf">
                  						<a href="">Name2.pdf</a>
                  					</li>
                  		</ul>
                  	</li>
                  </ul>


                  This is my call
                  [!phpFileTree? &directory=`/files/test/` &showExtension=`1` &addFile=`pdf` &ignore=`thumb` !]


                  Any ideas?


                  Also is it possibly to exclude the folder from the results?


                  I am very keen on being able to:
                  + template the output (ideally the folder name
                  + optionally exclude the folder name from the results
                  + and include target="blank" as an option
                  + and possibly (but much less importantly) include the date created from the file info.

                  If I throw some beer money at you will that inspire you to tweak it a little more?

                  Looking forward to your reply.

                  Many thanks pepebe.
                    Web design Adelaide
                    http://gocreate.com.au
                    • 23018
                    • 353 Posts
                    Sorry, this is a late reply.

                    I hope that it’s not to late.

                    My problem is that I’m on an very tight schedule and I can’t see that changing in the next two weeks. I have set my mind on learning Revo while building a new project and it’s a very rough ride...

                    I MIGHT be able to fork out some extra time during the weekend but please don’t depend on that. If that is ok for you PM me or write a mail to MR. "info" living at "pepebe.de".

                    Regards,

                    pepebe
                      Homepage: pepebe.de | MODX snippets (and other stuff) at github: https://gist.github.com/pepebe
                      • 21417
                      • 486 Posts
                      Thanks pepebe.

                      I am still interested.

                      Will email you shortly.

                      Cheers.

                      Nick
                        Web design Adelaide
                        http://gocreate.com.au