Tools

[ Back to top ]

Preamble
This document aims to cover the various tools provided with the iStrip software package. These tools are optional add-ons for the iStrip system, or are for use in exceptional conditions in order to attempt repairs to damaged iStrip installations

[ Back to top ]

buildindex.php
What it is
This tool scans a directory on your server and uses any image files that match the requirements specified below to build the .stripindex file that iStrip uses to store information about strips and news items.

Uses for this script
This script will be mainly of interest to people who already have a webcomic site and wish to switch over to the iStrip software to drive it. If you have previously run a webcomic using an automation script such as Autokeen Lite or if you have done it manually with plain HTML pages then this script will make the process of migrating over to iStrip easier. This script can also be used by people who are setting up a site from scratch but who already have a backlog of material to make available immediately. The strip index builder will let you get all your strips online and not have to upload them one at a time and then wait for the next day to upload the next.

Important notes
As this script is a new addition to iStrip it may still be a little buggy in places. I have of course tested it and read through the code several times to make sure nothing obvious is wrong but there may be some bugs lurking in there somewhere. If you get any odd results with this script then please leave a bug report on the iStrip source page.

Currently this script only scans for strips. It may at some future date be expanded to also scan for news but at the moment if you have news on your server from another web comic publishing system such as Autokeen Lite then these will not be entered into the strip index. You can enter them manually after running the script of course, but this could take some time if you had a large number of strips in your archive.

Preparation for use
Before you can run this script there are several prerequisites that need to be met:
  1. iStrip must be fully installed and configured. See the installation instructions for more details on how to install iStrip, or the upgrade instructions for more details on how to upgrade an older installation of iStrip to the version in this package.
  2. The buildindex.php script needs to be installed on the server. This is done by uploading it to the admin directory for your site. If you upload it somewhere else the paths will be incorrect and the script will fail to run.
  3. iStrip must be able to write to the .stripindex file. You should upload the empty .stripindex file in this package to the proper location on the server and make sure that iStrip can write it. This may require that you CHMOD the .stripindex file to appropriate permission level. Recommended values are listed in the installation instructions.
  4. There must be strip files on the server that the script can use to build a stripindex. Obviously, a strip index can't be generated if there are no strips to generate one from available. It is recommended that you move any strip images you may already have on your server to the location that iStrip uses to store strips (this is the content/strips/ directory relative to the iStrip root directory by default).
  5. The strip files must be in a file format that PHP can identify as being an image. For PHP 4.2.3 the files that will be recognised are GIF, JPEG, PNG, BMP and TIFF (Motorola and Intel byte order are both supported), and PHP 4.3.0 will also recognize XBM files. Formats such as Photoshop or Painter images are not supported because they don't have MIME types. Shockwave Flash files are not supported because they have a MIME type of application/x-shockwave-flash and therefore wont be recognised as images by iStrip. WARNING: While some uncompressed formats such as BMP are recognised, it is recommended that you use these formats under no circumstances whatsoever. These formats are not compressed and this results in huge file sizes, even for relatively small images. Visitors to your site will be kept waiting for ever for strips to display, even on broadband connections, and massive amounts of bandwidth on your server will be consumed. For web-published images, the preferred formats are GIF, JPEG and PNG.
  6. The filenames of the strips need to be in a specific format so that the script can determine the date which should be assigned to each strip. The format is an 8 digit number, followed by a dot, then the file type extension. The 8 digit number is a date in the format YYYYNNDD, in other words, the first four digits represent the year, the next two the month and the last two the day of the month. For example 20031017 would be the 17th of October, 2003. This is similar to the format for filenames used by Autokeen Lite, but without prefix or postfix support. Examples of valid filenames are 19760911.gif (11th September, 1976) or 20000229.png (29th February, 2000). Filenames such as foo_19760911.gif or 19760911_foo.gif are invalid and will be ignored by the script because they contain extra characters. 20030229.jpg is technically invalid because it refers to the 29th of February on a non-leap year. However, PHP will treat this date as the first of March. This can obviously lead to problems if you also have a strip for the 1st of March 2003, so be very careful when working with dates for near the end of February NOTE: Dates that are valid but in the future will be rejected as iStrip does not yet support post-dated strips.
  7. The dates specified in the filenames must all be unique. If all your strips are in the same image format it will be impossible to have two with the same date anyway because the filenames would be identical and therefore not allowed by the operating system. But if you mix several different formats then it is possible for two of them to have the same date, 20031017.gif and 20031017.jpg, for example. In this case an entry for the .gif file will be generated but the .jpg file will be rejected because the list of files found by the script is sorted alphabetically before being processed. In addition you could cause some confusion if you specify a strip for the 29th of February and one for the first of March if the year in question isn't a leap year.
