Vergleich inc/class_datacache.php - 1.8.7 - 1.8.13

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 466Zeile 466

$types = array();



$types = array();


		$query = $db->simple_select("attachtypes", "*");

		$query = $db->simple_select('attachtypes', '*', 'enabled=1');

		while($type = $db->fetch_array($query))
{
$type['extension'] = my_strtolower($type['extension']);

		while($type = $db->fetch_array($query))
{
$type['extension'] = my_strtolower($type['extension']);

Zeile 670Zeile 670
			SELECT u.uid, u.username, COUNT(pid) AS poststoday
FROM '.TABLE_PREFIX.'posts p
LEFT JOIN '.TABLE_PREFIX.'users u ON (p.uid=u.uid)

			SELECT u.uid, u.username, COUNT(pid) AS poststoday
FROM '.TABLE_PREFIX.'posts p
LEFT JOIN '.TABLE_PREFIX.'users u ON (p.uid=u.uid)

			WHERE p.dateline>'.$timesearch.'

			WHERE p.dateline>'.$timesearch.' AND p.visible=1

			GROUP BY '.$group_by.' ORDER BY poststoday DESC
LIMIT 1
');

			GROUP BY '.$group_by.' ORDER BY poststoday DESC
LIMIT 1
');

Zeile 787Zeile 787

$data = array(
'users' => $awaitingusers,


$data = array(
'users' => $awaitingusers,

			'time'	=> TIME_NOW 

			'time'	=> TIME_NOW

		);

$this->update('awaitingactivation', $data);

		);

$this->update('awaitingactivation', $data);

Zeile 808Zeile 808
			{
foreach($main as $forum)
{

			{
foreach($main as $forum)
{

					$forum_mods = '';

					$forum_mods = array();

					if(count($moderators))
{
$forum_mods = $moderators;

					if(count($moderators))
{
$forum_mods = $moderators;

Zeile 895Zeile 895

$query = $db->simple_select("reportedcontent", "dateline", "reportstatus='0'", array('order_by' => 'dateline', 'order_dir' => 'DESC'));
$latest = $db->fetch_array($query);


$query = $db->simple_select("reportedcontent", "dateline", "reportstatus='0'", array('order_by' => 'dateline', 'order_dir' => 'DESC'));
$latest = $db->fetch_array($query);


$reasons = array();

if(!empty($mybb->settings['reportreasons']))
{
$options = $mybb->settings['reportreasons'];
$options = explode("\n", $options);

foreach($options as $option)
{
$option = explode("=", $option);
$reasons[$option[0]] = $option[1];
}
}

 

$reports = array(
"unread" => $num['unreadcount'],
"total" => $total['reportcount'],


$reports = array(
"unread" => $num['unreadcount'],
"total" => $total['reportcount'],

			"lastdateline" => $latest['dateline'],
"reasons" => $reasons

			"lastdateline" => $latest['dateline']


		);

		);





		$this->update("reportedcontent", $reports);

		$this->update("reportedcontent", $reports);

	}

/**

	}

/**

	 * Update mycode cache.
*
*/

	 * Update mycode cache.
*
*/

Zeile 945Zeile 930
	 * @param int $lock_time
*/
function update_mailqueue($last_run=0, $lock_time=0)

	 * @param int $lock_time
*/
function update_mailqueue($last_run=0, $lock_time=0)

	{

	{

		global $db;

$query = $db->simple_select("mailqueue", "COUNT(*) AS queue_size");

		global $db;

$query = $db->simple_select("mailqueue", "COUNT(*) AS queue_size");

Zeile 1066Zeile 1051
	}

function update_most_replied_threads()

	}

function update_most_replied_threads()

	{
global $db, $mybb;

$threads = array();

$query = $db->simple_select("threads", "tid, subject, replies, fid", "visible='1'", array('order_by' => 'replies', 'order_dir' => 'DESC', 'limit_start' => 0, 'limit' => $mybb->settings['statslimit']));

	{
global $db, $mybb;

$threads = array();

$query = $db->simple_select("threads", "tid, subject, replies, fid, uid", "visible='1'", array('order_by' => 'replies', 'order_dir' => 'DESC', 'limit_start' => 0, 'limit' => $mybb->settings['statslimit']));

		while($thread = $db->fetch_array($query))
{
$threads[] = $thread;

		while($thread = $db->fetch_array($query))
{
$threads[] = $thread;

Zeile 1081Zeile 1066
	}

function update_most_viewed_threads()

	}

function update_most_viewed_threads()

	{
global $db, $mybb;


	{
global $db, $mybb;


		$threads = array();


		$threads = array();


		$query = $db->simple_select("threads", "tid, subject, views, fid", "visible='1'", array('order_by' => 'views', 'order_dir' => 'DESC', 'limit_start' => 0, 'limit' => $mybb->settings['statslimit']));

		$query = $db->simple_select("threads", "tid, subject, views, fid, uid", "visible='1'", array('order_by' => 'views', 'order_dir' => 'DESC', 'limit_start' => 0, 'limit' => $mybb->settings['statslimit']));

		while($thread = $db->fetch_array($query))

		while($thread = $db->fetch_array($query))

		{

		{

			$threads[] = $thread;
}

$this->update("most_viewed_threads", $threads);

			$threads[] = $thread;
}

$this->update("most_viewed_threads", $threads);

	}

	}


function update_banned()
{


function update_banned()
{

Zeile 1111Zeile 1096
	}

function update_birthdays()

	}

function update_birthdays()

	{
global $db;

$birthdays = array();

	{
global $db;

$birthdays = array();


// Get today, yesterday, and tomorrow's time (for different timezones)
$bdaytime = TIME_NOW;


// Get today, yesterday, and tomorrow's time (for different timezones)
$bdaytime = TIME_NOW;

Zeile 1135Zeile 1120
				++$birthdays[$bday['bday']]['hiddencount'];
continue;
}

				++$birthdays[$bday['bday']]['hiddencount'];
continue;
}





			// We don't need any excess caleries in the cache
unset($bday['birthdayprivacy']);


			// We don't need any excess caleries in the cache
unset($bday['birthdayprivacy']);


Zeile 1155Zeile 1140
		while($groupleader = $db->fetch_array($query))
{
$groupleaders[$groupleader['uid']][] = $groupleader;

		while($groupleader = $db->fetch_array($query))
{
$groupleaders[$groupleader['uid']][] = $groupleader;

		}

		}


$this->update("groupleaders", $groupleaders);
}


$this->update("groupleaders", $groupleaders);
}

Zeile 1165Zeile 1150
		global $db;

$prefixes = array();

		global $db;

$prefixes = array();

		$query = $db->simple_select("threadprefixes", "*", "", array('order_by' => 'prefix', 'order_dir' => 'ASC'));

		$query = $db->simple_select("threadprefixes", "*", "", array('order_by' => 'prefix', 'order_dir' => 'ASC'));


while($prefix = $db->fetch_array($query))
{
$prefixes[$prefix['pid']] = $prefix;


while($prefix = $db->fetch_array($query))
{
$prefixes[$prefix['pid']] = $prefix;

		}

		}


$this->update("threadprefixes", $prefixes);
}


$this->update("threadprefixes", $prefixes);
}

Zeile 1180Zeile 1165
		global $db;

$fd_statistics = array();

		global $db;

$fd_statistics = array();





		$time = TIME_NOW; // Look for announcements that don't end, or that are ending some time in the future
$query = $db->simple_select("announcements", "fid", "enddate = '0' OR enddate > '{$time}'", array("order_by" => "aid"));


		$time = TIME_NOW; // Look for announcements that don't end, or that are ending some time in the future
$query = $db->simple_select("announcements", "fid", "enddate = '0' OR enddate > '{$time}'", array("order_by" => "aid"));


Zeile 1196Zeile 1181
		}

// Do we have any mod tools to use in our forums?

		}

// Do we have any mod tools to use in our forums?

		$query = $db->simple_select("modtools", "forums, tid", '', array("order_by" => "tid"));


		$query = $db->simple_select("modtools", "forums, tid", '', array("order_by" => "tid"));


		if($db->num_rows($query))
{
unset($forum);

		if($db->num_rows($query))
{
unset($forum);

Zeile 1208Zeile 1193
				foreach($forums as $forum)
{
if(!$forum)

				foreach($forums as $forum)
{
if(!$forum)

					{

					{

						$forum = -1;
}


						$forum = -1;
}


Zeile 1216Zeile 1201
					{
$fd_statistics[$forum]['modtools'] = 1;
}

					{
$fd_statistics[$forum]['modtools'] = 1;
}

				}
}
}

				}
}
}


$this->update("forumsdisplay", $fd_statistics);


$this->update("forumsdisplay", $fd_statistics);

	}

