FX Display Rating (by Felice Di Stefano)
(ASP Js, ASP Vbs, PHP MySQL, PHP ADODB)
If you have already created a poll or rating page your database is already set the right way. This object will automatically create the results table with the required code.
Preparing
First you need to creates two recordsets, the one to retrieve the candidate items and relative score and the one to retrieve all the IPs from the ips table with no filter to get the number of voters. You will not need to create a dedicated table on the page since it will be created by the object. Set the cursor where you want the results table will be created and open the FX Display Rating object from Insert > Felixone Objects
Applying
| Connection: | Select here the used connection, usually the same one used for the recordsets. |
| Display Recordset: | Select here the recordset which will list the item candidates. |
| Rating Field: | Select here the field which contains the rating or votes. |
| Name Field: | Select here the field which contains the item candidate name. |
| Extra Name Field: | This is an optional field to use when the item has a complex name as for example persons with first and last name listed in two different columns. |
| Graph Bar | |
| Max Width: | This represents the max width the graph bar can reach at 100% in the display. Watch out when editing the created table do not alter the applied value and avoid to give a width value directly to the table. |
| Height: | This is the bar height which may be altered by the exceeding size of used fonts when is not used a still image to represent the bar. |
| Color: | Define here the bar color, or leave it blank if you intend to use only an image. You may combine it with a still image to create some effect. |
| Use Image: | Browse to an image of your taste to create the bar or leave it blank if you want to use only a color. You may combine it with the color if used as still image. Included in the package are few sample images, make yours as you please. |
| As: | Two choices if you want to use an image for the bar, as background or as still image. You can combine with the color as still image but not as background. |
| Format percent: | It will be displayed also a numeric percentage of the rate which you can format decimals and separator as you wish. Note: the separator is valid only in PHP it will be disabled in ASP. |
| IP Table: | Select here the table used to record the user's IP |
| IP Column: | Select here the name of the column where IPs are recorded. Since there will be only one column it will be already selected. |
| Voters Recordset: | Select here the recordset used to retrieve all IPs with no filter from the ips table it will give you the voters total. |
| Check Cookie: | Insert the name of cookie you used in the poll page to do a check on it. |
| Redirect To: | Define here the page to redirect if the ip is not found, usually the poll or rating page. |
It would be a good thing to add a Do Not Cache code in this page. You may find one for PHP here and some for ASP at the Adobe Exchange.
Note: You will find the FX Sum Rating * sb applied on the sb window, use this sb with caution do not use it to create the results page its main purpose is to change the state of the Close Poll box which must be always the same in both vote and results pages to avoid an infinite ping pong. You may read about clicking its Help button.
You may re-arrange graphically the display table but avoid to give a width directly to the table and be careful to not alter the bar Max Width value.
by FELIXONE