Jump to content


ShowFiles


  • You cannot reply to this topic
43 replies to this topic

#1 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,524 posts
  • Gender:Male

Posted 29 November 2004 - 02:21 PM

I have added a new snippet to the Snippet Library!

Snippet name: ShowFiles
Author: rad14701
Version: 2.0 (Final)
More info: View this snippet
Description:
Lists files within a subdirectory of your Etomite root directory. You can send variable assignments to the snippet for the directory to list, the field to sort on and the sort direction. The code is commented and can be set with defaults.

Please feel free to comment on this snippet, suggest improvements, or simply praise my work! ;)

[This is an automatically created message]

#2 Jeroen

    Likes Etomite Forums!

  • Member
  • PipPip
  • 178 posts

Posted 30 November 2004 - 07:43 PM

Good work mister.

This thing was around for phase and now for etomite, very cool.

I hope I can find some use for it.... Maybe a download section, so I don't have to update the links all the time.

#3 Rich McNinch

    Etomite Forum Newbie

  • Member
  • 3 posts

Posted 02 December 2004 - 11:41 PM

Something's wrong for me and I'm not sure what. Your other snippets are great, btw, so I'm sure I'm goofing this somehow with my site.

I get this parse error on the page its included in:

Quote

Parse error: parse error, unexpected T_LNUMBER in /usr/home/unyted/public_html/index.php(554) : eval()'d code on line 90

This is line 90 in the snippet, but I'm not sure that the error is returning only the snippet lines?

$output .="<table width="100%">";

I have ensured the directory is allowing indexing, if that matters. I also tried it on another page without any other snippets, just in case (the first time I tried it was under the NewsListing snippet).

Any clues? Can I give you some more information to help?

#4 jaredc

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,193 posts

Posted 03 December 2004 - 01:12 AM

Rich McNinch, on Dec 2 2004, 07:41 PM, said:

    $output .="<table width="100%">";
Could be a quotes problem try single quotes on the outside. As it is now, Etomite (PHP really) thinks that the output is: <table width=, then it doesn't know what to do with the 100% part. So it throws an error. Try:

$output .= '<table width="100%">';
IF that's the problem, then that should fix it. Good luck. :eto:

#5 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,524 posts
  • Gender:Male

Posted 03 December 2004 - 02:19 PM

The problem you are having was caused by our still broken Snippet Library, which is why I haven't posted more of my snippets as yet... <_< The Snippet Library has stripped the backslash character which was used to escape the double quotes within the generated HTML code... :o You can either manually edit the code or get a good copy from my websites downloads section... B)

I will make modifications to the code and repost it sometime today in order to circumvent this ongoing problem... :eto:

#6 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,524 posts
  • Gender:Male

Posted 03 December 2004 - 03:16 PM

I have updated this snippet in the Snippet Library!

Modified snippet code to account for the Snippet Library stripping escape backslashes... :eto:

#7 Rich McNinch

    Etomite Forum Newbie

  • Member
  • 3 posts

Posted 03 December 2004 - 04:39 PM

OMG thanks. Jaredc had me headed in the right direction, but then line 106 was giving me trouble and I couldn't find a way around it. Then I learned about using the backslash, but I must have been doing something wrong because the resulting output was garbage.

Thanks again - great mod. Seems to be working fine now!

#8 espersen

    Etomite Forum Fan

  • Member
  • Pip
  • 144 posts

Posted 05 December 2004 - 07:12 PM

Nice work - can definately use it !

A little suggestion for improvement could be adding a feature that defines a image for the files. So et defines it automaticly by file-type.
It will of course mean that all needed icons must be uploaded to a folder

For an example:
- adobe-icon for .pdf-files
- word-icon for .doc-files
- txt-icon for -txt-files

#9 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,524 posts
  • Gender:Male

Posted 05 December 2004 - 07:25 PM

espersen, on Dec 5 2004, 03:12 PM, said:

Nice work - can definately use it !

A little suggestion for improvement could be adding a feature that defines a image for the files. So et defines it automaticly by file-type.
It will of course mean that all needed icons must be uploaded to a folder

For an example:
- adobe-icon for .pdf-files
- word-icon for .doc-files
- txt-icon for -txt-files
Glad to hear you have found the snippet useful... :betterwink:

The original version of this snippet had mime-type identification built in but I removed it because it wasn't working properly on my server and I didn't have a need for that feature... File mime-types would have been displayed in an additonal column... I will put your idea on my list of possible modifications for future tweaking... B)

#10 Robsta

    Likes Etomite Forums!

  • Member
  • PipPip
  • 360 posts

Posted 04 April 2005 - 10:21 PM

Another useful snippet. When I get the message in 'Manage Files' ...