/**

	}

/**

	 * Update profile fields cache.
*
*/
function update_profilefields()

	 * Update profile fields cache.
*
*/
function update_profilefields()

	{

	{

		global $db;

$fields = array();

		global $db;

$fields = array();

Zeile 1239Zeile 1224
		}

$this->update("profilefields", $fields);

		}

$this->update("profilefields", $fields);

 
	}

/**
* Update the report reasons cache.
*
*/
function update_reportreasons($no_plugins = false)
{
global $db;

$content_types = array('post', 'profile', 'reputation');
if(!$no_plugins)
{
global $plugins;
$content_types = $plugins->run_hooks("report_content_types", $content_types);
}

$reasons = array();

$query = $db->simple_select("reportreasons", "*", "", array('order_by' => 'disporder'));
while($reason = $db->fetch_array($query))
{
if($reason['appliesto'] == 'all')
{
foreach($content_types as $content)
{
$reasons[$content][] = array(
'rid' => $reason['rid'],
'title' => $reason['title'],
'extra' => $reason['extra'],
);
}
}
elseif($reason['appliesto'] != '')
{
$appliesto = explode(",", $reason['appliesto']);
foreach($appliesto as $content)
{
$reasons[$content][] = array(
'rid' => $reason['rid'],
'title' => $reason['title'],
'extra' => $reason['extra'],
);
}
}
}

$this->update("reportreasons", $reasons);

	}

/* Other, extra functions for reloading caches if we just changed to another cache extension (i.e. from db -> xcache) */

	}

/* Other, extra functions for reloading caches if we just changed to another cache extension (i.e. from db -> xcache) */