Vergleich polls.php - 1.6.5 - 1.6.9

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * $Id: polls.php 5538 2011-08-08 09:46:13Z PirataNervo $

 * $Id$

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 322Zeile 322
	else
{
// Is our forum closed?

	else
{
// Is our forum closed?

		if ($forum['open'] == 0)

		if($forum['open'] == 0)

		{
// Doesn't look like it is
error($lang->error_closedinvalidforum);
}
}

		{
// Doesn't look like it is
error($lang->error_closedinvalidforum);
}
}


$query = $db->simple_select("forums", "*", "fid='$fid'");
$forum = $db->fetch_array($query);


 

if(!$tid)
{


if(!$tid)
{

Zeile 349Zeile 345
		if($poll['closed'] == 1)
{
$postoptionschecked['closed'] = 'checked="checked"';

		if($poll['closed'] == 1)
{
$postoptionschecked['closed'] = 'checked="checked"';

		}

		}

		
if($poll['multiple'] == 1)
{

		
if($poll['multiple'] == 1)
{

Zeile 393Zeile 389
		if(!$poll['timeout'])
{
$timeout = 0;

		if(!$poll['timeout'])
{
$timeout = 0;

		}
else
{
$timeout = $poll['timeout'];

		}
else
{
$timeout = $poll['timeout'];

		}
}
else

		}
}
else

Zeile 406Zeile 402
			$numoptions = $mybb->settings['maxpolloptions'];
}
elseif($mybb->input['numoptions'] < 2)

			$numoptions = $mybb->settings['maxpolloptions'];
}
elseif($mybb->input['numoptions'] < 2)

		{

		{

			$numoptions = "2";

			$numoptions = "2";

		}

		}

		else

		else

		{

		{

			$numoptions = $mybb->input['numoptions'];
}
$question = htmlspecialchars_uni($mybb->input['question']);

$postoptions = $mybb->input['postoptions'];

			$numoptions = $mybb->input['numoptions'];
}
$question = htmlspecialchars_uni($mybb->input['question']);

$postoptions = $mybb->input['postoptions'];

		if($postoptions['multiple'] == 1)
{

		if($postoptions['multiple'] == 1)
{

			$postoptionschecked['multiple'] = 'checked="checked"';

			$postoptionschecked['multiple'] = 'checked="checked"';

		}


		}


		if($postoptions['public'] == 1)

		if($postoptions['public'] == 1)

		{

		{

			$postoptionschecked['public'] = 'checked="checked"';
}

if($postoptions['closed'] == 1)
{
$postoptionschecked['closed'] = 'checked="checked"';

			$postoptionschecked['public'] = 'checked="checked"';
}

if($postoptions['closed'] == 1)
{
$postoptionschecked['closed'] = 'checked="checked"';

		}

		}


$options = $mybb->input['options'];
$votes = $mybb->input['votes'];


$options = $mybb->input['options'];
$votes = $mybb->input['votes'];

Zeile 440Zeile 436
			$option = $options[$i];
$option = htmlspecialchars_uni($option);
$optionvotes = $votes[$i];

			$option = $options[$i];
$option = htmlspecialchars_uni($option);
$optionvotes = $votes[$i];

			

			

			if(!$optionvotes)
{
$optionvotes = 0;

			if(!$optionvotes)
{
$optionvotes = 0;

Zeile 486Zeile 482
	if(!$forum)
{
error($lang->error_invalidforum);

	if(!$forum)
{
error($lang->error_invalidforum);

	}

	}

	else
{
// Is our forum closed?

	else
{
// Is our forum closed?

		if ($forum['open'] == 0)

		if($forum['open'] == 0)

		{
// Doesn't look like it is
error($lang->error_closedinvalidforum);
}
}

		{
// Doesn't look like it is
error($lang->error_closedinvalidforum);
}
}


$query = $db->simple_select("forums", "*", "fid='".$thread['fid']."'");
$forum = $db->fetch_array($query);

 

if($thread['visible'] == 0 || !$thread['tid'])


if($thread['visible'] == 0 || !$thread['tid'])

	{

	{

		error($lang->error_invalidthread);

		error($lang->error_invalidthread);

	}

	}

	
if(!is_moderator($thread['fid'], "caneditposts"))
{

	
if(!is_moderator($thread['fid'], "caneditposts"))
{

Zeile 511Zeile 504
	}

if($mybb->settings['maxpolloptions'] && $mybb->input['numoptions'] > $mybb->settings['maxpolloptions'])

	}

if($mybb->settings['maxpolloptions'] && $mybb->input['numoptions'] > $mybb->settings['maxpolloptions'])

	{
$numoptions = $mybb->settings['maxpolloptions'];

	{
$numoptions = $mybb->settings['maxpolloptions'];

	}
elseif(!$mybb->input['numoptions'])
{

	}
elseif(!$mybb->input['numoptions'])
{

Zeile 873Zeile 866
	$votesarray = explode("||~|~||", $poll['votes']);
$option = $mybb->input['option'];
$numvotes = $poll['numvotes'];

	$votesarray = explode("||~|~||", $poll['votes']);
$option = $mybb->input['option'];
$numvotes = $poll['numvotes'];

	if($poll['multiple'] == 1)
{
foreach($option as $voteoption => $vote)
{
if($vote == 1 && isset($votesarray[$voteoption-1]))

	if($poll['multiple'] == 1)
{
if(is_array($option))
{
foreach($option as $voteoption => $vote)

			{

			{

				if($votesql)

				if($vote == 1 && isset($votesarray[$voteoption-1]))

				{

				{

					$votesql .= ",";







					if($votesql)
{
$votesql .= ",";
}
$votesql .= "('".$poll['pid']."','".$mybb->user['uid']."','".$db->escape_string($voteoption)."','$now')";
$votesarray[$voteoption-1]++;
$numvotes = $numvotes+1;

				}

				}

				$votesql .= "('".$poll['pid']."','".$mybb->user['uid']."','".$db->escape_string($voteoption)."','$now')";
$votesarray[$voteoption-1]++;
$numvotes = $numvotes+1;

 
			}

			}

		}
}
else
{
if(!isset($votesarray[$option-1]))

		}
}
else
{
if(is_array($option) || !isset($votesarray[$option-1]))

		{
error($lang->error_nopolloptions);
}
$votesql = "('".$poll['pid']."','".$mybb->user['uid']."','".$db->escape_string($option)."','$now')";
$votesarray[$option-1]++;
$numvotes = $numvotes+1;

		{
error($lang->error_nopolloptions);
}
$votesql = "('".$poll['pid']."','".$mybb->user['uid']."','".$db->escape_string($option)."','$now')";
$votesarray[$option-1]++;
$numvotes = $numvotes+1;

 
	}

if(!$votesql)
{
error($lang->error_nopolloptions);

	}

$db->write_query("

	}

$db->write_query("

Zeile 922Zeile 923
	$plugins->run_hooks("polls_vote_process");

$db->update_query("polls", $updatedpoll, "pid='".$poll['pid']."'");

	$plugins->run_hooks("polls_vote_process");

$db->update_query("polls", $updatedpoll, "pid='".$poll['pid']."'");





	$plugins->run_hooks("polls_vote_end");

redirect(get_thread_link($poll['tid']), $lang->redirect_votethanks);

	$plugins->run_hooks("polls_vote_end");

redirect(get_thread_link($poll['tid']), $lang->redirect_votethanks);

Zeile 965Zeile 966
		{
// Doesn't look like it is
error($lang->error_closedinvalidforum);

		{
// Doesn't look like it is
error($lang->error_closedinvalidforum);

		}
}

$poll['timeout'] = $poll['timeout']*60*60*24;



		}
}

$poll['timeout'] = $poll['timeout']*60*60*24;



	$expiretime = $poll['dateline'] + $poll['timeout'];
if($poll['closed'] == 1 || $thread['closed'] == 1 || ($expiretime < TIME_NOW && $poll['timeout']))
{

	$expiretime = $poll['dateline'] + $poll['timeout'];
if($poll['closed'] == 1 || $thread['closed'] == 1 || ($expiretime < TIME_NOW && $poll['timeout']))
{

Zeile 993Zeile 994
		$vote_options = explode(',', $mybb->cookies['pollvotes'][$poll['pid']]);
}
$votecheck = !empty($vote_options);

		$vote_options = explode(',', $mybb->cookies['pollvotes'][$poll['pid']]);
}
$votecheck = !empty($vote_options);

	

	

	if(!$votecheck)
{
error($lang->error_notvoted);

	if(!$votecheck)
{
error($lang->error_notvoted);

Zeile 1061Zeile 1062

redirect(get_thread_link($poll['tid']), $lang->redirect_unvoted);
}


redirect(get_thread_link($poll['tid']), $lang->redirect_unvoted);
}



 
?>

?>