Vergleich inc/class_datacache.php - 1.8.14 - 1.8.19

  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.' AND p.visible=1
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 685Zeile 694
			'top_poster' => (array)$topposter,
'posters' => $posters
);

			'top_poster' => (array)$topposter,
'posters' => $posters
);





		$this->update('statistics', $statistics);
}


		$this->update('statistics', $statistics);
}


Zeile 705Zeile 714
		if(!is_array($forum_cache))
{
return false;

		if(!is_array($forum_cache))
{
return false;

		}


		}


		reset($forum_cache);
$fcache = array();


		reset($forum_cache);
$fcache = array();


Zeile 726Zeile 735
		$this->moderators = array();

// Fetch moderators from the database

		$this->moderators = array();

// Fetch moderators from the database

		$query = $db->query("

		$query = $db->query("

			SELECT m.*, u.username, u.usergroup, u.displaygroup
FROM ".TABLE_PREFIX."moderators m
LEFT JOIN ".TABLE_PREFIX."users u ON (m.id=u.uid)

			SELECT m.*, u.username, u.usergroup, u.displaygroup
FROM ".TABLE_PREFIX."moderators m
LEFT JOIN ".TABLE_PREFIX."users u ON (m.id=u.uid)

Zeile 736Zeile 745
		while($moderator = $db->fetch_array($query))
{
$this->moderators[$moderator['fid']]['users'][$moderator['id']] = $moderator;

		while($moderator = $db->fetch_array($query))
{
$this->moderators[$moderator['fid']]['users'][$moderator['id']] = $moderator;

		}


		}


		if(!function_exists("sort_moderators_by_usernames"))
{
function sort_moderators_by_usernames($a, $b)

		if(!function_exists("sort_moderators_by_usernames"))
{
function sort_moderators_by_usernames($a, $b)

Zeile 757Zeile 766
		while($moderator = $db->fetch_array($query))
{
$this->moderators[$moderator['fid']]['usergroups'][$moderator['id']] = $moderator;

		while($moderator = $db->fetch_array($query))
{
$this->moderators[$moderator['fid']]['usergroups'][$moderator['id']] = $moderator;

		}


		}


		if(is_array($this->moderators))
{
foreach(array_keys($this->moderators) as $fid)
{
uasort($this->moderators[$fid], 'sort_moderators_by_usernames');

		if(is_array($this->moderators))
{
foreach(array_keys($this->moderators) as $fid)
{
uasort($this->moderators[$fid], 'sort_moderators_by_usernames');

			}
}

$this->build_moderators();

			}
}

$this->build_moderators();


$this->update("moderators", $this->built_moderators);


$this->update("moderators", $this->built_moderators);





		return true;
}

/**
* Update the users awaiting activation cache.

		return true;
}

/**
* Update the users awaiting activation cache.

	 *

	 *

	 */
function update_awaitingactivation()
{

	 */
function update_awaitingactivation()
{

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 1081Zeile 1090
	}

function update_banned()

	}

function update_banned()

	{
global $db;

$bans = array();


	{
global $db;

$bans = array();


		$query = $db->simple_select("banned");
while($ban = $db->fetch_array($query))
{

		$query = $db->simple_select("banned");
while($ban = $db->fetch_array($query))
{

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

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

				{

				{

					$reasons[$content][] = array(
'rid' => $reason['rid'],
'title' => $reason['title'],

					$reasons[$content][] = array(
'rid' => $reason['rid'],
'title' => $reason['title'],

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

 
	}
}

	}
}