Directory Listing Script

 
Post new topic   Reply to topic    Aprelium Forum Index -> Tutorials
View previous topic :: View next topic  

Was this script useful?
Yes
80%
 80%  [ 4 ]
No
0%
 0%  [ 0 ]
Too Long A Script To Be Bothered Using
20%
 20%  [ 1 ]
Other (Please post your reason)
0%
 0%  [ 0 ]
Total Votes : 5

Author Message
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Sat Jan 01, 2005 9:36 pm    Post subject: Directory Listing Script Reply with quote

Hello All,

I designed this script when I had a very long list of files to share with people. I was getting e-mails saying that my server was too slow when giving directory listings and they didn't know if it was working or not. I got to work and came up with a script to tell you the list is loading and when it has finished, and I have decided to share it with all users of abyss.

It shows the name and the size of the files as normal, but also has a little piece of text telling you the list is loading.

Set the directory listing to load from a template, and click the 'edit' button and add this to the boxes:

-------------------------------------------------------------
Put this piece of code in the HEADER box:
-------------------------------------------------------------
Code:

<HTML>
<HEAD>

<style type="text/css">
body {font-family: Tahoma; font-size: 10px; color: #FFFFFF; text-align: justify}
a:link, a:active, a:visited {color: #FFFFFF; text-decoration:none}
a:hover {color: #00FF00; text-decoration: underline; bold}
<!--
BODY {
scrollbar-face-color:#ffffff;
scrollbar-highlight-color:#ffffff;
scrollbar-3dlight-color:#000000;
scrollbar-darkshadow-color:#ffffff;
scrollbar-shadow-color:#000000;
scrollbar-arrow-color:#000000;
scrollbar-track-color:#ffffff;
}
-->
</style>

</HEAD>
<BODY bgcolor="#000080" text="#FFFFFF" link="lime" vlink="lime">
<font size="5" face="tahoma"><b>
List of files in: <!-- #echo var="URL" --><br>
Number of files/folders: <!-- #echo var="DIRLIST_FILES_COUNT" --></b></font><p>
<font size="3"><p>
<font size="4" face="tahoma">
PLEASE RIGHT CLICK AND <b><u><font color="yellow">'SAVE TARGET AS'</font></u></b> TO SAVE FILES. CLICKING THEM WILL OPEN, NOT SAVE!<p>
<DIV ID="message">
<font color="yellow" size="4" face="tahoma"><b>
Loading List... This might take a few seconds.<p>
</b></font>
</DIV>

<SCRIPT>

function off(){
document.all.message.innerHTML = "<font color='lime' size='4' face='tahoma'>List Loaded<p></font>";
}

</SCRIPT>

<TABLE BORDER=1 cellpadding=0 cellspacing=0 width=850>
<TR>
<TD width="750"><b>Name
<TD width="100"><b>Size


-------------------------------------------------------------
Put this piece of code into the BODY box:
-------------------------------------------------------------
Code:


<TR>
<TD><font size="2"><b>
<A HREF="<!-- #echo var="DIRLIST_FILE_URL" -->" title="Please right click and 'Save Target As' to download this item.">
<!-- #echo var="DIRLIST_FILE_NAME" --></A>
<TD><font size="2"><b><!-- #echo var="DIRLIST_FILE_SIZE" -->

-------------------------------------------------------------
Finally, put this piece of code into the FOOTER box:
-------------------------------------------------------------
Code:


</TABLE>

<img src="blank.gif" OnLoad="off()"><font color="aqua" size="4" face="tahoma"><b>End Of Listing

</BODY>
</HTML>



When you have done this, you will need to make a simple 1 x 1 pixel image file called 'blank.gif'. This is used to call the JavaScript function. Put this in the parent directory of the webserver (or wherever you specify if you change the script).

Thats it! Simply go to a folder with no index file but lots of other files and see if it works!
Back to top View user's profile Send private message Visit poster's website
richardyork
-


Joined: 22 Jun 2004
Posts: 410
Location: United Kingdom

PostPosted: Sat Jan 01, 2005 11:16 pm    Post subject: Thanks Reply with quote

Thank you for the script, very nice!!
Well Done!

Thank You
_________________
Please SEARCH the forums BEFORE asking questions!
Back to top View user's profile Send private message
techker
-


Joined: 22 May 2006
Posts: 8

PostPosted: Mon May 22, 2006 4:03 pm    Post subject: Reply with quote

nice script.but i fallowed every step but i get this

http://letitring.itsfun.be/mp3/view2.php

have a clue y?

thx
Back to top View user's profile Send private message
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Mon May 22, 2006 4:05 pm    Post subject: Reply with quote

techker wrote:
nice script.but i fallowed every step but i get this

http://letitring.itsfun.be/mp3/view2.php

have a clue y?

thx



Double check you haven't made a mistake in the HTML. It seems there is a parse error. Also make sure SSI is enabled.
_________________
Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk
Back to top View user's profile Send private message Visit poster's website
techker
-


Joined: 22 May 2006
Posts: 8

PostPosted: Tue May 23, 2006 11:43 am    Post subject: Reply with quote

i have no clue about the ssi it is not my server .

for the error i will give you the code.cause i don't see it..afther a whyle you can't see anything anymore.lol

Code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<style type="text/css">
body {font-family: Tahoma; font-size: 10px; color: #FFFFFF; text-align: justify}
a:link, a:active, a:visited {color: #FFFFFF; text-decoration:none}
a:hover {color: #00FF00; text-decoration: underline; bold}
<!--
body {
scrollbar-face-color:#ffffff;
scrollbar-highlight-color:#ffffff;
scrollbar-3dlight-color:#000000;
scrollbar-darkshadow-color:#ffffff;
scrollbar-shadow-color:#000000;
scrollbar-arrow-color:#000000;
scrollbar-track-color:#ffffff;
}
-->
</style>
</head>
<body bgcolor="#000080" text="#FFFFFF" link="lime" vlink="lime">
<font size="5" face="tahoma"><b> List of files in:
<!-- #echo var="URL" -->
<br />
Number of files/folders:
<!-- #echo var="DIRLIST_FILES_COUNT" -->
</b></font>
<p> </p>
<font size="3">
<p> </p>
<font size="4" face="tahoma"> PLEASE RIGHT CLICK AND <b><u><font color="yellow">'SAVE TARGET AS'</font></u></b> TO SAVE FILES. CLICKING THEM WILL OPEN, NOT SAVE!
<p> </p>
<div id="message"> <font color="yellow" size="4" face="tahoma"><b> Loading List... This might take a few seconds.
  <p></p>
  </b></font> </div>
<SCRIPT>

function off(){
document.all.message.innerHTML = "<font color='lime' size='4' face='tahoma'>List Loaded<p></font>";
}

</SCRIPT>
<TABLE BORDER=1 cellpadding=0 cellspacing=0 width=850>
  <TR>
    <TD width="750">
    <b>
Name
    <TD width="100"><b>Size
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
      <title>Untitled Document</title>
      </head>
      <body>
  <TR>
    <TD>
    <font size="2">
    <b>
    <A HREF="<!-- #echo var="DIRLIST_FILE_URL" -->" title="Please right click and 'Save Target As' to download this item.">
    <!-- #echo var="DIRLIST_FILE_NAME" -->
    </A>
    <TD><font size="2"><b>
      <!-- #echo var="DIRLIST_FILE_SIZE" -->
</TABLE>
<img src="blank.gif" OnLoad="off()"><font color="aqua" size="4" face="tahoma"><b>End Of Listing
</body>
</html>
Back to top View user's profile Send private message
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Tue May 23, 2006 11:45 am    Post subject: Reply with quote

I think I know the problem then. This has to go in the directory listing template section inside the Abyss Web Server console. It wont work if you directly link to it as a page.
_________________
Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk
Back to top View user's profile Send private message Visit poster's website
techker
-


Joined: 22 May 2006
Posts: 8

PostPosted: Tue May 23, 2006 12:10 pm    Post subject: Reply with quote

so how do you ?
Back to top View user's profile Send private message
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Tue May 23, 2006 1:04 pm    Post subject: Reply with quote

techker wrote:
so how do you ?


How do I what?
_________________
Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk
Back to top View user's profile Send private message Visit poster's website
techker
-


Joined: 22 May 2006
Posts: 8

PostPosted: Tue May 23, 2006 6:52 pm    Post subject: Reply with quote

so you meen this is for people ho have the severs ,not the ones yousing hosting services.?
Back to top View user's profile Send private message
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Tue May 23, 2006 6:56 pm    Post subject: Reply with quote

techker wrote:
so you meen this is for people ho have the severs ,not the ones yousing hosting services.?


You have to contact the person running Abyss Web Server and ask them to put the script on for you. But seeing how the server your site is on does not run Abyss Web Server, you are out of luck.
_________________
Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk
Back to top View user's profile Send private message Visit poster's website
loloyd
-


Joined: 03 Mar 2006
Posts: 435
Location: Philippines

PostPosted: Wed May 24, 2006 3:08 am    Post subject: Reply with quote

techker, apparently your webserver or your web hoster's webserver runs on "nginx/0.3.46". This forum caters to those who use the Abyss webserver by Aprelium.

I think you would have to implement and modify web file browser for your needs.

Extra: shouldn't this thread be in Tutorials and not under "Powered by Abyss"?
_________________

http://home.loloyd.com/ is online if the logo graphic at left is showing.
Back to top View user's profile Send private message Visit poster's website
pkSML
-


Joined: 29 May 2006
Posts: 952
Location: Michigan, USA

PostPosted: Tue Jun 06, 2006 11:02 pm    Post subject: Directory Listing Script Reply with quote

Hey Andy,

Nice script. Very well done. The javascript is a very nice touch, as well as the colored scroll bars.

I have it installed on my test webserver right now.

I though I might add just a few improvements. I fixed the open HTML tags and reduced some redundancy via CSS. This makes for faster load times.

So here is my two cents:

Type:
Code:
From Template


MIME Type:
Code:
text/html; charset=UTF-8


Header:
Code:
<HTML>
<HEAD>
<TITLE>Directory Listing of <!-- #echo var="URL" encoding="reverse-url" --></TITLE>
<style type="text/css">
<!--
body {font-family: Tahoma; font-size: 10px; color: #FFFFFF; text-align: justify}
a:link, a:active, a:visited {color: #FFFFFF; text-decoration:none}
a:hover {color: #00FF00; text-decoration: underline; bold}
BODY {
scrollbar-face-color:#ffffff;
scrollbar-highlight-color:#ffffff;
scrollbar-3dlight-color:#000000;
scrollbar-darkshadow-color:#ffffff;
scrollbar-shadow-color:#000000;
scrollbar-arrow-color:#000000;
scrollbar-track-color:#ffffff;
}
td{font-size: x-small; font-weight: 700;}
-->
</style>
</HEAD>
<BODY bgcolor="#000080" text="#FFFFFF">
<P>
<font size="5" face="tahoma">
<b> List of files in: <!-- #echo var="URL" --><br>
Number of files/folders: <!-- #echo var="DIRLIST_FILES_COUNT" --></b>
</font>
</p>
<p>
<font size="4" face="tahoma">
PLEASE RIGHT CLICK AND <b><u><font color="yellow">'SAVE TARGET AS'</font></u></b> TO SAVE FILES.<BR>
CLICKING THEM WILL OPEN, NOT SAVE!
</font></p>
<DIV ID="message">
<font color="yellow" size="4" face="tahoma"><b>
Loading List... This might take a few seconds.
</b></font>
</DIV>
<p>
<SCRIPT>
function off(){
document.all.message.innerHTML = "<font color='lime' size='4' face='tahoma'>List Loaded</font>";
}
</SCRIPT>
</P>
<TABLE BORDER=1 cellpadding=0 cellspacing=0 width=850>
  <TR>
    <TD width="750"><b>Name</TD>
    <TD width="100"><b>Size</TD>
  </TR>


Body:
Code:
<TR>
    <TD><A HREF="<!-- #echo var="DIRLIST_FILE_URL" -->" title="Please right click and 'Save Target As' to download this item."><!-- #echo var="DIRLIST_FILE_NAME" --></A></font></TD>
    <TD><!-- #echo var="DIRLIST_FILE_SIZE" --></font></TD>
  </TR>


Footer:
Code:
</TABLE>
<P>
<img src="/blank.gif" OnLoad="off()"><font color="aqua" size="4" face="tahoma"><b>End Of Listing</FONT>
</P>
</BODY>
</HTML>


Notice the CSS for the TD tag. Another little quirk is blank.gif. It must be preceded by a slash (/blank.gif), so Abyss looks for it in the root directory.

Again, bravo on a nice script Andy.
Notice my sig. As long as my brother is not playing Rainbow Six, it should be working. :)
_________________
Stephen
Need a LitlURL?


http://CodeBin.yi.org
Back to top View user's profile Send private message Visit poster's website
loloyd
-


Joined: 03 Mar 2006
Posts: 435
Location: Philippines

PostPosted: Wed Jun 07, 2006 4:04 am    Post subject: Reply with quote

Does anybody have a URL link to a sample where we can see the output of this? Thanks.
_________________

http://home.loloyd.com/ is online if the logo graphic at left is showing.
Back to top View user's profile Send private message Visit poster's website
pkSML
-


Joined: 29 May 2006
Posts: 952
Location: Michigan, USA

PostPosted: Wed Jun 07, 2006 4:25 am    Post subject: Reply with quote

Hi there loloyd.

You can see this code in action at http://files.calvarybucyrus.org/.
_________________
Stephen
Need a LitlURL?


http://CodeBin.yi.org
Back to top View user's profile Send private message Visit poster's website
loloyd
-


Joined: 03 Mar 2006
Posts: 435
Location: Philippines

PostPosted: Wed Jun 07, 2006 6:15 am    Post subject: Reply with quote

Thanks a lot, pkSML. :-D
_________________

http://home.loloyd.com/ is online if the logo graphic at left is showing.
Back to top View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> Tutorials All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group