/sources/polls.php

Description
Functions
add_poll (line 261)

Add a new poll to the database, then return the ID of the new entry.

  • return: The poll ID of our new poll
AUTO_LINK add_poll (SHORT_TEXT $question, SHORT_TEXT $a1, SHORT_TEXT $a2, SHORT_TEXT $a3, SHORT_TEXT $a4, SHORT_TEXT $a5, SHORT_TEXT $a6, SHORT_TEXT $a7, SHORT_TEXT $a8, SHORT_TEXT $a9, SHORT_TEXT $a10, integer $num_options, BINARY $current, BINARY $allow_rating, SHORT_INTEGER $allow_comments, BINARY $allow_trackbacks, LONG_TEXT $notes, [?TIME $time = NULL], [?MEMBER $submitter = NULL], [?TIME $use_time = NULL], [integer $v1 = 0], [integer $v2 = 0], [integer $v3 = 0], [integer $v4 = 0], [integer $v5 = 0], [integer $v6 = 0], [integer $v7 = 0], [integer $v8 = 0], [integer $v9 = 0], [integer $v10 = 0], [integer $views = 0], [?TIME $edit_date = NULL])
  • SHORT_TEXT $question: The question
  • SHORT_TEXT $a1: The first choice
  • SHORT_TEXT $a2: The second choice
  • SHORT_TEXT $a3: The third choice (blank means not a choice)
  • SHORT_TEXT $a4: The fourth choice (blank means not a choice)
  • SHORT_TEXT $a5: The fifth choice (blank means not a choice)
  • SHORT_TEXT $a6: The sixth choice (blank means not a choice)
  • SHORT_TEXT $a7: The seventh choice (blank means not a choice)
  • SHORT_TEXT $a8: The eighth choice (blank means not a choice)
  • SHORT_TEXT $a9: The ninth choice (blank means not a choice)
  • SHORT_TEXT $a10: The tenth choice (blank means not a choice)
  • integer $num_options: The number of choices
  • BINARY $current: Whether the poll is the current poll
  • BINARY $allow_rating: Whether to allow rating of this poll
  • SHORT_INTEGER $allow_comments: Whether comments are allowed (0=no, 1=yes, 2=review style)
  • BINARY $allow_trackbacks: Whether to allow trackbacking on this poll
  • LONG_TEXT $notes: Notes about this poll
  • ?TIME $time: The time the poll was submitted (NULL: now)
  • ?MEMBER $submitter: The member who submitted (NULL: the current member)
  • ?TIME $use_time: The time the poll was put to use (NULL: not put to use yet)
  • integer $v1: How many have voted for option 1
  • integer $v2: How many have voted for option 2
  • integer $v3: How many have voted for option 3
  • integer $v4: How many have voted for option 4
  • integer $v5: How many have voted for option 5
  • integer $v6: How many have voted for option 6
  • integer $v7: How many have voted for option 7
  • integer $v8: How many have voted for option 8
  • integer $v9: How many have voted for option 9
  • integer $v10: How many have voted for option 10
  • integer $views: The number of views had
  • ?TIME $edit_date: The edit date (NULL: never)
delete_poll (line 333)

Delete a poll.

void delete_poll (AUTO_LINK $id)
  • AUTO_LINK $id: The ID of the poll to delete
edit_poll (line 302)

Edit a poll.

void edit_poll (AUTO_LINK $id, SHORT_TEXT $question, SHORT_TEXT $a1, SHORT_TEXT $a2, SHORT_TEXT $a3, SHORT_TEXT $a4, SHORT_TEXT $a5, SHORT_TEXT $a6, SHORT_TEXT $a7, SHORT_TEXT $a8, SHORT_TEXT $a9, SHORT_TEXT $a10, integer $num_options, BINARY $allow_rating, SHORT_INTEGER $allow_comments, BINARY $allow_trackbacks, LONG_TEXT $notes)
  • AUTO_LINK $id: The ID of the poll to edit
  • SHORT_TEXT $question: The question
  • SHORT_TEXT $a1: The first choice
  • SHORT_TEXT $a2: The second choice
  • SHORT_TEXT $a3: The third choice (blank means not a choice)
  • SHORT_TEXT $a4: The fourth choice (blank means not a choice)
  • SHORT_TEXT $a5: The fifth choice (blank means not a choice)
  • SHORT_TEXT $a6: The sixth choice (blank means not a choice)
  • SHORT_TEXT $a7: The seventh choice (blank means not a choice)
  • SHORT_TEXT $a8: The eighth choice (blank means not a choice)
  • SHORT_TEXT $a9: The ninth choice (blank means not a choice)
  • SHORT_TEXT $a10: The tenth choice (blank means not a choice)
  • integer $num_options: The number of choices
  • BINARY $allow_rating: Whether to allow rating of this poll
  • SHORT_INTEGER $allow_comments: Whether comments are allowed (0=no, 1=yes, 2=review style)
  • BINARY $allow_trackbacks: Whether to allow trackbacking on this poll
  • LONG_TEXT $notes: Notes about this poll
may_vote_in_poll (line 124)

Find whether the current member may vote.

  • return: Whether the current member may vote
boolean may_vote_in_poll (array $myrow)
  • array $myrow: The poll row
nice_get_polls (line 390)

Get a list of polls.

  • return: The list
tempcode nice_get_polls ([?AUTO_LINK $it = NULL], [?MEMBER $only_owned = NULL])
  • ?AUTO_LINK $it: The ID of the poll to select by default (NULL: first)
  • ?MEMBER $only_owned: Only show polls owned by this member (NULL: no such restriction)
poll_script (line 28)

Show poll block.

  • return: Output (NULL: outputted it already)
?object poll_script ([boolean $ret = false], [?AUTO_LINK $param = NULL])
  • boolean $ret: Whether to get the output instead of outputting it directly
  • ?AUTO_LINK $param: Poll ID (NULL: read from environment)
set_poll (line 359)

Set the poll.

void set_poll (AUTO_LINK $id)
  • AUTO_LINK $id: The poll ID to set
show_poll (line 139)

Show an actual poll block.

  • return: The block
tempcode show_poll (boolean $results, array $myrow, ID_TEXT $zone)
  • boolean $results: Whether to show results (if we've already voted, this'll be overrided)
  • array $myrow: The poll row
  • ID_TEXT $zone: The zone our poll module is in

Documentation generated on Sun, 02 Jan 2011 23:22:42 +0000 by phpDocumentor 1.4.3