Plugin: List Contents
Posted: 13 May 2008 08:34 AM   [ Ignore ]  
Lab Assistant
Avatar
RankRank
Total Posts:  121
Joined  02-27-2008

This is my first plugin, written in response to this post. This plugin allows you to specify a path (NOT FULL URL) and it will iterate over the contents and print an ordered or unordered list of the files. It can optionally filter out various filetypes as well as create links to the files. It also allows CSS customization, as classes can be passed in for the list, list items and anchor tags. Of course, please let me know of any bugs you find.

*File updated 5/13/08 - 1:30pm EST

File Attachments
pi.list_contents.php.zip  (File Size: 2KB - Downloads: 99)
Profile
 
 
Posted: 13 May 2008 08:49 AM   [ Ignore ]   [ # 1 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  257
Joined  01-23-2006

Nice work!

Another thought, this would be neat to have as a custom field in the CP. For example, some sites I built need to have large mp3’s uploaded through ftp. The person updating the site could then make a weblog post and select the file they posted from a list (this could save them making a typo).

 Signature 

jeremy douglas media design | Twitter

Profile
 
 
Posted: 13 May 2008 08:51 AM   [ Ignore ]   [ # 2 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6610
Joined  04-15-2006

Hi Brad,

Nice little plugin there, well done. I was trying to get it working like this though :

{exp:list_contents folder_url="{site_url}images/site/layout/" links="on" list_type="ol"}

Seems that won’t work as it comes up with :

Not a valid directory path:/usr/local/psa/home/vhosts/example.com/httpdocshttp://www.example.com/images/site/layout/

Not too sure why it does that or what you would have to do to fix that but would be nice if it could work with the (as yet undocumented wink ) {site_url} variable.

Great addition though.

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 13 May 2008 08:53 AM   [ Ignore ]   [ # 3 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6610
Joined  04-15-2006
jez777 - 13 May 2008 08:49 AM

Nice work!

Another thought, this would be neat to have as a custom field in the CP. For example, some sites I built need to have large mp3’s uploaded through ftp. The person updating the site could then make a weblog post and select the file they posted from a list (this could save them making a typo).

That is a nice thought. Would make things really easy for clients and we all know that they need every little bit of help they can get with things!! wink

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 13 May 2008 09:03 AM   [ Ignore ]   [ # 4 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  121
Joined  02-27-2008

Thanks for the great suggestion, Jeremy. I haven’t attempted to do anything witht he CP yet, but will look into it.

Mark - looking into the {site_url} issue now.

Thanks!

Profile
 
 
Posted: 13 May 2008 09:17 AM   [ Ignore ]   [ # 5 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6610
Joined  04-15-2006

Well no - thank you!! grin

If you can’t get {site_url} to work then no worries as it doesn’t matter about having to hard-code that bit into the template. Jeremy’s suggestion is a great one though so if you want to forget mine then please do wink

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 13 May 2008 09:23 AM   [ Ignore ]   [ # 6 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  121
Joined  02-27-2008

Ok, plugin updated to accept file path - no URL required. Give that a go - new download is available at start of this thread.

Profile
 
 
Posted: 13 May 2008 09:33 AM   [ Ignore ]   [ # 7 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6610
Joined  04-15-2006

Neat! Although I think you have some echoing code coming out where it shouldn’t be perhaps?

I am seeing this code :

Array
(
    
[path] => /images/site/layout/
)

on my page before all the links.

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 13 May 2008 11:30 AM   [ Ignore ]   [ # 8 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  121
Joined  02-27-2008

Thanks Mark - darned debugging code. New file posted at top of thread, or u can comment out line 26 of yours.

Profile
 
 
Posted: 13 May 2008 11:47 AM   [ Ignore ]   [ # 9 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6610
Joined  04-15-2006

Hi Brad,

Yep found that in the code and un-commented already but thanks for looking into that. Using this in the CP really would be excellent if you can get that working wink

Great job though, brilliant!

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 13 May 2008 11:52 AM   [ Ignore ]   [ # 10 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  121
Joined  02-27-2008

I’ll take a closer look at this when I get home tonight. At the moment I don’t know where I’d begin to make this a custom field in CP. But hey, how hard could it be?

Profile
 
 
Posted: 13 May 2008 05:54 PM   [ Ignore ]   [ # 11 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  769
Joined  03-16-2002

Brad, thanks for this - but honestly I lost track of your versions already.
Could you use a numbering scheme for the file? I’m in another time zone and really don’t now it I visited the thread before or after 1:30pm EST wink

Profile
 
 
Posted: 13 May 2008 08:41 PM   [ Ignore ]   [ # 12 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  121
Joined  02-27-2008

Markus,

Haha - sorry about that. The newest version is at the top of this thread, and was from 1:30pm EST (-5 GMT). At any rate - will increment version from here on out.

Profile
 
 
Posted: 09 September 2008 06:30 AM   [ Ignore ]   [ # 13 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1463
Joined  09-16-2004

Just wanna say thanks for an incredibly useful plugin smile

 Signature 

Peace, e-man.
stookstudio.com, websites built with care and web standards. LinkedIn profile

Profile
 
 
Posted: 09 September 2008 11:35 AM   [ Ignore ]   [ # 14 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  121
Joined  02-27-2008

Thanks eman,

I’m really glad that you found this useful. I answered a related thread earlier where someone had commented on it - and I had all but forgotten about this (as most of the time I code directly in PHP (now with CI) as opposed to EE. At any rate, just wanted to say thanks for trying it out and finding a use for it.  smile

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 65087 Total Logged-in Users: 39
Total Topics: 82227 Total Anonymous Users: 22
Total Replies: 441925 Total Guests: 221
Total Posts: 524152    
Members ( View Memberlist )