sixem / ivfi-php

IVFi is a directory indexer that aims to make it easy to browse and explore web-accessible directories.
https://git.five.sh/ivfi/
Other
108 stars 18 forks source link

Disable parent directory link #16

Closed Checkumeito closed 3 years ago

Checkumeito commented 3 years ago

Hello,

I want to make this script to be a very simple gallery. I organize my folder structure something like this:

Gallery/
├── House/
│   ├── image01.jpg
│   ├── image02.jpg
│   ├── image03.jpg
│   └── image04.jpg
├── Pet/
│   ├── dog.jpg
│   └── cat.jpg
└── Friends/
    ├── Jason.jpg
    ├── Mary.jpg
    ├── Olivier.jpg
    └── Roy.jpg

When I give people the link to my album, for example, https://eyy/indexer/Gallery/House/, I don't want them to see my other folders in Gallery/, and I can do that by placing a blank index.html in Gallery/.

Is there any way to tell the indexer not to show the link "Parent Directory"?

sixem commented 3 years ago

At the moment there is no option to disable the Parent Directory link, no.

What you can do, is to just edit the script yourself. Editing the indexer.php, you can change this part on what should be line 258:

$op = sprintf(
      '<tr class="parent"><td><a href="%s">[Parent Directory]</a></td><td>-</td><td>-</td><td>-</td></tr>',
      dirname($directory)
);

to:

$op = '';

That should remove the link. I'll see if I can maybe add an option in the next release to make this easier, but hopefully this solution will suffice for now.

Checkumeito commented 3 years ago

It is good enough. Thank you for the tip. I forgot completely that I can take a look at the source code and edit it 💯