Zeile 258 | Zeile 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 466 | Zeile 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 666 | Zeile 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 787 | Zeile 796 |
---|
$data = array( 'users' => $awaitingusers,
|
$data = array( 'users' => $awaitingusers,
|
'time' => TIME_NOW
| 'time' => TIME_NOW
|
);
$this->update('awaitingactivation', $data);
| );
$this->update('awaitingactivation', $data);
|
Zeile 808 | Zeile 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 827 | Zeile 836 |
---|
} $this->built_moderators[$forum['fid']] = $forum_mods; $this->build_moderators($forum_mods, $forum['fid']);
|
} $this->built_moderators[$forum['fid']] = $forum_mods; $this->build_moderators($forum_mods, $forum['fid']);
|
} } }
| } } }
|
}
/** * Update the forums cache.
|
}
/** * Update the forums cache.
|
* */
| * */
|
function update_forums() { global $db;
| function update_forums() { global $db;
|
Zeile 859 | Zeile 868 |
---|
}
$this->update("forums", $forums);
|
}
$this->update("forums", $forums);
|
}
| }
|
/** * Update usertitles cache. *
| /** * Update usertitles cache. *
|
Zeile 886 | Zeile 895 |
---|
function update_reportedcontent() { global $db, $mybb;
|
function update_reportedcontent() { global $db, $mybb;
|
|
|
$query = $db->simple_select("reportedcontent", "COUNT(rid) AS unreadcount", "reportstatus='0'"); $num = $db->fetch_array($query);
|
$query = $db->simple_select("reportedcontent", "COUNT(rid) AS unreadcount", "reportstatus='0'"); $num = $db->fetch_array($query);
|
|
|
$query = $db->simple_select("reportedcontent", "COUNT(rid) AS reportcount"); $total = $db->fetch_array($query);
|
$query = $db->simple_select("reportedcontent", "COUNT(rid) AS reportcount"); $total = $db->fetch_array($query);
|
|
|
$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);
|
Zeile 988 | Zeile 982 |
---|
$query = $db->simple_select("themes", "name, tid, properties, stylesheets", "def='1'", array('limit' => 1)); $theme = $db->fetch_array($query); $this->update("default_theme", $theme);
|
$query = $db->simple_select("themes", "name, tid, properties, stylesheets", "def='1'", array('limit' => 1)); $theme = $db->fetch_array($query); $this->update("default_theme", $theme);
|
}
/**
| }
/**
|
* Updates the tasks cache saving the next run time */ function update_tasks()
| * Updates the tasks cache saving the next run time */ function update_tasks()
|
Zeile 1010 | Zeile 1004 |
---|
if(!$task_cache['nextrun']) { $task_cache['nextrun'] = TIME_NOW+3600;
|
if(!$task_cache['nextrun']) { $task_cache['nextrun'] = TIME_NOW+3600;
|
}
| }
|
$this->update("tasks", $task_cache); }
| $this->update("tasks", $task_cache); }
|
Zeile 1019 | Zeile 1013 |
---|
* Updates the banned IPs cache */ function update_bannedips()
|
* Updates the banned IPs cache */ function update_bannedips()
|
{
| {
|
global $db;
$banned_ips = array();
| global $db;
$banned_ips = array();
|
Zeile 1029 | Zeile 1023 |
---|
$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
| /** * Updates the banned emails cache
|
Zeile 1039 | Zeile 1033 |
---|
global $db;
$banned_emails = array();
|
global $db;
$banned_emails = array();
|
$query = $db->simple_select("banfilters", "fid, filter", "type = '3'");
| $query = $db->simple_select("banfilters", "fid, filter", "type = '3'");
|
while($banned_email = $db->fetch_array($query)) { $banned_emails[$banned_email['fid']] = $banned_email; }
|
while($banned_email = $db->fetch_array($query)) { $banned_emails[$banned_email['fid']] = $banned_email; }
|
|
|
$this->update("bannedemails", $banned_emails);
|
$this->update("bannedemails", $banned_emails);
|
}
| }
|
/** * Updates the search engine spiders cache */
| /** * Updates the search engine spiders cache */
|
Zeile 1066 | Zeile 1060 |
---|
}
function update_most_replied_threads()
|
}
function update_most_replied_threads()
|
{ global $db, $mybb;
| { global $db, $mybb;
|
$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 1086 | Zeile 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 1221 | Zeile 1215 |
---|
}
$this->update("forumsdisplay", $fd_statistics);
|
}
$this->update("forumsdisplay", $fd_statistics);
|
}
| }
|
/** * Update profile fields cache. *
| /** * Update profile fields cache. *
|
Zeile 1239 | Zeile 1233 |
---|
}
$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) */
|
Zeile 1251 | Zeile 1293 |
---|
}
function reload_plugins()
|
}
function reload_plugins()
|
{ global $db;
| { global $db;
|
$query = $db->simple_select("datacache", "title,cache", "title='plugins'"); $this->update("plugins", unserialize($db->fetch_field($query, "cache"))); }
function reload_last_backup()
|
$query = $db->simple_select("datacache", "title,cache", "title='plugins'"); $this->update("plugins", unserialize($db->fetch_field($query, "cache"))); }
function reload_last_backup()
|
{ global $db;
| { global $db;
|
$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")));
|
Zeile 1289 | Zeile 1331 |
---|
$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()
|
function reload_adminnotes()
|
{
| {
|
global $db;
|
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');
| |
} }
| } }
|