Tenchi Muyo

Author's Notes


Here I'll describe a few of the more technical aspects of these here pages, and let whoever wants to grab the images and cgi-bin source I used.

Look, I'll even put in a contents list at the top, as this document is getting largeish. Not that you can jump down to the bottom before the page has loaded, but you may know whether to wait if you know what to expect.

Contents

* Background Images
* Transparent Images
* Inline Slideshow
* Automatic "Last modified" Footer


* Background Images:
Most of the background images used in these pages were actually created by Derek Liu (Lanzer) mainly because I don't have the time. OK, so it's also because I was impressed with what I saw on his pages, and he has more experience with image manipulation than I do, and he also has a machine and the software as well. *sigh*

OK, so now I have the machine and the software. All I need now is some source material, some spare time, and to figure out how to use the software.

To use backgrounds yourself, get the GIF or JPG you want to use, and add BACKGROUND=filename to the <BODY> structure. For example, for this page (as of 9 Aug 95) it is :

         <BODY BACKGROUND="backgrounds/tenw-bg1.gif"> 

If you want to see all the backgrounds I use (and some I don't use), they're all stored in here.

If you just want the Tenchi ones I use in these pages, these are them :

* Tenchi Muyo Logo (GIF, 13k)
* Falling Ryoohki's (JPG, 7k)
Please let me know if you're using any of these on your own pages.

* Transparent Images:
Most of the small inline images in these pages contain parts which are transparent. That is, you can see the background through them. Some browsers don't support backgrounds, but DO support transparent images, which can be handy where the browser may dither your attempt to match the browsers background colour.

Transparent images can only be done with GIF images; GIF89 images to be exact (the other common type is GIF87).

I used a number of windows apps to create the pics, because, unfortunately, no one app I tried had all the functions. First, I use WinGIF to shuffle all the used colour entries to the first positions in the colour palette table. This leaves the last entries unused (they're set to black). I do this so when I assign a "colour" to be transparent, I don't get other bits of the image becoming transparent.

Next, I used PaintShop Pro (version 3 ??) to edit out all the unwanted/transparent areas. Mainly I use the lassoo and wand for chopping out bits of background, and sometimes the spraycan to soften the edges. I set all these cut bits to colour 255 (the last in the palette, which after the WinGIF bit, is probably unused) (If the picture uses ALL 256 colours, I cut out the bits I want to cut to another colour, then redo the WinGIF stage, and usually a few colours are freed up).

For the last step I load the pic into LViewPro, which allows me to set colour 255 to transparent. It also allows me to save it as interlaced, which looks nice on some browsers.

UPDATE: If you have Photoshop 3.0 or later, you don't need any of the above applications. Just grab the GIF89a Export Plug-in, install it, and you're set. Use the selection tools to highlight the parts of the image you want to keep (I usually hilight the bits I want transparent then invert the selection), save the selection, and then select File->Export>GIF89a Export, and tell it to make the saved selection transparent.

* Inline Slideshow:
THIS is the reason I decided to whip up this page, since I keep getting requests from people on how I did this. Unfortunately, I have to go home now or I'll miss The X-Files, so I'll have to do this later. ^_^

Time passes ...

OK, so, how do you do that ducky slide-show on the first page? Netscape 1.1 and later support dynamic HTML pages. ie; pages where the contents changes over time. One implementation of this is "poor man's animation", where the server just keeps spitting images across the net now and again.

I was "convinced" by Lanzer to get it working, so he could have a small Sasami animation on his Sasami Shrine, which he runs from my site because his service provider won't give him that option. The cgi-bin used is derived from a quick throw-together by some guy called Rob McCool at Netscape as a simple example. You could probably easily write it as a shell script, but I haven't had the time to write a nicer version.

Anyway, all the stuff for the animations (source, binaries for HP-400, and images) is in this directory. If you grab a copy of one of the source files and have a look, you should be able to figure out how it works. It helps to know C.

At about line 19 there's a #define LASTCHAR definition which sets the letter to finish on. The images finish in a letter, with 'a' the first frame, through to whatever you set LASTCHAR to be as the last frame.
The next thing you may want to change is about line 26, which defines the content type. This should match what format pictures you use, so change it to "image/gif" for GIFs, and "image/jpg" for JPGs.
Last bit, at about line 47 there's a printf statement which will print, amongst other things, the filename of each image, with a %c in place of where the incremented character will go.

And that's about it as far as the executable goes. Compile that, then do whatever you do to enable cgi-bin's in your directory. Depending on your http daemon, they may have to be in /cgi-bin off the daemon's directory, or, like my site, you may need a small config file to enable cgi-bin execution from your own directories. The file for NCSA HTTPD is .htaccess, and mine looks like this :

	 Options Indexes FollowSymLinks Includes ExecCGI
	 AddType application/x-httpd-cgi .cgi
	 AddType text/x-server-parsed-html .html
The last line enables server side-includes, which I've been fiddling with lately.

Anyway, that's about it. Just include it in a html page like you would an image, although it's important to specify the images height and width. ryoko.html in the directory mentioned above shows an example. Have a fiddle with it, and if you can't get it to work, feel free to ask me questions.

* Automatic "Last modified" Footer:
I was inspired to do this at a meeting of fellow WWW peoples (both staff and students) when a staff member asked if it could be done, and someone else answered "no". Straight away I had ideas for scripts going through my head. I was on the case.

My first idea was to use a server side include to run a script to do an ls -al, grep for the appropriate file, and cut out all the info except for the last modified time. I thought this because the only examples of side includes were to run things like counters and such. Anyway, that was rather inelegant, and had a few bugs, so I ended up at the official NCSA httpd server side includes page (I don't know if any daemon other than NCSA has the same format). To sum up, when the httpd gets a page requests, it can parse the page for its own codes, and substitute something dynamically in place. This means that if someone looks at your source, they won't actually see anything tricky.

On the page, I discovered that there were other things to do than execute a script, and one of these involved the "Last Modified" date of a file. Here's what's actually at the base of this page (and others) :

	 <!--#config timefmt="at %I:%M %p, on %A %d %B %Y"-->
	 <I>Last modified <!--#flastmod file="tech.html"-->.</I>
The first line isn't totally necessary. It just formats the time and date how I want it to appear. It's a string compatible with the strftime library call under most versions of UNIX. (ie; I just did a man strftime on this HP and it told me how to do it.
The second line is the important one. You just set the file to check to the current file. This is nice, as I usually have an index.html which is a link to another file (such as homepage.html), and the last modified time of the link is the date the link was created, not the last time the page was modified. It's also handy if you want to tell users when a link was last modified on a contents page.

Anyway, enough drivel. One more thing; like the cgi-bin, you may have to modify a .htaccess file and/or the daemon's main config to get this to work. In my .htaccess file (shown earlier under the slide-show bit), the last line says what to parse. To cut overhead you can give files with side includes a different extension, so the daemon doesn't need to parse other files.


Last modified at 02:34 PM, on Wednesday 19 June 1996.
Return to the Tenchi Homepage
Trevor Phillips (phillips@cage.curtin.edu.au), 1995. [an error occurred while processing this directive]