Plug:ignatius:phpCMS DirList

From phpCMS

Jump to: navigation, search

Contents

[edit] phpCMS DirList

[edit] Overview

title         : phpCMS DirList
version       : 0.1
author        : Thilo "Ignatius" Wagner
licence       : GPL
description   : plugin to create directory listings with navigation
phpCMS version: tested with phpCMS 1.2.0

[edit] Licence

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

[edit] Download

The plugin can be downloaded from the plugin-database on http://www.phpcms.de. The direct link is:

http://phpcms.de/download/plugins/files/phpcms_dirlist_0_1.zip

Please make sure that there is no newer version in the plugin database (and update this page in the wiki if this is the case)

[edit] Short Description

With this plugin you can easily create a directory lister in phpCMS, adding a new way to navigate through the site structure on a very fast way.

This plugin is not meant for the end-user visiting a website, rather it's targeted at the webmasters and adminstrators of a site who want to keep the overview over the files and directory structure of a site without the need to have access to the filemanager in the phpCMS GUI.

I programmed this plugin for my personal use and I'm releasing it to the public as it is. I don't think I will add any more features in the feature. Don't suppose to get much support from me for this plugin.. if you can use it, take it as it is. But of course if somebody has and neat ideas for what this plugin can be used too or if somebody writes any improved version of this plugin, please contact me and tell me ;-)

The plugin creates two new tags which can then be included in the content:

<DIRNAME>

This tag gets changed to the name of the directory, relative to the document root.

<DIRLIST>

This tag gets changed to a listing of the files/directories in the directory. Each file/directory is included in a table row, so the <DIRLIST> Tag always has be placed inside <table>...</table> tags!

[edit] Documentation

[edit] Installation instructions

Attention: This plugin only works, if phpCMS is running in stealth mode! I could have made it working also in non-stealth mode but as I said.. I programmed that plugin for my own purpose and I don't want to spend any more time in it.

Step 1:

Copy the file phpcms_dirlist.php to the plugin-directory of your phpCMS installation (normaly this is something like /parser/plugs)

Step 2:

Create a content-file list.htm in each directory, which should be accessable via the dirlister plugin. These content-files should look something like this:

{PROJECT}/path/to/project/file/home.ini
{TITLE}Directorylisting
{PLUGIN FILE="$plugindir/phpcms_dirlist.php" TYPE="DYNAMIC"}
{CONTENT}
<h2>Content of the directory</h2>
<h3><DIRNAME></h3>
<table border="1" cellspacing="0">
<DIRLIST>
</table>

Of course the names of the content-files can also be something different from "list.htm", as long as they have the same filename in all directories.

After this the directory-/file structure could look like this:

[document root]
| list.htm
|
+-- [directory1]
|     list.htm
|
+-- [directory2]
|
+-- [directory3]
|     list.htm
|
+-- [template]
|
+-- [parser]

In this example the user can browse through the document-root and the directories "directory1" and "directory3" but he won't even see the other directories or be able to browse them, as we don't have placed a list.htm contentfile in there. With this method the webmaster of a site can control easily which directories should be visible/browsable via the web and which should be kept secret.

Step 3:

place the field {CONTENT_PLUGIN_0} somewhere in the page template. When the page is parsed phpCMS will place the output of the plugin there. This is not realy neccessary as the plugin doesn't create any output under normal conditions, but if you have an error in the script you won't see the php errormessage if you don't have placed that {CONTENT_PLUGIN_0} field in the template.. so this is only for the case something goes wrong :)

That's all.

Now you can browse to http://www.yourdomain.com/somewhere/list.htm

and see the content of the directory "somewhere" and you can browse through the directory structure of the site.

[edit] Using the plugin in non-stealth mode

This plugin will only work if phpCMS is running in stealth mode!

[edit] Caching

This Plugin is included as "dynamic". With other words: pages containing this plugin won't be cached. But that's what we want anyway, as we always want to have an up to date directory listing and not some old informations from the cache.

[edit] Development Status / known bugs

No known bugs, but someone could add support for non-stealth mode ;-)

[edit] Version History

28.05.2003 V0.1

  • First public release

Main Page: Main Page | Top Page: Plugin Documentation MainPage

Personal tools