HEX
Server: Apache/2.4.59 (Debian)
System: Linux skycube.cz 4.19.0-25-amd64 #1 SMP Debian 4.19.289-2 (2023-08-08) x86_64
User: ilya (534)
PHP: 7.3.31-1~deb10u7
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: /var/www/ilya/data/www/kamforum.ru/sources/portal_plugins/poll.php
<?php

/*
+--------------------------------------------------------------------------
|   Invision Power Board v2.1.2
|   =============================================
|   by Matthew Mecham
|   (c) 2001 - 2005 Invision Power Services, Inc.
|   http://www.invisionpower.com
|   =============================================
|   Web: http://www.invisionboard.com
|   Time: Sun, 09 Oct 2005 11:51:26 GMT
|   Release: 1a47e28f0443faa9f14d0c0a45151e54
|   Licence Info: http://www.invisionboard.com/?license
+---------------------------------------------------------------------------
|
|   > 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( "/(\?|&amp;)?(t|showtopic)=(\d+)($|&amp;)/", $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;
 		}
 	}

}

?>