Public Method Details |
Poll |
public void Poll( )
|
|
Class constructor
|
Returns |
void |
|
submit_new |
public string submit_new( mixed $table, [ string $widthcomment ] )
|
|
Handles submission of a new poll
If table is an array, calls add_poll and returns; else prints the html form.
|
Parameter |
|
mixed |
$table |
|
|
array resulting of form submission |
|
|
string |
$widthcomment |
= >>"60"<< |
|
of comments textarea |
|
Returns |
string the HTML form or "Thanks sidebox. |
See Also |
Poll::add_poll() |
|
show_poll |
public string show_poll( )
|
|
Shows a poll with form to vote
|
Returns |
string the sidebox with the form. |
|
update_poll |
public string update_poll( integer $answer, integer $id )
|
|
Take a vote into account.
|
Parameter |
|
integer |
$answer |
|
|
answer the user selected |
|
|
|
Returns |
string HTML comments indicating status or error message |
|
show_results |
public string show_results( [ string $id ] )
|
|
Displays the results of a poll
Calls exit if SQL fails
|
Parameter |
|
string |
$id |
= >>"-1"<< |
|
ID of poll, -1 for old polls? |
|
Returns |
string box with poll results |
|
poll_to_moderate |
public string poll_to_moderate( )
|
|
Lists polls to moderate
|
Returns |
string the list |
|
edit_poll |
public string edit_poll( integer $id )
|
|
Moderation form
|
Parameter |
|
integer |
$id |
|
|
ID of the poll |
|
Returns |
string the form |
|
list_polls |
public string list_polls( )
|
|
List all polls for admin
|
Returns |
string the list |
|
mod_poll |
public mixed mod_poll( integer $id, [ integer $status ] )
|
|
Take into accout moderator's choice
Cals exit if user not admin (or is it moderator)?
|
Parameter |
|
|
|
integer |
$status |
= >>0<< |
|
status to set |
|
Returns |
mixed void if success, string HTML comment describing error on failure |
|