FX Display Average for Single (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 display with the required code. It can create at your choice a complete list which means also only one specific record or an array of single items.
Preparing
First you need to create a recordsets to retrieve the required data to display like description, score and voters if you are creating it in the same page happens the rating only one recordset may be enough to accomplish both tasks. 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 to show and open the FX Display Average for Single object from Insert > Felixone Objects.
Applying
| Style: | Select the purpose of the display, if you want to display a complete list or an array of single items depending on how you applied the FX Do Rate Single behavior. Please have a look at the demo 3 and demo 4 to have a better idea. |
| Display Recordset: | Select here the recordset which will list the item candidates. |
| Rating Field: | Select here the field which contains the rating or votes. |
| Counter Field: | Select here the field which contains the voters count. |
| 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. |
| Max Rate: | Insert here the max rate as was defined in the listmenu, for instance if you created a listmenu with scores from 0 to 10 the max rate is 10. It's up to you how to create the rating score, you can use also decimals in the listmenu in this case you must always use a dot as decimals separator. |
| 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. |
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.
You may re-arrange graphically the display table but avoid to give a width directly to the display table and be careful to not alter the bar Max Width value.
by FELIXONE