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

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]

string phpblock_polls( )

Display the current poll(s) in a side block



Tags:

return:  HTML for the poll(s) to be displayed (or an empty string)


[ Top ]



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

   $op  
   $content  
   $autotag  
[ Top ]



plugin_autouninstall_polls [line 395]

array plugin_autouninstall_polls( )

Automatic uninstall function for plugins



Tags:

return:  This code is automatically uninstalling the plugin. It passes an array to the core code function that removes tables, groups, features and php blocks from the tables. Additionally, this code can perform special actions that cannot be foreseen by the core code (interactions with other plugins for example)


[ Top ]



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




[ Top ]



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




[ Top ]



plugin_deletecomment_polls [line 140]

mixed plugin_deletecomment_polls( int $cid, string $id)

polls: delete a comment



Tags:

return:  false for failure, HTML string (redirect?) for success


Parameters

int   $cid   Comment to be deleted
string   $id   Item id to which $cid belongs
[ Top ]



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:

return:  results of calling the plugin_displaycomment_ function


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)
[ Top ]



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
[ Top ]



plugin_getadminoption_polls [line 296]

void plugin_getadminoption_polls( )

returns the administrative option for this plugin



[ Top ]



plugin_getcommenturlid_polls [line 1442]

array plugin_getcommenturlid_polls( )

Provide URL and ID for the link to a comment's parent



Tags:

return:  array consisting of the base URL and the ID name


[ Top ]



plugin_getconfigtooltip_polls [line 1430]

mixed plugin_getconfigtooltip_polls( string $id)

Provides text for a Configuration tooltip



Tags:

return:  Text to use regular tooltip, NULL to use config tooltip hack, or empty string when not available


Parameters

string   $id   Id of config value
[ Top ]



plugin_getdocumentationurl_polls [line 1391]

mixed plugin_getdocumentationurl_polls( string $file)

Provide URL of a documentation file



Tags:

return:  URL or false when not available


Parameters

string   $file   documentation file being requested, e.g. 'config'
[ Top ]



plugin_getheadercode_polls [line 1112]

void plugin_getheadercode_polls( )



[ Top ]



plugin_geticon_polls [line 973]

string plugin_geticon_polls( )

Returns the URL of the plugin's icon



Tags:

return:  URL of the icon


[ Top ]



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:

return:  string or array of strings with the information


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)
[ Top ]



plugin_getListField_polls [line 1024]

void plugin_getListField_polls( $fieldname, $fieldvalue, $A, $icon_arr)



Parameters

   $fieldname  
   $fieldvalue  
   $A  
   $icon_arr  
[ Top ]



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>




[ Top ]



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:

return:  list of new comments (dups, type, title, sid, lastdate) or (sid, title, cid, unixdate)


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.
[ Top ]



plugin_getwhatsnew_polls [line 1584]

string plugin_getwhatsnew_polls( )

Return new Polls for the What's New block



Tags:

return:  HTML list of new staticpages


[ Top ]



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
[ Top ]



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:

return:  false for failure, HTML string (redirect?) for success


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'
[ Top ]



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
[ Top ]



plugin_statssummary_polls [line 260]

array(item plugin_statssummary_polls( )

New stats plugin API function for proper integration with the site stats



Tags:

return:  text, item count);


[ Top ]



plugin_templatesetvars_polls [line 1103]

void plugin_templatesetvars_polls( string $templatename, &$template, ref $template)

Set template variables



Tags:

return:  Note: A plugin should use its name as a prefix for the names of its template variables, e.g. 'polls_xxx' and 'lang_polls_xxx'. 'button_polls' is an exception, as such a variable existed for header.thtml in Geeklog 1.3.11 and earlier, where the Polls were an integral part of Geeklog. It is added here for backward-compatibility.


Parameters

string   $templatename   name of template, e.g. 'header'
ref   $template   reference of actual template
   &$template  
[ Top ]



plugin_upgrade_polls [line 1129]

int plugin_upgrade_polls( )

Update the Polls plugin



Tags:

return:  Number of message to display (true = generic success msg)


[ Top ]



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
[ Top ]



plugin_whatsnewsupported_polls [line 1562]

mixed plugin_whatsnewsupported_polls( )

Return headlines for New Polls section in the What's New block, if enabled



Tags:

return:  array(headline, byline), or boolean false if disabled


[ Top ]



POLLS_countPollsAndVotes [line 172]

array(number POLLS_countPollsAndVotes( )

Helper function: count number of polls and total number of votes



Tags:

return:  of polls, number of votes);


[ Top ]



POLLS_ipAlreadyVoted [line 936]

boolean POLLS_ipAlreadyVoted( string $pid, [string $ip = ''])

Check if we already have a vote from this IP address



Tags:

return:  true: IP already voted; false: didn't


Parameters

string   $pid   Poll ID
string   $ip   (optional) IP address
[ Top ]



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:

return:  HTML Formated Poll Results
see:  POLLS_showPoll()
see:  POLLS_pollVote()


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  
[ Top ]



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:

return:  HTML for poll results


Parameters

string   $pid   poll id
array   $aid   selected answers
[ Top ]



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:

return:  HTML Formatted Poll
see:  function COM_showPoll
see:  function COM_pollResults


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  
[ Top ]



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:

return:  HTML formatted string of poll
see:  function COM_pollResults
see:  function COM_pollVote


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
[ Top ]



polls_templatePath [line 423]

string polls_templatePath( [string $path = ''])

Get path for the template files.



Tags:

return:  full path to template directory


Parameters

string   $path   subdirectory within the base template path
[ Top ]



Documentation generated on Sat, 11 Feb 2012 02:07:38 -0500 by phpDocumentor 1.4.3