Zeile 6 | Zeile 6 |
---|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* $Id: class_datacache.php 5380 2011-02-21 12:04:43Z Tomm $
| * $Id: class_datacache.php 5473 2011-06-23 11:12:10Z Tomm $
|
*/
class datacache
| */
class datacache
|
Zeile 101 | Zeile 101 |
---|
{ return $this->cache[$name]; }
|
{ return $this->cache[$name]; }
|
| // If we're not hard refreshing, and this cache doesn't exist, return false // It would have been loaded pre-global if it did exist anyway... else if($hard == false && !is_object($this->handler)) { return false; }
|
if(is_object($this->handler)) { $data = $this->handler->fetch($name);
| if(is_object($this->handler)) { $data = $this->handler->fetch($name);
|
Zeile 112 | Zeile 118 |
---|
// Fetch from database $query = $db->simple_select("datacache", "title,cache", "title='".$db->escape_string($name)."'"); $cache_data = $db->fetch_array($query);
|
// Fetch from database $query = $db->simple_select("datacache", "title,cache", "title='".$db->escape_string($name)."'"); $cache_data = $db->fetch_array($query);
|
$data = @unserialize($cache_data['cache']);
| $data = @unserialize($cache_data['cache']);
|
if($data == null) {
| if($data == null) {
|
Zeile 190 | Zeile 196 |
---|
global $db;
if(is_object($this->handler))
|
global $db;
if(is_object($this->handler))
|
{
| {
|
$size = $this->handler->size_of($name); if(!$size) {
| $size = $this->handler->size_of($name); if(!$size) {
|
Zeile 549 | Zeile 555 |
---|
* */ 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 708 | Zeile 714 |
---|
$banned_ips[$banned_ip['fid']] = $banned_ip; } $this->update("bannedips", $banned_ips);
|
$banned_ips[$banned_ip['fid']] = $banned_ip; } $this->update("bannedips", $banned_ips);
|
| }
/** * Updates the banned emails cache */ function update_bannedemails() { global $db;
$banned_emails = array(); $query = $db->simple_select("banfilters", "fid, filter", "type = '3'");
while($banned_email = $db->fetch_array($query)) { $banned_emails[$banned_email['fid']] = $banned_email; }
$this->update("bannedemails", $banned_emails);
|
}
/**
| }
/**
|
Zeile 726 | Zeile 750 |
---|
} function update_most_replied_threads()
|
} function update_most_replied_threads()
|
{ global $db, $mybb; $threads = array();
| { 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'])); while($thread = $db->fetch_array($query)) {
| $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'])); while($thread = $db->fetch_array($query)) {
|
Zeile 753 | Zeile 777 |
---|
} $this->update("most_viewed_threads", $threads);
|
} $this->update("most_viewed_threads", $threads);
|
}
| }
|
function update_banned() {
| function update_banned() {
|
Zeile 775 | Zeile 799 |
---|
global $db; $birthdays = array();
|
global $db; $birthdays = array();
|
|
|
// Get today, yesturday, and tomorrow's time (for different timezones) $bdaytime = TIME_NOW; $bdaydate = my_date("j-n", $bdaytime, '', 0);
| // Get today, yesturday, and tomorrow's time (for different timezones) $bdaytime = TIME_NOW; $bdaydate = my_date("j-n", $bdaytime, '', 0);
|
Zeile 806 | Zeile 830 |
---|
} function update_groupleaders()
|
} function update_groupleaders()
|
{ global $db; $groupleaders = array();
| { global $db; $groupleaders = array();
|
$query = $db->simple_select("groupleaders"); while($groupleader = $db->fetch_array($query))
|
$query = $db->simple_select("groupleaders"); while($groupleader = $db->fetch_array($query))
|
{
| {
|
$groupleaders[$groupleader['uid']][] = $groupleader;
|
$groupleaders[$groupleader['uid']][] = $groupleader;
|
}
| }
|
$this->update("groupleaders", $groupleaders); }
|
$this->update("groupleaders", $groupleaders); }
|
| function update_threadprefixes() { global $db;
$prefixes = array(); $query = $db->simple_select("threadprefixes", "*", "", array("order_by" => "pid"));
while($prefix = $db->fetch_array($query)) { $prefixes[$prefix['pid']] = $prefix; }
$this->update("threadprefixes", $prefixes); }
function update_forumsdisplay() { 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"));
if($db->num_rows($query)) { while($forum = $db->fetch_array($query)) { 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", "type = 't'", array("order_by" => "tid"));
if($db->num_rows($query)) { unset($forum); while($tool = $db->fetch_array($query)) { $forums = explode(",", $tool['forums']);
foreach($forums as $forum) { if(!$forum) { $forum = -1; }
if(!isset($fd_statistics[$forum]['modtools'])) { $fd_statistics[$forum]['modtools'] = 1; } } } }
$this->update("forumsdisplay", $fd_statistics); }
|
/* 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() {
|