Procedural File: functions.inc
Source Location: /plugins/polls/functions.inc
Page Details:
Implementation of the Plugin API for the Polls plugin
Includes:
require_once($langfile) [line 54]
Language file include
require_once($plugin_path.'language/english.php') [line 56]
require_once($_CONF['path_system'].'classes/config.class.php') [line 63]
Check and see if we need to load the plugin configuration
phpblock_polls [line 961]
Display the current poll(s) in a side block
Tags:
plugin_autotags_polls [line 1461]
void plugin_autotags_polls(
$op, [ $content = ''], [ $autotag = ''])
|
|
Poll Autotags [poll: pid] - Displays a link to a poll using the Poll Topic as the title. A alternate title may be specified. [poll_vote: pid pid class:poll-autotag showall:1] - Class and showall not required. Class specifies the css class and Showall if set to 1, shows all questions [poll_result: pid class:poll-autotag] - Class not required. Class specifies the css class
Parameters
plugin_autouninstall_polls [line 395]
array plugin_autouninstall_polls(
)
|
|
Automatic uninstall function for plugins
Tags:
plugin_cclabel_polls [line 278]
void plugin_cclabel_polls(
)
|
|
This will put an option for polls in the command and control block on moderation.php
plugin_chkVersion_polls [line 355]
void plugin_chkVersion_polls(
)
|
|
Return the current version of code. Used in the Plugin Editor to show the registered version and code version
plugin_deletecomment_polls [line 140]
mixed plugin_deletecomment_polls(
int $cid, string $id)
|
|
polls: delete a comment
Tags:
Parameters
| int |
$cid |
Comment to be deleted |
| string |
$id |
Item id to which $cid belongs |
plugin_displaycomment_polls [line 991]
mixed plugin_displaycomment_polls(
string $id, int $cid, string $title, string $order, string $format, int $page, boolean $view)
|
|
Plugin should display [a] comment[s]
Tags:
Parameters
| string |
$id |
Unique idenifier for item comment belongs to |
| int |
$cid |
Comment id to display (possibly including sub-comments) |
| string |
$title |
Page/comment title |
| string |
$order |
'ASC' or 'DESC' or blank |
| string |
$format |
'threaded', 'nested', or 'flat' |
| int |
$page |
Page number of comments to display |
| boolean |
$view |
True to view comment (by cid), false to display (by $pid) |
plugin_enablestatechange_polls [line 373]
void plugin_enablestatechange_polls(
boolean $enable)
|
|
Geeklog informs us that we're about to be enabled or disabled
Parameters
| boolean |
$enable |
true = we're being enabled, false = disabled |
plugin_getadminoption_polls [line 296]
void plugin_getadminoption_polls(
)
|
|
returns the administrative option for this plugin
plugin_getcommenturlid_polls [line 1442]
array plugin_getcommenturlid_polls(
)
|
|
Provide URL and ID for the link to a comment's parent
Tags:
plugin_getconfigtooltip_polls [line 1430]
mixed plugin_getconfigtooltip_polls(
string $id)
|
|
Provides text for a Configuration tooltip
Tags:
Parameters
| string |
$id |
Id of config value |
plugin_getdocumentationurl_polls [line 1391]
mixed plugin_getdocumentationurl_polls(
string $file)
|
|
Provide URL of a documentation file
Tags:
Parameters
| string |
$file |
documentation file being requested, e.g. 'config' |
plugin_getheadercode_polls [line 1112]
void plugin_getheadercode_polls(
)
|
|
plugin_geticon_polls [line 973]
string plugin_geticon_polls(
)
|
|
Returns the URL of the plugin's icon
Tags:
plugin_getiteminfo_polls [line 1252]
mixed plugin_getiteminfo_polls(
string $pid, string $what, [int $uid = 0], [array $options = array()])
|
|
Return information for a poll
Tags:
Parameters
| string |
$pid |
poll ID or '*' |
| string |
$what |
comma-separated list of properties |
| int |
$uid |
user ID or 0 = current user |
| array |
$options |
(reserved for future extensions) |
plugin_getListField_polls [line 1024]
void plugin_getListField_polls(
$fieldname, $fieldvalue, $A, $icon_arr)
|
|
Parameters
| |
$fieldname |
|
| |
$fieldvalue |
|
| |
$A |
|
| |
$icon_arr |
|
plugin_getmenuitems_polls [line 81]
void plugin_getmenuitems_polls(
)
|
|
Returns the items for this plugin that should appear on the main menu NOTE: this MUST return the url/value pairs in the following format $<arrayname>[<label>] = <url>
plugin_getwhatsnewcomment_polls [line 1661]
array plugin_getwhatsnewcomment_polls(
[string $numreturn = 0], [string $uid = 0])
|
|
Return new Polls comments for the What's New block
Tags:
Parameters
| string |
$numreturn |
If 0 will return results for What's New Block. If > 0 will return last X new comments for User Profile. |
| string |
$uid |
ID of the user to return results for. 0 = all users. |
plugin_getwhatsnew_polls [line 1584]
string plugin_getwhatsnew_polls(
)
|
|
Return new Polls for the What's New block
Tags:
plugin_migrate_polls [line 1225]
void plugin_migrate_polls(
array $old_conf, boolean 1)
|
|
Called during site migration - handle changed URLs or paths
Parameters
| array |
$old_conf |
contents of the $_CONF array on the old site |
| boolean |
1 |
true on success, otherwise false |
plugin_savecomment_polls [line 107]
mixed plugin_savecomment_polls(
string $title, string $comment, string $id, int $pid, string $postmode, string $type)
|
|
Poll saves a comment
Tags:
Parameters
| string |
$type |
Plugin to save comment |
| string |
$title |
comment title |
| string |
$comment |
comment text |
| string |
$id |
Item id to which $cid belongs |
| int |
$pid |
comment parent |
| string |
$postmode |
'html' or 'text' |
plugin_showstats_polls [line 209]
void plugin_showstats_polls(
int $showsitestats)
|
|
Shows the statistics for the Polls plugin on stats.php. If $showsitestats is 1 then we are to only print the overall stats in the 'site statistics box' otherwise we show the detailed stats
Parameters
| int |
$showsitestats |
showsitestate Flag to let us know which stats to get |
plugin_statssummary_polls [line 260]
array(item plugin_statssummary_polls(
)
|
|
New stats plugin API function for proper integration with the site stats
Tags:
plugin_templatesetvars_polls [line 1103]
void plugin_templatesetvars_polls(
string $templatename, &$template, ref $template)
|
|
Set template variables
Tags:
Parameters
| string |
$templatename |
name of template, e.g. 'header' |
| ref |
$template |
reference of actual template |
| |
&$template |
|
plugin_upgrade_polls [line 1129]
int plugin_upgrade_polls(
)
|
|
Update the Polls plugin
Tags:
plugin_user_delete_polls [line 319]
void plugin_user_delete_polls(
uid $uid)
|
|
A user is about to be deleted. Update ownership of any polls owned by that user or delete them.
Parameters
| uid |
$uid |
int User id of deleted user |
plugin_whatsnewsupported_polls [line 1562]
mixed plugin_whatsnewsupported_polls(
)
|
|
Return headlines for New Polls section in the What's New block, if enabled
Tags:
POLLS_countPollsAndVotes [line 172]
array(number POLLS_countPollsAndVotes(
)
|
|
Helper function: count number of polls and total number of votes
Tags:
POLLS_ipAlreadyVoted [line 936]
boolean POLLS_ipAlreadyVoted(
string $pid, [string $ip = ''])
|
|
Check if we already have a vote from this IP address
Tags:
Parameters
| string |
$pid |
Poll ID |
| string |
$ip |
(optional) IP address |
POLLS_pollResults [line 757]
string POLLS_pollResults(
string $pid, [int $scale = 400], [string $order = ''], [string $mode = ''], [ $page = 1], [int $displaytype = 0])
|
|
Shows the results of a poll Shows the poll results for a given poll topic
Tags:
Parameters
| string |
$pid |
ID for poll topic to show |
| int |
$scale |
Size in pixels to scale formatted results to |
| string |
$order |
'ASC' or 'DESC' for Comment ordering (SQL statment ordering) |
| string |
$mode |
Comment Mode possible values 'nocomment', 'flat', 'nested', 'threaded' |
| int |
$displaytype |
Possible values 0 = Normal, 1 = In Block, 2 = autotag |
| |
$page |
|
POLLS_pollsave [line 704]
string POLLS_pollsave(
string $pid, array $aid)
|
|
Saves a user's vote Saves the users vote, if allowed for the poll $pid. NOTE: all data comes from form post
Tags:
Parameters
| string |
$pid |
poll id |
| array |
$aid |
selected answers |
POLLS_pollVote [line 459]
string POLLS_pollVote(
string $pid, [boolean $showall = true], [int $displaytype = 0], [ $order = ''], [ $mode = ''], [ $page = 1])
|
|
Shows a poll form Shows an HTML formatted poll for the given topic ID
Tags:
Parameters
| string |
$pid |
ID for poll topic |
| boolean |
$showall |
Show only the first question in the poll or all? |
| int |
$displaytype |
Possible values 0 = Normal, 1 = In Block, 2 = autotag |
| |
$order |
|
| |
$mode |
|
| |
$page |
|
POLLS_showPoll [line 633]
string POLLS_showPoll(
int $size, [string $pid = ''], [boolean $showall = false], [int $displaytype = 0])
|
|
This shows a poll This will determine if a user needs to see the poll form OR the poll result.
Tags:
Parameters
| int |
$size |
Size in pixels of poll results |
| string |
$pid |
Poll topic ID to show (optional) |
| boolean |
$showall |
Show only the first question or all |
| int |
$displaytype |
Possible values 0 = Normal, 1 = In Block, 2 = autotag |
polls_templatePath [line 423]
string polls_templatePath(
[string $path = ''])
|
|
Get path for the template files.
Tags:
Parameters
| string |
$path |
subdirectory within the base template path |
|