📄 poll.php
字号:
<?php/*+--------------------------------------------------------------------------| Invision Power Board v2.1.5| =============================================| by Matthew Mecham| (c) 2001 - 2005 Invision Power Services, Inc.| | =============================================| Web: | Time: Wed, 01 Mar 2006 19:11:29 GMT| Release: | Licence Info: +---------------------------------------------------------------------------| > $Date: 2005-10-10 14:08:54 +0100 (Mon, 10 Oct 2005) $| > $Revision: 23 $| > $Author: matt $+---------------------------------------------------------------------------|| > PORTAL PLUG IN MODULE: POLL| > Module written by Matt Mecham| > Date started: Tuesday 2nd August 2005 (12:56)+--------------------------------------------------------------------------*//*** Portal Plug In Module** This module shows a poll. That's it.** @package InvisionPowerBoard* @subpackage PortalPlugIn* @author Matt Mecham* @copyright Invision Power Services, Inc.* @version 2.1*//*** Portal Plug In Module** This module shows a poll. Wooo* Each class name MUST be in the format of:* ppi_{file_name_minus_dot_php}** @package InvisionPowerBoard* @subpackage PortalPlugIn* @author Matt Mecham* @copyright Invision Power Services, Inc.* @version 2.1*/class ppi_poll{ /** * IPS Global object * * @var string */ var $ipsclass; /** * Array of portal objects including: * good_forum, bad_forum * * @var array */ var $portal_object = array(); /*-------------------------------------------------------------------------*/ // INIT /*-------------------------------------------------------------------------*/ /** * This function must be available always * Add any set up here, such as loading language and skins, etc * */ function init() { } /*-------------------------------------------------------------------------*/ // MAIN FUNCTION /*-------------------------------------------------------------------------*/ /** * Main function * * @return VOID */ function poll_show_poll() { //----------------------------------------- // INIT //----------------------------------------- $extra = ""; $sql = ""; $check = 0; //----------------------------------------- // Got a poll? //----------------------------------------- if ( ! $this->ipsclass->vars['poll_poll_url'] ) { return; } //----------------------------------------- // Get the topic ID of the entered URL //----------------------------------------- preg_match( "/(\?|&)?(t|showtopic)=(\d+)($|&)/", $this->ipsclass->vars['poll_poll_url'], $match ); $tid = intval(trim($match[3])); if ($tid == "") { return; } //----------------------------------------- // Get topic... //----------------------------------------- require_once( ROOT_PATH.'sources/action_public/topics.php' ); $this->topic = new topics(); $this->topic->ipsclass =& $this->ipsclass; $this->topic->topic_init(); $this->topic->topic = $this->ipsclass->DB->build_and_exec_query( array( 'select' => '*', 'from' => 'topics', 'where' => "tid=".$tid, ) ); $this->topic->forum = $this->ipsclass->forums->forum_by_id[ $this->topic->topic['forum_id'] ]; $this->ipsclass->input['f'] = $this->topic->forum['id']; $this->ipsclass->input['t'] = $tid; if ( $this->topic->topic['poll_state'] ) { $html = $this->topic->parse_poll(); return $this->ipsclass->compiled_templates['skin_portal']->tmpl_poll_wrapper( $html, $tid ); } else { return; } }}?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -