The Images section of gpolladmin allows you to manipulate the images used to create the "bars" of the polls. You can use this section to:
All images are stored on the server in the directory set in the $IMAGEDIR variable in the gpolladmin script. The default value is the Pics directory at the root of the webserver. If you change $IMAGEDIR, remember to change $gpoll::GP{IMAGEURL} as well.
Warning: To add your own images, this directory must be writeable by the process running the webserver. If you get a "could not write file to disk" error, you will need to grant correct permissions to this process.
You can upload your own images directly from your local computer, and store the on the server for use in the polls. Files must be gif, jpg, or png. Simply go to the images section, then select the "upload an image from your local computer" link.
This method depends on the webserver being able to write to the "Pics" directory: see the earlier warning about this.
The image upload form has the following sections:
Indicate which file you wish to upload. Most browsers provide a
Browse button that will allow you to navigate through your
local computer and find the file you need. Only files ending
in .gif, .jpg, or .png may be uploaded.
This is the name that will appear in the pulldown list when you are
editing polls. Use a short, descriptive name such as "blue marble" or
"red brick." Names must be between 1 and 80 characters. If you leave
this blank, the original filename will be used.
(optional) File name to save as on server:
This is the name of the actual file that is stored on the server.
In most cases, you can leave this blank, and the name will be the
same as the uploaded filename. A symbolic link is actually made to this
file, so the name does not matter too much: your users will only see
the name "cxxx.zzz", where xxx will be a number from one to
three thousand, and zzz will be the extension (gif, jpg, or png). File names
must be 80 characters or less.
Overwrite?
Only check this if you want to replace one of your existing files on the
server.
When you are ready to upload the image, use the "Upload File" submit button.
General guidelines on adding images:
You can also add the images to the server yourself, and allow gpolladmin to detect them and add them to the database. Simply move the images to the Pics directory, and gpoll will detect them. You can even add symlinks, allowing you to keep your original images in the same place.
This method depends on the webserver being able to write to the "Pics" directory: see the earlier warning about this.
The directory containing the images will be scanned for gif, jpg, and png images that are not already in the database. A form showing each image will then be displayed, with the following sections:
File name, size, creation time
This shows the name of the file on the server, the size of the file in bytes,
and the time and date that the file was created.
Enter a name for this image that will be used to refer to it when editing
polls. The name should be short and descriptive. If this field is
left blank, the image will not be added. The maximum length is 80 characters.
How this image appears on white and black backgrounds:
This shows a preview of how the image looks on a white and on a black background.
The image is scaled to 25 pixels in height and 250 pixels in length.
If you need a color that is not part of the basic 139 provided, don't worry - you can create your own.
Enter a six character hexadecimal code for the color. The first two characters indicate the strength of the red component, the second two the strength of the green component, and the third the strength of the blue component. Values range from "00" (no color) to "FF" (full strength). Thus, a pure red color would be "FF0000", black would be "000000", white would be "FFFFFF", etc.
Enter a name for this image that will be used within gpolladmin to refer
to this image. Name should be short and descriptive. The maximum length is
80 characters.
If you want to see how the color will look before creating it, choose
this: a cell of the table will be changed to the color that you
have picked.
Create this color:
Attempt to create the gif.
Note:
The images section lists all of the images currently available. They are listed grouped by type of image (png, jpg, or gif), with the most recently added images appearing at the top of each group. Clicking on the image name will allow you to edit the image. If the image is a single color gif, the color code will be listed next to the name in parenthesis.
You can select which images are listed and how they appear with the following options:
View all images as text only.
This is the default view, and simply lists the name of every image
in the database.
View all images with previews.
This lists all images in the database, and also shows how each image
looks on a white and on a black background. This is an excellent way
to view all of your images at once and compare them.
View new images as text only.
This lists the name of every image that you have added (regardless of
method), and excludes the basic 139 gif images that were created automatically.
View new images with previews.
Same as above, but also shows how each image looks.
The edit image page allows you to rename and delete images, as well as specify which images are the default for new polls. The edit image form has the following sections:
The image number is used internally by gpoll - this number is used
to change the images when using
SSI.
The image name is what shows up in the menus when
creating or editing a poll. The maximum length is 80 characters,
but it is recommended that you keep the names short and
meaningful.
Simple one-pixel images created by gpoll will have a row in the table
showing the exact hexadecimal color of the image.
This is the name of the file that is stored on the server, and may not
be the same as the image name. Next to it is the size of the file
in bytes. One-pixel gifs are a mere 35 bytes.
This lets you know if the image is currently being used by any polls.
Images cannot be deleted if they are being used.
How it looks on a (white|black) background.
This gives you an idea of what each image will look in the polls. The
size of the image is scaled to to 25 pixels in height and 250 pixels
in length.
Default for bar1, bar2, shade1, and shade2
These let you know which image is being used as the default for the
image bars and the shadows. You can change this to the current image
by using the checkboxes. Images cannot be deleted if they are being
used as a default.
The delete button will not appear if the image is one of the original
simple gifs, is being used by any polls, or if this image is the
default for any bar or shadow. You will get a confirmation message
when you try and delete an image, so don't worry about hitting
the button by accident. You also have the option of deleting the
actual file from the server as well. If you do not
do this, then you can add the image again by going to the
"Check the server for new images" section.