2006-12-02 04:36:16 +00:00
|
|
|
<?php
|
|
|
|
/*
|
2009-11-17 13:48:46 +00:00
|
|
|
* e107 website system
|
|
|
|
*
|
2017-01-01 12:04:29 +00:00
|
|
|
* Copyright (C) 2008-2017 e107 Inc (e107.org)
|
2009-11-17 13:48:46 +00:00
|
|
|
* Released under the terms and conditions of the
|
|
|
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
|
|
|
*
|
|
|
|
*/
|
2006-12-02 04:36:16 +00:00
|
|
|
|
|
|
|
if (!defined('e107_INIT')) { exit; }
|
|
|
|
|
|
|
|
global $e107;
|
|
|
|
|
|
|
|
if(defined("POLLRENDERED"))
|
|
|
|
{
|
|
|
|
// return;
|
|
|
|
}
|
2013-07-15 13:31:49 +02:00
|
|
|
|
|
|
|
if (!e107::isInstalled('poll'))
|
2008-12-11 21:13:48 +00:00
|
|
|
{
|
2016-01-13 19:17:37 -08:00
|
|
|
e107::redirect();
|
2008-12-11 21:13:48 +00:00
|
|
|
}
|
|
|
|
|
2006-12-02 04:36:16 +00:00
|
|
|
if(!defined("POLLCLASS"))
|
|
|
|
{
|
|
|
|
require(e_PLUGIN."poll/poll_class.php");
|
|
|
|
}
|
|
|
|
if(!isset($poll) || !is_object($poll))
|
|
|
|
{
|
|
|
|
$poll = new poll;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!defined("POLL_1"))
|
|
|
|
{
|
|
|
|
/* if menu is being called from comments, lan files have to be included manually ... */
|
2009-08-15 11:55:30 +00:00
|
|
|
include_lan(e_PLUGIN."poll/languages/".e_LANGUAGE.".php");
|
2006-12-02 04:36:16 +00:00
|
|
|
}
|
|
|
|
|
2008-06-03 21:31:31 +00:00
|
|
|
if (empty($poll_to_show))
|
|
|
|
{
|
|
|
|
$poll_to_show = ' AND p.`poll_vote_userclass`!=255';
|
|
|
|
$pollType = 'menu';
|
|
|
|
$pollMode = 'query';
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$poll_to_show = ' AND p.`poll_id`='.$poll_to_show;
|
|
|
|
$pollType = 'menu';
|
|
|
|
$pollMode = 'results';
|
|
|
|
}
|
|
|
|
|
2006-12-02 04:36:16 +00:00
|
|
|
$query = "SELECT p.*, u.user_name FROM #polls AS p
|
|
|
|
LEFT JOIN #user AS u ON p.poll_admin_id = u.user_id
|
2008-06-03 21:31:31 +00:00
|
|
|
WHERE p.poll_type=1{$poll_to_show}
|
2006-12-02 04:36:16 +00:00
|
|
|
ORDER BY p.poll_datestamp DESC LIMIT 0,1
|
|
|
|
";
|
|
|
|
|
2010-07-19 09:23:25 +00:00
|
|
|
$poll->remove_poll_cookies();
|
2006-12-02 04:36:16 +00:00
|
|
|
|
2010-07-19 09:23:25 +00:00
|
|
|
$poll->render_poll($query, $pollType, $pollMode);
|
2017-01-01 12:04:29 +00:00
|
|
|
|
|
|
|
?>
|