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

Class: poll

Source Location: /lib/poll.inc.php

Class poll

Class Overview

Located in /lib/poll.inc.php [line 11]

ipbwi
   |
   --poll
Author(s):
  • Matthias Reuter ($LastChangedBy: matthias $)
Information Tags:
Version:  $LastChangedDate: 2009-01-21 23:25:02 +0000 (Mi, 21 Jan 2009) $
Copyright:  2007-2008 IPBWI development team
Link:  http://ipbwi.com/examples/poll.php
Since:  2.0
License:  GNU General Public License

Methods

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From ipbwi

ipbwi::$DB
ipbwi::$ips

Inherited From 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::info()
informations about the current IPBWI and PHP installation
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::updateSession()
Update Member Session Informations

Inherited From ipbwi

ipbwi::DEV_TEAM
ipbwi::PROJECT_LEADER
ipbwi::TITLE
ipbwi::VERSION
ipbwi::WEBSITE

[ Top ]
Method Summary
bool   create()   Creates a new poll.
bool   delete()   Deletes Topic-Poll
int   id2topicid()   Returns Topic ID associated with Poll ID.
array   info()   Returns information on a poll.
bool   nullVote()   Casts a null vote in a poll.
int   totalVotes()   Returns total number of votes in a poll.
bool   vote()   Casts a vote in a poll.
mixed   voted()   Returns whether a member has voted in the poll in a topic.

[ Top ]
Methods
create  [line 275]

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

Creates a new poll.

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: 

API Tags:
Return:  true on success, otherwise false
Access:  public

Information Tags:
Author:  Cow <khlo@global-centre.com>
Author:  Matthias Reuter
Author:  Pita <peter@randomnity.com>
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.');

[ Top ]
delete  [line 342]

  bool delete( int $pollID  )

Deletes Topic-Poll

Parameters:
int   $pollID:  ID of the Poll

API Tags:
Return:  true on success, otherwise false
Access:  public

Information Tags:
Author:  Matthias Reuter
Since:  2.0
Sample:  
  1.  $ipbwi->poll->delete(55);

[ Top ]
id2topicid  [line 123]

  int id2topicid( int $pollID  )

Returns Topic ID associated with Poll ID.

Parameters:
int   $pollID:  Poll ID of the Poll

API Tags:
Return:  Topic ID associated with Poll ID
Access:  public

Information Tags:
Author:  Cow <khlo@global-centre.com>
Author:  Matthias Reuter
Author:  Pita <peter@randomnity.com>
Since:  2.0
Sample:  
  1.  $ipbwi->poll->id2topicid(55);

[ Top ]
info  [line 61]

  array info( int $topicID  )

Returns information on a poll.

Parameters:
int   $topicID:  Topic ID of the Poll

API Tags:
Return:  Poll Information
Access:  public

Information Tags:
Author:  Cow <khlo@global-centre.com>
Author:  Matthias Reuter
Author:  Pita <peter@randomnity.com>
Since:  2.0
Sample:  
  1.  $ipbwi->poll->info(55);

Redefinition of:
ipbwi::info()
informations about the current IPBWI and PHP installation

[ Top ]
nullVote  [line 232]

  bool nullVote( int $topicID  )

Casts a null vote in a poll.

Parameters:
int   $topicID:  Topic ID of the Poll

API Tags:
Return:  true on success, otherwise false
Access:  public

Information Tags:
Author:  Cow <khlo@global-centre.com>
Author:  Matthias Reuter
Author:  Pita <peter@randomnity.com>
Since:  2.0
Sample:  
  1.  $ipbwi->poll->vote(55);

[ Top ]
totalVotes  [line 103]

  int totalVotes( int $topicID  )

Returns total number of votes in a poll.

Parameters:
int   $topicID:  Topic ID of the Poll

API Tags:
Return:  Poll Votes
Access:  public

Information Tags:
Author:  Cow <khlo@global-centre.com>
Author:  Matthias Reuter
Author:  Pita <peter@randomnity.com>
Since:  2.0
Sample:  
  1.  $ipbwi->poll->totalVotes(55);

[ Top ]
vote  [line 160]

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

Casts a vote in a poll.

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

API Tags:
Return:  true on success, otherwise false
Access:  public

Information Tags:
Author:  Cow <khlo@global-centre.com>
Author:  Matthias Reuter
Author:  Pita <peter@randomnity.com>
Since:  2.0
Sample:  
  1.  $ipbwi->poll->vote(55,'1'=>'2');
  2.  $ipbwi->poll->vote(77,'1'=>'3',55);

[ Top ]
voted  [line 37]

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

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

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

API Tags:
Return:  Poll Vote Date if voted, false otherwise
Access:  public

Information Tags:
Author:  Cow <khlo@global-centre.com>
Author:  Matthias Reuter
Author:  Pita <peter@randomnity.com>
Since:  2.0
Sample:  
  1.  $ipbwi->poll->voted(55,77);

[ Top ]

Documentation generated on Mon, 02 Mar 2009 23:51:04 +0100 by phpDocumentor 1.4.0