Thomas Brunt's OutFront Hosting
 
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Installing and Using Perl Scripts - Part 6  
by Outfront Moderator Katherine Nolan (abbeyvet)

Customizing your User Poll

The poll is installed and it looks fine, it just doesn't look like your site. Generally you will want to alter the poll's appearance so that it fits seamlessly with your existing design. Fortunately this is very easy to do, but there are a few little things to look out for.

You have two options for integrating the poll.

1. Non-SSI

In this case the poll will have its own page, which you can customize to look exactly like any other page in your site. This is a good option for anyone who cannot use SSI or .shtml extensions on their server.
There is a sample of my customized installation here: http://www.inkkdesign.com/cgi-local/poll/Poll_It_v2.05.cgi

2. Using SSI (Server Side Includes)

Using this option the poll is fully integrated within another page on your site. This is probably the method preferred by most.
There is a sample of an poll integrated using SSI here: 
http://www.inkkdesign.com/pollit.shtml

Note that there is nothing to stop you using both methods on the same site and with the same poll. For example you might want to have the poll included by SSI on your home page but also put a link elsewhere in your site that allows users to go to a specific page to vote.

Customizing a Non-SSI Poll Installation

This script uses HTML templates to display the poll and the poll results so we will need to edit both of these template files so that they look more like your site.

The files are both in the pollit_files directory wherever you unzipped the script to. The two we need are:

  • _poll.htm

  • _last_poll.htm

There are many ways to go about editing these but this is the way I find quickest and easiest. It may seem like an involved process but it really does not take very long.

1. In your web do File>Import and import both files to your web.

2. Right click each and rename it so that the underscore at the start of the name is removed. If you do not do this you wil be unable to open the file.

3. Open poll.htm. What you have is a pretty standard, if plain html file. You can edit the colors, table widths, fonts etc here in the same way as you would any other file, but you need to be careful. 

It is essential than none of the markers - eg the words surrounded by $ signs - are deleted, they are what make the page work. You can resize the $marker$ text, change its color, its font or its alignment but do not delete it.

4. When you are happy save the file. Repeat steps 1-3 for _last_poll.htm

5. Now open any page in your site and save as a template - call it perltemplate.htm. What we are going to do is set up this page so that we can past the actual poll tables into it. The first thing you need to do is remove any text on the page so that you have a fully styled template with no content. There are a few things you need to do to make sure this page will work.

a. This will not be a FrontPage file - it will be part of a script and will be FTPed, not uploaded. Therefore you must remove all FP features such as include pages or navigation components and replace them with none FP alternatives - eg plain text or a JavaScript navigation.

b. You need to change all the urls in the HTML from relative to absolute. Links, image paths and so on must all be changed. 

For example if you have a link to your home page that reads <a href=index.html> this must be changed to <a href=http://www.yoursite.com/index.html>

Similarly if you have an image called using <img src=/images/image.gif> it needs to be amended to <img src=http://www.yoursite.com/images/image.gif>

This is a bit tricky if you are unused to editing HTML, but stick with it, it is not that bad! Just go carefully through your html replacing the urls one by one.

6. When you are satisfied that step 5 is complete save the page. 

7. Open poll.htm again. If you go to html view you will see that between the <body> and </body> tags there is just one large table. Highlight it and copy it. Close the file.

8. Back at your template, decide where you want the poll to go and type the word 'Here'. Highlight 'Here' and switch to HTML view. Replace the word 'Here' with the table you copied to your clipboard.

9. When you go back to normal view your poll should be neatly integrated into the page. Make any final edits you like to it - you may need to alter the table widths for example. When you are happy do File>Save As and save the file as _poll.htm

10. Open your perltemplate.htm file again and repeat steps 6-9 to create a using the table in last_poll.htm and saving the file as _last_poll.htm

11. Fire up your FTP connection and upload your new _poll.htm and _last_poll.htm files replacing those on your server and you are done.

Housekeeping note: You can either delete all the files left hanging around your site on your local computer after doing all this or place them in a folder marked not for publication. Otherwise they will all be published next time you publish your site, not a problem but messy! I find it handy to keep the perltemplate.htm file - you never know when you will be using another script that will need something similar.

 << Part V: CHMOD and Setting Permissions
>> Part VII: Customizing an SSI Installation

Fun With Background Images
Fun With Bulleted Lists
Are You Compliant?
Introduction To Cascading Style Sheets
Creating Custom Error Pages
Designing Fast Loading Sites
Creating Funky Forms With CSS
htaccess Magic
An Introduction To JavaScript
JavaScript Snippets
Getting More From Mailto
Installing And Using Perl Scripts
Preparing Photos For Your Web Site
The Popup Dilemma
Paint Shop Pro Album 4
Creating And Using robots.txt File
Creating JavaScript Rollover Buttons