Class tgcSimplePoll

Description

tgcSimplePoll is a class to create a voting booth With tgcSimplePoll you can easily include one or more surveys on your website.

tgcSimplePoll is a class to create a voting booth With tgcSimplePoll you can easily include one or more surveys on your website. You can manage your polls in an admin-area which is password protected. Changing the layout is pretty easy, as tgcSimplePoll uses a template-engine (patTemplate from <http://www.php-tools.de>). Some skins already ship with the original download package.

Located in /tgcSimplePoll.php (line 89)

tgcSimplePoll_common
   |
   --tgcSimplePoll
Method Summary
 tgcSimplePoll tgcSimplePoll (string $name, [array $settings = array()])
 string getResultPage (mixed $qId, int $questionId)
 array getValidPollIDs ()
 string run ([int $qId = null])
Methods
Constructor tgcSimplePoll (line 180)

Constructor Initializes the poll, as the constructor may start a session to prevent spamming (depending on ypur settings) you have to call it before any header has been sent This parameter is an associative array containing the settings you desire.

Constructor Initializes the poll, as the constructor may start a session to prevent spamming (depending on ypur settings) you have to call it before any header has been sent This parameter is an associative array containing the settings you desire. If you don't want to build an own skin set "skin" to "tg/default" or sth else that already exists.

 Following keys are currently possible:

   'language'      => the language file, that shall be used - default language is English
   'delay'         => the time in minutes the same ip/host combination cannot answer the same question again (type: integer | default: 30)
   'skin'          => skin-name as string (if no skin is specified the default-skin will be used)
   'verbose'       => set this true to allow errormessages, else false (type: boolean | default: false)
   'intelligent'   => set this true, if you want the script to display a resultpage after a vote has been casted, otherwise set it to false (a new votePage will be displayed) (type: boolean | default: true)
   'useSessions'   => set it true to use sessions to avoid flooding, otherwise set it false (type: boolean | default: false)
 

  • access: public
tgcSimplePoll tgcSimplePoll (string $name, [array $settings = array()])
  • string $name: poll-id
  • array $settings: settings
getResultPage (line 575)

Returns the html-markup for a certain resultpage

Returns the html-markup for a certain resultpage

  • return: html markup for the resultpage
  • access: public
string getResultPage (mixed $qId, int $questionId)
  • int $questionId: question-id
getValidPollIDs (line 491)

Determines all valid poll-ids

Determines all valid poll-ids

  • return: question-ids on success, otherwise a PEAR_Error object
  • throws: object PEAR_Error
  • access: public
array getValidPollIDs ()
run (line 253)

Starts a poll Use this function to start the poll and let it choose a random question.

Starts a poll Use this function to start the poll and let it choose a random question. If you call the function with a param, it will be taken as question-id and the markup for the appropriate votepage will be returned

  • return: string, containing the markup-code for the poll, PEAR_Error on errors
  • see: getValidPollIDs();
  • throws: object PEAR_Error
  • access: public
string run ([int $qId = null])
  • int $qId: question-id

Documentation generated on Fri, 19 Nov 2004 23:51:48 +0100 by phpDocumentor 1.2.3