Vergleich inc/tasks/promotions.php - 1.6.0 - 1.6.4

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 1Zeile 1
<?php
/**
* MyBB 1.6

<?php
/**
* MyBB 1.6

 * Copyright � 2010 MyBB Group, All Rights Reserved

 * Copyright 2010 MyBB Group, All Rights Reserved

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

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

 * $Id: promotions.php 4941 2010-05-15 18:17:38Z RyanGordon $

 * $Id: promotions.php 5369 2011-02-17 10:55:29Z MattR $

 */

function task_promotions($task)
{
global $mybb, $db, $lang, $cache;


 */

function task_promotions($task)
{
global $mybb, $db, $lang, $cache;


 
	$usergroups = $cache->read("usergroups");

	// Iterate through all our promotions
$query = $db->simple_select("promotions", "*", "enabled = '1'");
while($promotion = $db->fetch_array($query))
{

	// Iterate through all our promotions
$query = $db->simple_select("promotions", "*", "enabled = '1'");
while($promotion = $db->fetch_array($query))
{

 
		// Does the destination usergroup even exist?? If it doesn't and it moves a user to it, the user will get PHP errors.
if(!array_key_exists($promotion['newusergroup'], $usergroups))
{
// Instead of just skipping this promotion, disable it to stop it even being selected when this task is run.
$update = array(
"enabled" => 0
);
$db->update_query("promotions", $update, "pid = '" . intval($promotion['pid']) . "'");
continue;
}


		$and = "";
$sql_where = "";


		$and = "";
$sql_where = "";


Zeile 29Zeile 41
			$and = " AND ";
}


			$and = " AND ";
}


		if(in_array('reputation', $requirements) && intval($promotion['reputations']) >= 0 && !empty($promotion['reputationtype']))

		if(in_array('reputation', $requirements) && !empty($promotion['reputationtype']))

		{
$sql_where .= "{$and}reputation {$promotion['reputationtype']} '{$promotion['reputations']}'";


		{
$sql_where .= "{$and}reputation {$promotion['reputationtype']} '{$promotion['reputations']}'";