Location: PHPKode > scripts > FineDiv > finediv/finediv.txt
class_finediv.php

How to use it

As any other php class the first thing to do ist to include the class file

include 'class_finediv.php';

Be sure to have a folder for the css files ready. The folder can be
made using your favorite FTP program or even from a telnet session.

Finediv needs writing rights. This means that PHP scripts are generally
allowed to write data to files on your server. This is not the case for
all servers. Some providers only allow uploading. If you have trouble
generating css and image with finediv, then

	1) Be sure to have a folder where css, images and 
	liquidcorners.inc reside. Give this folders name as a parameter
	to the instatiation of the class:

	$fd = new finediv( 'css' );

	2) If you have the folder and writing is not allowed then
	use the workbench:
	http://www.ingoknito.de/scripts/finediv/workbench.php

After the instantiation of the class it is ready to be used.
The default box is gray without a border.
But the html page needs the css and the image!
The install() function needs to be called in the <head> section of the html page.

$fd->install();
	
Showing the box is simply done with one or some of these functions:

put()	direct output
get()	returns a string which may be put in an echo statement
puttop()	output upper part
gettop()	returns a string
putbottom()	output lower part
getbottom()	returns a string

put() and get() take three argumens: $toptext, $middletext and $bottomtext.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

TROUBLE SHOOTING

I recommend using at least two different browsers to view the resulting page.
Sometimes one of the browsers shows the top of the box flying, leaving
an unpleasant gap.
This is often the case, when there is no argument given for "puttop()".
Give puttop() this string as some sort of "glue":

$fd->puttop('<span style="font-size:2pt">&nbsp;</span>');

Some statements like "h2" or "form" or "fieldset" are not glueable at all.
Try to wrap them into another <div> statement.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

FINER CORNERS

The resulting image is not optimal. The rounded corners are not "clean".
This may give some "handworked" character to your website. But you may not
like it. Just look at the bottom left corner of the boxes to see what I mean: 
There are always some surplus pixels left. I have tried at least five
different ways of drawing the image. I always had trouble with both the
lower corners. Miracle - flipping the top half down did not fix this?!
When playing with $fd->factor and $fd->numpalettecolors you can see the 
pixels move, but not vanish. But there is the resort: 
you can rework the new image by hand, smoothing the
corners with your favourite painting program.
The class will not overwrite your image.
Return current item: FineDiv