Using the script
This script runs in a web browser and is triggered when you visit its location. It runs entirely on the server, the web browser only provides the interface. There are two stages of operation for this script, a data gathering stage and a data processing stage. To use the script, follow the instructions below:
  1. Run the strip by visiting it with your web browser. You will be asked for your login details.
  2. The script will complete it's first stage of operation by scanning the strip directory and generating a list of any strips it finds that meet the requirements given above. This list will then be presented to you.
  3. If you so wish, you can now enter titles for the strips that the script located. If you are not sure which strip is which you can review each strip by following the "view image" link.
  4. Once you have edited the strip titles to your satisfaction, click the "generate strip index" button at the bottom of your list
  5. The script will now attempt to generate and save a strip index file. You will be presented with a status report informing you of whether the operation succeeded or not.
  6. If the script reports that the strip index was successfully generated and saved then the process is now complete.
Post-running activities
Once the script has been run there are a few more tasks that should be performed:
  1. Check for files that weren't added and resolve the problem that caused them to be rejected. By running the checkfs script you can obtain a list of any files that were rejected by buildindex. To run checkfs, go to the admin index page and follow the "Audit filesystem" link. Resolving any problems that were reported may require you to rename strips or convert them to an appropriate file format. Some problems may not be resolvable, for example there is no way to have 2 strips with the same date. You will either have to put one strip on a different day or delete one. Run the buildindex script again
  2. Once you have resolved any problems that may have occurred, delete the buildindex.php script from your server. Once your strip index has been successfully built the normal admin pages will be sufficient for administrating your webcomic.
Troubleshooting
This is a list of problems that may occur with this script and ways to resolve them:
  • Script fails to run
    The script may be installed to the wrong location. Make sure that it is in the admin directory
    The include files that the script needs may be missing. Ensure that iStrip is installed correctly
    The include files may be the incorrect version. Replace the installed includes with the ones in this package
  • Warning message about pre-existing strip index is displayed
    You have already uploaded strips or a .stripindex file that contained an entry. Ignore this error in the latter case. You may choose to also ignore it in the former case, but bear in mind that if you have defined any news items then these will be orphaned from the strip index and will have to be manually deleted from the server
  • No files are listed
    Your strip files are in the wrong location. Move them to the proper location on the server.
    Your strip files are improperly named. Rename them to the format described above.
    Your strips are in a format that iStrip doesn't recognise as an image, or as an image with a MIME type of application/octet-stream, for example Photoshop PSD format. Convert them to an appropriate file format and try again.
  • Files are not in the order I want
    You made a mistake with the filenames. Check that the filenames really specify the date you want them to.
  • No strip index was saved
    The current strip index may not be writeable. Check that it has the correct permissions set. If not, CHMOD it to the appropriate settings (see installation documentation)
    The strip index may not exist yet and the directory into which it is meant to be written is not writeable. Upload the empty .stripindex file in the package and CHMOD it to the correct level of permission.

[ Back to top ]

showbanner.php
What it is
This script works like the inbuilt random banner function of iStrip. It selects an image at random from the banner directory and serves it to the visitor. This will allow you to use your site banners on pages that aren't parsed by iStrip

Uses for this script
There are all kinds of use for this script. For example, if you are running a forum for your webcomic with EzBoard or PHPBB you can use this script to put random banners on the page just like on your comic site. Alternatively, if you run a separate website you can use this script to display a banner on your links page for your comic that is different every time somebody visits the page.

Important notes
It is theoretically possible to use this script to give you a randomly generated image in such things as signatures on bulletin board systems. This is, however, not recommended as if someone views a page to which you have made a lot of posts, the script will be invoked several times for the page view. If the forum in question gets a lot of traffic then you will find your server getting a huge amount of bandwidth used in sending out all the random images.

Preparation for use
To use this script the following prerequisites must be met:
  1. iStrip must be fully installed and configured. See the installation instructions for more details on how to install iStrip, or the upgrade instructions for more details on how to upgrade an older installation of iStrip to the version in this package.
  2. The showbanner.php script needs to be installed on the server. To do this, just upload it to the iStrip root directory (the directory where index.php and viewpage.php are located)
  3. You need some banners in the content/banners/ directory. Having one is pointless as this script was designed to randomly select an image at random from several. It is recommended that all your banner images are the same dimensions.
Using the script
Once the script is installed accessing it via its URL will cause it to serve an image from the banner directory at random. To use this on a web page embed an <img> tag in it that points to the URL of the banner script. For example, if your site is being hosted at http://www.foo.bar/baz/ then you would use an image tag along the lines of <img src="http://www.foo.bar/baz/showbanner.php" width="468" height="60" alt="Visit my comic" /> to cause a random banner to be displayed. The width and height tags I included in the example are assuming that all banners you have designed are standard web banner size. You can of course use a different size for your banners, in which case you should specify different width and height attributes

Troubleshooting
  • Script fails to run
    The script may be installed to the wrong location. Make sure that it is in the root directory of your site
    The include files that the script needs may be missing. Ensure that iStrip is installed correctly
    The include files may be the incorrect version. Replace the installed includes with the ones in this package
  • No images are served
    There are no images in the banner directory. Upload some banner images

[ Back to top ]

Copyright © 2002, 2003 Gordon McVey