Home Page
Projects > Other Web Scripts
Projects > Other Web Scripts
RABiD BUNNY FEVER
K.T.K

Warning: you do not have javascript enabled. This WILL cause layout glitches.
Other Web Scripts Thumbnail
Other Web Scripts
Completed
Any simple web scripts (PHP or JavaScript) that can be plugged in elsewhere
Rating: 5 (Website stuff is kind of the low end rung of the programming spectrum IMO, but eh.)
Project Time: 2003-Ongoing: 25
Languages: JavaScript, PHP
Requirements: Web browser and/or PHP server
Downloads: Multiple downloads available in contents section (See any updates below for prior versions)
Sections: Information, Content, Concepts, Updates
Information
A menagerie of web base scripts. Besides the pluggable ones, there are also informational based ones like the date and character converters.
See content section for downloads.
Content
Image Zoom Effect v0.95: An animated image zoom (growing/shrinking) effect for web pages that transitions from a displayed thumbnail into a larger version of the image. Animation occurs when mouse is moved over the thumbnail and shrinks when mouse leaves zoomed image. Zooming images attempt to stay within the window’s boundaries.
Example: Example Zoom Effect Image
Click here for how to use and technical information
To use, the thumbnail must be an “img” object containing the class-name “GrowImage”, and its parent must be an anchor link (“a”) to the full size image. For example:
<a href="LINK_TO_FULL_SIZE_IMAGE.jpg"><img src="LINK_TO_THUMBNAIL.jpg" width=THE_THUMBNAIL_WIDTH height=THE_THUMBNAIL_HEIGHT class=GrowImage></a>
<script type="text/javascript" src="ImageZoomEffect.js"></script>
The ImageZoomEffect.js script must be included after all GrowImages have been added.

Variables:
  • RefreshTime: Time (in milliseconds) between animation frame updates.
  • TimeToAnimate: The time (in milliseconds) to grow the animation to full size. For example, if this value is 100 (1/10th of a second) and RefreshTime is 10 (1/100th of a second), then there will be 10 frames of the image growing or shrinking at each 1/100th of a second interval.
  • LoadingImageInfo: The image to temporarily show while the full size image is being downloaded. An array of 3 values is used for this variable. “['IMAGE_LINK', IMAGE_WIDTH, IMAGE_HEIGHT]”

Technical details:
  • After JS script is included, it searches through all images for ones that contain “GrowImage” in the className and adds appropriate events to the object.
  • Zoomed images are placed inside an absolutely positioned container so it doesn’t affect the rest of the layout. The zoomed images themselves are relatively positioned inside the parent.
  • Full size images are not loaded until the first time they are needed/requested by a mouse over action, and are unloaded when finished shrinking.
  • A zoomed image currently stays centered over its thumbnail until it hits a window border, in which case it will not overlap the border if possible. If the image grows too large to fit within the window’s width or height, the image will overlap on the bottom and right sides.
  • A zoomed image will start growing again if moused over while shrinking.
  • There are still a few bugs I need to work out in this one... see the updates below.
Directory Manager v1.1: A secure, lightweight, and robust PHP script for managing a directory’s files and user access.
Click here for features, technical information, and important notes
This script is a single file which should be used as the index file (usually index.php) for a desired directory. It works on just the directory it resides it, so the file can be uploaded to any directory you want it to work on with no extra hassle.

Features:
  • Sorted file listing within the directory
    • Files (no folders) are listed with the following data:
      • File name
      • File size (listed in human readable/friendly format)
      • Last modified date
    • Set the default sort column and order.
    • Sort column ordering can be changed by clicking the column header. If a column header is clicked when already selected, its sort order (ascending or descending) is swapped.
  • Uploading, renaming, and deleting files
    • Files can only be uploaded to the current directory.
    • Files can be protected so they are not shown and cannot be modified/removed. The index file, directory access (“.htaccess”), and user information (“.htpasswd” by default) files are automatically on this list.
    • File extensions can be restricted. If a restricted extension is encountered, an extra extension (“.txt” by default) is appended to the end.
  • Create, modify, and delete user logins
    • Logged in users can change their password.
    • (If permission is granted) Modify other user logins.
    • There are 3 user tiers which (by default) all have different allowed permissions (see “Permission state modifiers” variables section):
      • No user file found (Directory access is currently unrestricted)
      • Normal user
      • Admin user
    • User authentication can be required by either the whole directory or just the script.
  • Easy basic configuration through a short variable list at the top of the file. Once it is configured the first time for a website, it is unlikely the configuration would need to be changed when copying (or symbolic linking) the file to other directories.
  • All features are easily toggleable and grantable by user tier, so this script could be used for only one of its many purposes, for example, just listing files, or just user management.
  • Easy addition of a layout to wrap around the script
    • There are 2 functions, HeaderSection and FooterSection, where HTML for a header and footer can be added.
    • This is located directly below the variable section so everything that might need to be edited is at the top of the file.
    • A very basic header and footer have been provided in these functions by default. A header and footer file will usually just need to be included inside of these functions.
  • This script is written in as much of a serial manner as possible to make it easy to follow what is going on.
  • This script is W3C compliant for CSS and HTML.

