poll
[ class tree: poll ] [ index: poll ] [ all elements ]

Class: ipbwi_poll

Source Location: /ipbwi/lib/poll.inc.php

Class Overview

ipbwi
   |
   --ipbwi_poll



Author(s):

  • Matthias Reuter ($LastChangedBy: matthias $)

Version:

  • $LastChangedDate: 2009-08-26 19:19:41 +0200 (Mi, 26 Aug 2009) $

Copyright:

  • 2007-2010 IPBWI development team

Methods


Inherited Constants

Inherited Variables

Inherited Methods

Class: ipbwi

ipbwi::addSystemMessage()
adds a system message
ipbwi::date()
Returns textual/timestamp offsetted date by board and by member offset and DST setting.
ipbwi::getBoardVar()
gets the requested board-var
ipbwi::getLibLang()
gets the language-var from actual requested native language-bit
ipbwi::makeSafe()
filtering html-strings, e.g. for db-queries
ipbwi::printSystemMessages()
prints system messages
ipbwi::properXHTML()
filtering HTML strings
ipbwi::setLang()
Set's current SDK language
ipbwi::sysInfo()
informations about the current IPBWI and PHP installation
ipbwi::__destruct()

Class Details

[line 11]


Tags:

author:  Matthias Reuter ($LastChangedBy: matthias $)
version:  $LastChangedDate: 2009-08-26 19:19:41 +0200 (Mi, 26 Aug 2009) $
copyright:  2007-2010 IPBWI development team
link:  http://ipbwi.com/examples/poll.php
since:  2.0
license:  GNU General Public License


[ Top ]


Class Methods


method create [line 261]

bool create( int $topicID, [ $questions = array()], [array $choices = array()], [string $title = ''], [bool $pollOnly = false], [array $multi = array()], array $question)

Creates a new poll.



Tags:

return:  true on success, otherwise false
author:  Matthias Reuter
since:  2.0
sample:  
  1.  $ipbwi->poll->create(55,array('1' => 'Do you think IPBWI is useful?'),'1' => array('yes''no'),'Your opinion about IPBWI.');
access:  public


Parameters:

int   $topicID   Topic ID of the Poll
array   $question   Questions.
array   $choices   The options to vote for for each question
string   $title   The title of the poll
bool   $pollOnly   Make the topic a poll only
array   $multi   To define questions as multiplechoice, declare an array via poll_multi with question-id as array-key and 1 or 0 as array-value. 1 = multiplechoice/checkbox, 0 = singlechoice/radio-button
   $questions  

[ Top ]

method delete [line 328]

bool delete( int $pollID)

Deletes Topic-Poll



Tags:

return:  true on success, otherwise false
author:  Matthias Reuter
since:  2.0
sample:  
  1.  $ipbwi->poll->delete(55);
access:  public


Parameters:

int   $pollID   ID of the Poll

[ Top ]

method id2topicid [line 115]

int id2topicid( int $pollID)

Returns Topic ID associated with Poll ID.



Tags:

return:  Topic ID associated with Poll ID
author:  Matthias Reuter
since:  2.0
sample:  
  1.  $ipbwi->poll->id2topicid(55);
access:  public


Parameters:

int   $pollID   Poll ID of the Poll

[ Top ]

method info [line 57]

array info( int $topicID)

Returns information on a poll.



Tags:

return:  Poll Information
author:  Matthias Reuter
since:  2.0
sample:  
  1.  $ipbwi->poll->info(55);
access:  public


Parameters:

int   $topicID   Topic ID of the Poll

[ Top ]

method nullVote [line 220]

bool nullVote( int $topicID)

Casts a null vote in a poll.



Tags:

return:  true on success, otherwise false
author:  Matthias Reuter
since:  2.0
sample:  
  1.  $ipbwi->poll->vote(55);
access:  public


Parameters:

int   $topicID   Topic ID of the Poll

[ Top ]

method totalVotes [line 97]

int totalVotes( int $topicID)

Returns total number of votes in a poll.



Tags:

return:  Poll Votes
author:  Matthias Reuter
since:  2.0
sample:  
  1.  $ipbwi->poll->totalVotes(55);
access:  public


Parameters:

int   $topicID   Topic ID of the Poll

[ Top ]

method vote [line 150]

bool vote( int $topicID, [array $optionid = array('1'=>'')], [int $userID = false])

Casts a vote in a poll.



Tags:

return:  true on success, otherwise false
author:  Matthias Reuter
since:  2.0
sample:  
  1.  $ipbwi->poll->vote(55,'1'=>'2');
  2.  $ipbwi->poll->vote(77,'1'=>'3',55);
access:  public


Parameters:

int   $topicID   Topic ID of the Poll
array   $optionid   In format 'question number' => 'option'
int   $userID   If no UserID is specified, the currently logged in user will vote

[ Top ]

method voted [line 35]

mixed voted( int $topicID, [int $memberID = false])

Returns whether a member has voted in the poll in a topic.



Tags:

return:  Poll Vote Date if voted, false otherwise
author:  Matthias Reuter
since:  2.0
sample:  
  1.  $ipbwi->poll->voted(55,77);
access:  public


Parameters:

int   $topicID   Topic ID of the Poll
int   $memberID   If $memberID is ommitted the last known member is used.

[ Top ]


Documentation generated on Sat, 23 Oct 2010 23:36:06 +0200 by phpDocumentor 1.4.3