473,770 Members | 2,028 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Point script "snif" to different directory?

Hi,

"Snif" is an excellent little script to index files and directories.
It's just one single file, and the advantage is that you merely drop it
into the directory you want to index, point a browser to the script and
you're done.

But to me, the simplicity is a DISadvantage since I need to index
directories that are located down in the site hierarcy, and to which the
users won't have direct access.

Have tried keeping "snif" in the directory I want indexed and then use
include to a "parent" file in root. But of course, it's indexing the
root and not the directory where the script is located. Also tried a
regular iframe, but that's plain ugly with scrollbars, etc.

So, maybe it's not kosher to ask about things like this, but I do it
anyway and hope I'm not upsetting anyone;

Can someone help me change the instances in the script which points to
"itself" so that it can index another directory?

The script is here: http://www.bitfolge.de/download/source/snif.phps

Cheers, and a BIG thanks in advance to anyone who can help.

Danny
Apr 27 '06 #1
2 2514
Danny Boy wrote:

Cheers, and a BIG thanks in advance to anyone who can help.


I'm bumping this.
I am prepared to pay for the help.
Please...
Cheers,
Danny
Apr 28 '06 #2
> "Snif" is an excellent little script to index files and directories. It's
just one single file, and the advantage is that you merely drop it into
the directory you want to index, point a browser to the script and you're
done.

But to me, the simplicity is a DISadvantage since I need to index
directories that are located down in the site hierarcy, and to which the
users won't have direct access.

Have tried keeping "snif" in the directory I want indexed and then use
include to a "parent" file in root. But of course, it's indexing the root
and not the directory where the script is located. Also tried a regular
iframe, but that's plain ugly with scrollbars, etc.


I'm sure the regulars can offer more help than I, but I think your post is
confusing. Why won't the users have direct access to the directories down
in the hierarchy? Is it outside of the public html directory? Anyway, I
think the answer to your question is found in lines 238-280 of the file you
linked (see below). If I read this correctly, there is a small index.php
file included with this snif package that you put into each subdirectory.
That automatically handles links to files below this big index.php in the
site hierarchy.

David
-----------

*************** *************** *************** *************** *************** *
** HANDLING SUBDIRECTORY LISTINGS **
*************** *************** *************** *************** *************** *

Say you've put the snif index.php into www.yourhost.com/download.
Now somebody makes a request to www.yourhost.com/download/releases. In
order to deal with this properly, you would have to copy the snif index.php
to that directory, too. But this will prevent the user to go to
www.yourhost.com/download from www.yourhost.com/download/releases
directly by selecting the .. link.

If you have this situation, use the index.php file from the subdirectory
called "subdir" in the snif archive file. All it does is automatically
forward the user to the parent directory and set URL parameters so that
the real snif will handle the request.

OK, that may be confusing. Again, a simple example:
/download/descript.ion << descriptions for
/download/*.*
/download/index.php << this file you're reading
now, >25 KB
/download/license.txt
/download/notes.txt
/download/releases/bigprogram_2.0. zip
/download/releases/descript.ion << descriptions for
/download/releases/*.*
/download/releases/index.php << subdir/index.php, <2 KB
/download/releases/nightly/2.1_20031103.zi p
/download/releases/nightly/2.1_20031104.zi p
/download/releases/nightly/index.php << subdir/index.php, <2 KB
If a users points his browser to
www.yourhost.com/download/releases/nightly/

The small index.php will forward him to
http://www.yourhost.com/download/rel...?path=nightly/

And then the index file in that directory will forward him again, this time
to
http://www.yourhost.com/download/?pa...eases/nightly/

Now we've reached the directory with the real snif (should get a copyright
on
that phrase ;-)), which will take over and miraculously lists the directory
the user typed as an URL.
Apr 28 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1275
by: fsidler | last post by:
Question: I use an indexing script that generates thumbnails for pictures and stores them, so the next time someone requests a directory listing, the thumbnail is already there and needn't be re-created. (www.bitfolge.de/snif) Now, the problem is, the script cant create the thumbnail folders because the base folder is owned by a normal system user, while the script-screated folders or images are owned by the httpd, www-data. Is there a...
84
8595
by: aarklon | last post by:
Hi all, I found an interesting article here:- http://en.wikipedia.org/wiki/Criticism_of_the_C_programming_language well what do you guys think of this article....??? Is it constructive criticism that needs to be appreciated always...???
0
9618
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10260
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8933
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7456
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6712
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.