Vergleich inc/class_datacache.php - 1.8.11 - 1.8.18

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 258Zeile 258
	 */
function delete($name, $greedy = false)
{

	 */
function delete($name, $greedy = false)
{

		 global $db, $mybb, $cache;

		global $db, $mybb, $cache;


// Prepare for database query.
$dbname = $db->escape_string($name);


// Prepare for database query.
$dbname = $db->escape_string($name);

Zeile 666Zeile 666
				break;
}


				break;
}


		$query = $db->query('
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.'
GROUP BY '.$group_by.' ORDER BY poststoday DESC
LIMIT 1
');
$topposter = $db->fetch_array($query);










		$query = $db->query("
SELECT u.uid, u.username, COUNT(*) AS poststoday
FROM {$db->table_prefix}posts p
LEFT JOIN {$db->table_prefix}users u ON (p.uid=u.uid)
WHERE p.dateline > {$timesearch} AND p.visible=1
GROUP BY {$group_by}
ORDER BY poststoday DESC
");

$most_posts = 0;
while($user = $db->fetch_array($query))
{
if($user['poststoday'] > $most_posts)
{
$most_posts = $user['poststoday'];
$topposter = $user;
}
}


$query = $db->simple_select('users', 'COUNT(uid) AS posters', 'postnum>0');
$posters = $db->fetch_field($query, 'posters');


$query = $db->simple_select('users', 'COUNT(uid) AS posters', 'postnum>0');
$posters = $db->fetch_field($query, 'posters');

Zeile 808Zeile 817
			{
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 837Zeile 846
	 *
*/
function update_forums()

	 *
*/
function update_forums()

	{
global $db;


	{
global $db;


		$forums = array();

// Things we don't want to cache

		$forums = array();

// Things we don't want to cache

Zeile 859Zeile 868
		}

$this->update("forums", $forums);

		}

$this->update("forums", $forums);

	}


	}


	/**
* Update usertitles cache.
*

	/**
* Update usertitles cache.
*

Zeile 901Zeile 910
			"total" => $total['reportcount'],
"lastdateline" => $latest['dateline']
);

			"total" => $total['reportcount'],
"lastdateline" => $latest['dateline']
);





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


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


Zeile 921Zeile 930
		}

$this->update("mycode", $mycodes);

		}

$this->update("mycode", $mycodes);

	}


	}


	/**
* Update the mailqueue cache
*

	/**
* Update the mailqueue cache
*

Zeile 930Zeile 939
	 * @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;


	{
global $db;


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


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


Zeile 961Zeile 970
		);

$this->update("update_check", $update_cache);

		);

$this->update("update_check", $update_cache);

	}


	}


	/**
* Update default_theme cache
*/

	/**
* Update default_theme cache
*/

Zeile 1002Zeile 1011

/**
* Updates the banned IPs cache


/**
* Updates the banned IPs cache

	 */

	 */

	function update_bannedips()
{
global $db;

	function update_bannedips()
{
global $db;

Zeile 1056Zeile 1065

$threads = array();



$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']));

		$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 1071Zeile 1080

$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))
{
$threads[] = $thread;

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

Zeile 1168Zeile 1177

$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"));





		if($db->num_rows($query))
{
while($forum = $db->fetch_array($query))

		if($db->num_rows($query))
{
while($forum = $db->fetch_array($query))

Zeile 1176Zeile 1185
				if(!isset($fd_statistics[$forum['fid']]['announcements']))
{
$fd_statistics[$forum['fid']]['announcements'] = 1;

				if(!isset($fd_statistics[$forum['fid']]['announcements']))
{
$fd_statistics[$forum['fid']]['announcements'] = 1;

				}
}
}

				}
}
}


// Do we have any mod tools to use in our forums?
$query = $db->simple_select("modtools", "forums, tid", '', array("order_by" => "tid"));


// Do we have any mod tools to use in our forums?
$query = $db->simple_select("modtools", "forums, tid", '', array("order_by" => "tid"));

Zeile 1206Zeile 1215
		}

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

		}

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

	}

/**

	}

/**

	 * Update profile fields cache.
*
*/

	 * Update profile fields cache.
*
*/

Zeile 1249Zeile 1258
			if($reason['appliesto'] == 'all')
{
foreach($content_types as $content)

			if($reason['appliesto'] == 'all')
{
foreach($content_types as $content)

				{
$reasons[$content][] = array(

				{
$reasons[$content][] = array(

						'rid' => $reason['rid'],
'title' => $reason['title'],
'extra' => $reason['extra'],

						'rid' => $reason['rid'],
'title' => $reason['title'],
'extra' => $reason['extra'],

Zeile 1276Zeile 1285

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


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

	{
global $db;


	{
global $db;


		$query = $db->simple_select("datacache", "title,cache", "title='mostonline'");
$this->update("mostonline", unserialize($db->fetch_field($query, "cache")));
}

		$query = $db->simple_select("datacache", "title,cache", "title='mostonline'");
$this->update("mostonline", unserialize($db->fetch_field($query, "cache")));
}

Zeile 1297Zeile 1306

$query = $db->simple_select("datacache", "title,cache", "title='last_backup'");
$this->update("last_backup", unserialize($db->fetch_field($query, "cache")));


$query = $db->simple_select("datacache", "title,cache", "title='last_backup'");
$this->update("last_backup", unserialize($db->fetch_field($query, "cache")));

	}


	}


	function reload_internal_settings()
{
global $db;

	function reload_internal_settings()
{
global $db;





		$query = $db->simple_select("datacache", "title,cache", "title='internal_settings'");
$this->update("internal_settings", unserialize($db->fetch_field($query, "cache")));
}

function reload_version_history()

		$query = $db->simple_select("datacache", "title,cache", "title='internal_settings'");
$this->update("internal_settings", unserialize($db->fetch_field($query, "cache")));
}

function reload_version_history()

	{
global $db;


	{
global $db;


		$query = $db->simple_select("datacache", "title,cache", "title='version_history'");
$this->update("version_history", unserialize($db->fetch_field($query, "cache")));
}

		$query = $db->simple_select("datacache", "title,cache", "title='version_history'");
$this->update("version_history", unserialize($db->fetch_field($query, "cache")));
}





	function reload_modnotes()

	function reload_modnotes()

	{
global $db;


	{
global $db;


		$query = $db->simple_select("datacache", "title,cache", "title='modnotes'");
$this->update("modnotes", unserialize($db->fetch_field($query, "cache")));

		$query = $db->simple_select("datacache", "title,cache", "title='modnotes'");
$this->update("modnotes", unserialize($db->fetch_field($query, "cache")));

	}


	}


	function reload_adminnotes()
{
global $db;

	function reload_adminnotes()
{
global $db;





		$query = $db->simple_select("datacache", "title,cache", "title='adminnotes'");
$this->update("adminnotes", unserialize($db->fetch_field($query, "cache")));

		$query = $db->simple_select("datacache", "title,cache", "title='adminnotes'");
$this->update("adminnotes", unserialize($db->fetch_field($query, "cache")));

	}

function reload_mybb_credits()
{
admin_redirect('index.php?module=home-credits&fetch_new=-2');

 
	}
}

	}
}