"Uploading of this kind of file isn't allowed!"

Is this the hosting provider preventing, or a config issue? I have CHMOD the directory to 777. The snippet works nicely, but have to FTP the document.

Update: Problem sorted too... I can use 'Manage Files' upload a .JPG, but not a .DOC to the download folder. So went into the configuration and added the file type to the allowable upload filetypes.

Just realised, this isn't really an issue relating to this snippet. Sorry.

Edited by Robsta, 04 April 2005 - 10:33 PM.


#11 Dean

    Loves Etomite Forums!

  • Admin
  • 4,758 posts
  • Gender:Male

Posted 04 April 2005 - 10:39 PM

Glad you got it sorted :D

#12 Royal2000H

    Etomite Forum Newbie

  • Member
  • 31 posts

Posted 28 May 2005 - 11:43 PM

I'm a little late on this because I'm new....
But please change the link in the snippet library to http://dahlgren.slyip.com/50.html instead of http://dahlgren.slyip.com/p50.html
It didn't work for me and after a while I realized it was the p...
also, is there a way to restrict it to only show certain files (such as pdf)?

#13 Dean

    Loves Etomite Forums!

  • Admin
  • 4,758 posts
  • Gender:Male

Posted 29 May 2005 - 08:33 AM

'P' Removed :D

#14 Ravage

    Etomite Forum Newbie

  • Member
  • 13 posts

Posted 28 June 2005 - 07:02 PM

Is there a way for this snippet to only show certain types of files?
for example that it doesnt show html and php files in the directory and only the rest of the files?

#15 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,524 posts
  • Gender:Male

Posted 28 June 2005 - 08:28 PM

Ravage, on Jun 28 2005, 04:02 PM, said:

Is there a way for this snippet to only show certain types of files?
for example that it doesnt show html and php files in the directory and only the rest of the files?
The short answer is "yes"... I took a quick look HERE and saw that there is some code which could be adapted and incorporated into this snippet for extension inclusion or exclusion purposes... It should only take several lines of code and you could probably even send the extensions in the snippet call, as well... B)

#16 Ravage

    Etomite Forum Newbie

  • Member
  • 13 posts

Posted 28 June 2005 - 08:38 PM

Ralph (rad14701), on Jun 28 2005, 10:28 PM, said:

The short answer is "yes"... I took a quick look HERE and saw that there is some code which could be adapted and incorporated into this snippet for extension inclusion or exclusion purposes... It should only take several lines of code and you could probably even send the extensions in the snippet call, as well... B)

Do you feel like trying to write this little piece of code to add to the snippet :blush: :) cause my php just isn't that advanced. :blush:

#17 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,524 posts
  • Gender:Male

Posted 28 June 2005 - 09:30 PM

Ravage, on Jun 28 2005, 05:38 PM, said:

Do you feel like trying to write this little piece of code to add to the snippet  :blush:  :) cause my php just isn't that advanced. :blush:
Although I'm always up for a challenge it wouldn't be fair to the Etomite community for me to be investing time into customizing a snippet to one members needs rather than focusing on getting the 0.6.1 release completed, tested, and available for downloading... If no other members are willing to take on the task I can put it on my list of things to do when I have some spare time again... Anyone...:?:

#18 Ravage

    Etomite Forum Newbie

  • Member
  • 13 posts

Posted 28 June 2005 - 09:40 PM

Ralph (rad14701), on Jun 28 2005, 11:30 PM, said:

Although I'm always up for a challenge it wouldn't be fair to the Etomite community for me to be investing time into customizing a snippet to one members needs rather than focusing on getting the 0.6.1 release completed, tested, and available for downloading... If no other members are willing to take on the task I can put it on my list of things to do when I have some spare time again... Anyone...:?:


I understand :) sorry for that.

anyone feel like trying this little adjustment? :blush: :huh:

#19 mrruben5

    Likes Etomite Forums!

  • Member
  • PipPip
  • 255 posts

Posted 30 June 2005 - 09:44 AM

I love this snippet. I have a page with socalled "campaigns" and in the directory I have all the zips, and preview images(large images, that show you the entire map) With this it's easy to just say, look in the download section for the files.

#20 Royal2000H

    Etomite Forum Newbie

  • Member
  • 31 posts

Posted 08 July 2005 - 06:06 AM

Ralph (rad14701), on Jun 28 2005, 02:30 PM, said:

Although I'm always up for a challenge it wouldn't be fair to the Etomite community for me to be investing time into customizing a snippet to one members needs rather than focusing on getting the 0.6.1 release completed, tested, and available for downloading... If no other members are willing to take on the task I can put it on my list of things to do when I have some spare time again... Anyone...:?:
.....2 members....
I'll take a look at it and see what I can do though





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users