Important notes:
  • User credentials only work with Apache mod_auth authentication.
  • For the script to detect the username (for admin login or for users to change their own passwords), this script only works on Apache with PHP ran as a module, not as a CGI. I may add a feature later on so that script authentication can be done through a form on the script’s page after the initial directory login if PHP is ran through a CGI interface.
  • As of v1.1 the script is download as a plaintext file with the extension “phpcode” that just need to be renamed to “php” (instead of zipping).
  • The script file can be named whatever you want and does not have to be a directory index file (default.php, index.php, etc).
  • You should not need to edit anything past the “//---DO NOT EDIT PAST HERE---” line.

Features that may be added later on:
  • “File by file protection” in which each file can be set as requiring user authentication or not (when the whole directory is not protected).
  • Manage a complete directory tree: Doable by making the .htaccess link all directory index requests back to the root directory’s index file.
  • When uploading files, ask if user wants to rename or overwrite if file already exists.
  • Login to script through FORM authentication and cookies (See second bullet of “Important Notes”).
  • Redo all requests as POST requests instead of GET.
  • Only restrict access to the index.php file for user logins, as opposed to the whole directory. (Added in v1.1)

Variable List:
  • Password protection information
    • PassFileName
      • The user credentials file name
      • For security reasons, this file can be put in another directory, but it doesn’t need to be as access is restricted to it by default.
      • If the path to this file is not relative, it must start with a “/”.
      • Default: '.htpasswd'
    • OnlyProtectIndexFile
      • With this, user authentication can be required by either the whole directory or just the script.
      • When set to true, the script’s file and the directory without a filename (e.x., “http://www.domainname.com/DIRECTORYNAME/”) are all that require user authentication (if users are already added). Otherwise, the whole directory requires user authentication.
      • Default: false
    • PasswordHashFunction
      • The function used to hash the password for the user credentials file
      • This should usually be “crypt”, but Windows’ IIS might need “md5”.
      • Default: 'crypt'
  • Allowable files and types
    • DoNotShowList
      • List of files that are not shown in the directory index and cannot be modified
      • Default: Array($MyFileName, $PassFileName, '.htaccess')
        • MyFileName is now retrieved automatically by the script
    • DisallowedExtensions
      • Files that are of these extensions cannot be modified or created
      • This option can be ignored through the IgnoreDisallowedExtensions variable.
      • Default: Array('php', 'php3', 'cgi', 'pl')
    • DissalowedExtensionsAppend
      • When disallowed extensions (above variable) are encountered, they have this variable appended to them
      • Default: '.txt'
  • Basic permissions: Set options to either true or false
    • AllowFileList
      • Default: true
    • AllowDeleting
      • Default: true
    • AllowRenaming
      • Default: true
    • AllowUploading
      • Default: true
    • AllowUserEdit
      • Edit other users credentials
      • Default: false
    • AllowPasswordEdit
      • User can edit their own password
      • Default: true
    • IgnoreDisallowedExtensions
      • See variable DisallowedExtensions
      • Default: false
  • [Admin] Permission state modifiers - Comment out line or set to FALSE to ignore option
    • AdminUsers
      • When logged in, these user(s) have all AdminPermissions (see below variable) set to true
      • Default: Array('admin')
    • PermissionsIfNoPassFileFound
      • Permissions set to true when no password file is found - The default is all permissions but IgnoreDisallowedExtensions
      • Default: Array('FileList', 'Deleting', 'Renaming', 'Uploading', 'UserEdit', 'PasswordEdit')
    • AdminPermissions
      • Permissions set to true when in admin mode (see AdminUsers) - The default is all permissions
      • Default: Array('FileList', 'Deleting', 'Renaming', 'Uploading', 'UserEdit', 'PasswordEdit', 'IgnoreDisallowedExtensions')
  • Default sorting options
    • SortBy
      • Default sorted column, options include “Name”, “Size”, and “ModTime” (Last Modified Time)
      • Default: 'Name'
    • SortDesc
      • Sort Ascending (false) or descending (true)
      • Default: false
Removed Variable List:
  • RootDirectory
    • The file system path to the root directory of the domain
    • THIS MUST BE MODIFIED
    • Default: '/home/USERDIRECTORY/public_html'
    • Removed: v1.1
  • MyFileName
    • The file name of this script
    • Default: 'index.php'
    • Removed: v1.1
Date Converter v1.0: A JavaScript script that converts and synchronizes different date types. The date types are: Numeric (Day, Month, Year, Day of Year), Word Form (Day of Week, Month), and two common date formats (“mm/dd/yy ”, “MMM d, yyyy”).
Click here for some notes and a working copy of the script
Working copy
Notes:
  • The working copy here may not show in IE because IE has a bug in it related to IFRAMES; if this is the case, go here).
  • If the year is only 2 digits, the script assume >20=1920-1999 and <20=2000-2019. Unfortunately, due to how the JavaScript “new Date()” works, 0000-0099 are not easily available. I could make them available... but eh.
  • Values that are higher than allowed will just wrap appropriately, so “13” for a month would be January of the next year.
  • The weekday and format fields are not changeable.
