Browse My Computer – First System

Design Challenges
Contents of the site can change, so the site pages need to be created dynamically.
But diverse content can be related. How do you show that?
And the site already has a structure that I don’t want to change.
Also, amount of content is huge, so there is no way to display it all on just a few pages.

Technology for creating pages dynamically
A technology that is accessible and easy to implement is PHP. It’s open source and well-supported in the web world.
And I found a great little PHP program that creates a list of links for the contents of any directory. It is recursive, so picks up contents of all sub-directories, too. A short piece of Java Script can be added to make the list automatically collapse, then expand at each node when it is clicked.

PHP works similar to other server-side scripting languages, but is easy to add to pages and systems without special development environments. A special code tag for PHP can be added anywhere on an HTML page where you want to add code. Then when the server gets to that code, it will execute the code and if it produces output, will put that output on the page in place of the code. External PHP files containing commonly-used functions (or classes) can be placed anywhere in the file system and pointed at with a PHP INCLUDE statement. Just put in the “include” before you run the function that it covers.

My First Attempt

Index.php: I list out the roughly 20 major folders in my “site.”
The links use the query string (href=”pagename.php ?variablename=variablevalue) to send the name of the directory to by scanned to the next page. This page also has “More detail” buttons. The directory links point to a file viewing page named tree-any-classic.php. The “classic” part means it uses plain Java Script, not a JQuery script.
The More Detail button links point to special folder view pages.
Detail pages: There are about a half dozen detail pages. They run a modified version of the file tree program that only lists directories. All the directories on this page point to a different file viewing PHP page.
File viewers: One viewing page lists full trees and populates the list with links that point the document to an on-page inline frame (iframe) which is used to view the documents. The iframe is fixed to the browser so it is always available while the listing can be scrolled through. The other viewing page lists only the files from one directory at a time. Otherwise, it works the same as the more versatile page.

Limitations
Website files need to have names without spaces. Fortunately I had a habit of naming files without using spaces, but I have many files that don’t comply with this requirement. If I don’t find a workaround, I will have to rename all such files. Fortunately, my Free Commander file manager has a bulk rename feature that comes in handy for this.

You can’t click on a regular link and open any type of file in a browser. This only works with HTML and some image files. Adobe provides a plugin for PDF files. And Microsoft provides a plugin for WMV and a few other Windows Media file types. Real Player has plugins that will automatically download many media files and open them in Real Player on your computer. Apple Quick Time also has such a plugin. I haven’t explored all my options for implementing this functionality yet.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s