Character Converter v1.0: Convert text between hex, decimal, and ASCII. Kind of like a very simplified hex editor.
Click here for a working copy of the script
[Close working copy]
Unicode Character Reference Chart v1.0: Two kinds of charts used to view all the Unicode characters.
Click here for script information
  • Static (Top) Frame:
    • The top frame shows a limited number of characters (in 50,000 increments). This is because they are all loaded at once and having too many is too much for browsers.
    • When you mouse over a character in the top frame, the symbols information is displayed at the top of the page in red.
    • Right-To-Left characters (for example, Hebrew) sometime mess up the proper ordering on a line.
    • Warning: When mousing over a character in IE the browser may seem to freeze for a while due to IE bugs.
  • Dynamic (Bottom) Frame:
    • The bottom frame shows all the Unicode characters dynamically loaded as you scroll through them. It is designed to show 6 by 29 characters at a time.
    • The bottom frame fits within a 1024x768 resolution.
    • Each time you go up or down, it goes about 19 characters at a time in Firefox. I may fix this one day so it goes one column at a time and ends at the last Unicode character (0x10FFF).
Unicode Converts Reference Chart v1.0: This is a reference chart I made of Unicode characters and character ranges that can be converted to normal English characters. This includes removing character accents.
Click here for script notes
I needed to research and make this when I was adding on Unicode support to my “String” Personal Library. This was a daunting and annoying task that I was forced into since I couldn’t find this information anywhere else on the Internet :-\ ; though I did find something like it in a Windows’ file used for string ordering and such. This probably wouldn’t be very useful to anyone unless they were making a Unicode library. I didn’t try cleaning this script up like most of my releases, as there really is no need. All the numbers can be found in the script itself.
Wake On LAN v1.0: A script to remotely wake a computer (Wake On LAN).
Click here for some notes and a working copy of the script
  • To wake up a computer over the Internet, the given port must be able to reach the computer you wish to wake. If the computer is behind a NAT, the port must be forwarded.
  • The computer must support “Wake On LAN” for the script to work. This sometimes takes a specialized NIC (network card).
  • If a domain is given for the IP address field, it is resolved and filled in on submission.
  • If a valid MAC address is given, its format is updated on submission to fit that of the example.
  • Error and success messages are shown after submission at the top of the page.
Whois v1.0: Query a domain’s registration information. (Whois)
Click here for a working copy of the script
[Close working copy]
Default PHP Variables v1.0: Outputs all default (already defined) PHP variables when a PHP script starts.
GetIP v1.0: When someone goes to this script, it records and informs them of their IP Address. If this script is loaded with ?GetIP appended to the end of its URL, it reports the last IP Address recorded. This is an incredibly simple script I very often use when I need a person to get me their public IP address. I have thought of updating it to record and retrieve IP Addresses against a pass string so many people can use it here, but meh.
Concepts
Cross Platform Scripting
Updates
More Project Thumbnail Updates @ 2008-09-28 15:48:04

The following projects have had thumbnails added to them: College Crap, Freedrive URL cracker, Highschool C++ Class, HTTP Zip, Small, Other Web Scripts.

The Eyes project thumbnail has been updated to have a transparent background to better represent it.

Multiple "Other Web Scripts" added @ 2008-09-25 13:15:46
The following scripts have been added to the “Other Web Scripts” project:
NameThis was done sometime in/between...
2005
2002 and 2004
2005
late 2006
2003 and 2004
2003 and 2004
2002 and 2004
2002 and 2003
Directory Manager v1.1 @ 2008-09-24 16:44:10 - Download
The following fixes have been applied to Directory Manager v1.1:
  • Base URLs “<base href="...">” are now supported (they no longer break links)
    • Type: Feature (Base URLs are common for complex layouts)
    • How: All links in the script are now absolute from the base domain instead of relative to the current directory.
  • Confirmation is now requested through JavaScript before a file is deleted
    • Type: Feature
    • Why: Because there should always be confirmation before deleting data.
  • User authentication can now be applied only to the script instead of the whole directory
    • Type: Feature
    • Variable Name: OnlyProtectIndexFile
    • Why: Sometimes the user might want to only protect the ability to manipulate the directory, but not the files in it.
    • How: This adds a “<files>” directive to the “.htaccess” file around the user authentication section.
  • Header and Footer sections have been added to the top of the file right below the user variables section for easier manipulation of the page layout
    • Type: Feature
    • How: The user can now add layout header and footer information to the “HeaderSection” and “FooterSection” functions.
  • Script now only shows normal files (not directories) in its file list
    • Type: Bug Fix
    • How: The “is_file” function is now used on entries returned from the “read_dir” function before they are added to the list.
    • Side Effects: “.” and “..” were removed from the DoNotShowList variable.
  • Fixed all improper static strings of “index.php” to properly point to the current file (MyFileName variable)
    • Type: Bug Fix
  • The following user variables have been removed: MyFileName, RootDirectory
    • Type: Simplification & Bug Fix
    • Why: There was no need for the user to define these variables when the script can extract them. This also fixes a bug that occurs when a parent directory is symbolic linked.
    • How: Instead of using the “getcwd” function and subtracting that from the provided RootDirectory variable, directory and script name variables can be extract from the $_SERVER['SCRIPT_NAME'] variable.
  • Additional comments have been added in the file for code clarification
    • Type: Other

Other Information:
  • The Directory Manager information has been updated to reflect the above updates.
  • The “file by file protection” [possible] future update was also added to the information.
  • PHP scripts that now only have 1 file to them are available for download as plaintext files with the extension “phpcode” that just need to be renamed to “php”; instead of zipping them.
Image Zoom Effect Details @ 2008-09-17 12:14:03

The description, “how to use”, technical info, and an example have been added to the Image Zoom Effect in Other Web Scripts.

New Web Script - Directory Mananger v1.0 @ 2008-09-15 08:26:17 - Download

One of the most common requests I get from customers is the ability for their clients to upload files through a web page (HTTP) to the server; so I threw together from scratch[All of the script was written from scratch execept the HumanReadableSize function] a secure and robust script for this in about 6 hours which clocks in at about 360 lines. The single file works on just the directory it resides it, so the file can be uploaded to any directory you want it to work on with no extra hassle.

I know there are a lot of large applications out there for managed file uploading through a web interface, but I decided to make this anyway as it is kind of specific in its goals, being relatively lightweight and working on just a single directory at a time. Also since I made it myself, it’s easier to modify and update for specific clients needs, like direct integration into their website design.


Its main features are:
  • Sorted file listing within the directory
  • Upload files of allowed type (invalid extensions are renamed)
  • Delete and rename files
  • Create and delete user logins
  • Logged in users can change their password
  • All features are toggleable in three tiers:
    • No user file found (Directory access is currently unrestricted)
    • Normal user
    • Admin user
  • Easy basic configuration through a short variable list at the top of the file. Once it is configured the first time for a website, it is unlikely the configuration would need to be changed when copying (or symbolic linking) the file to other directories.
Image Zoom Effect Update @ 2008-08-09 21:24:08 - Download

Updated the script so that it now tries to stay within the browser window, and I think I made a minor speed improvement by changing the growing image to an absolute positioning instead of relative.

Found another bug in which the image zoom object might never start growing and stays active if mouseover event is never caught.

New Image Gallery Layout Effect @ 2008-08-09 05:18:28 - Download

I decided the rather clumsy image effects on my posts with thumbnail galleries needed to be redone badly. They originally just displayed the full size pictures centered horizontally in the browser and then slightly above or below the current mouse position vertically, but this really did not work very well.

I just redid the HTML code in each of the thumbnail gallery posts so they are compatible with a new script I just now wrote [v0.9] in about two and a half hours. It kind of zooms in on the images when you mouse over them.

I still see a few bugs in the script and things I need to fix, but this is fine for now as I am exhausted and really need sleep. I thought this up as I was trying to sleep earlier, so I ended up giving up on sleeping in lieu of writing this to get it out of my system.


Things that need fixing still:
  • Do not allow picture to overlap browser window (if it can fit)
  • The animation seems a little choppy... need to see if it can be speed up
  • Possible optional addition later: Position pictures in different directions of the thumbnail (above, below, or centered around each corner)
  • IE bug when picture first loads and improper dimensions are read