Empty commit

This commit is contained in:
Git 2012-02-14 08:00:22 +00:00
parent da793ee334
commit b5053a0b74

View File

@ -8,6 +8,18 @@
} }
else { else {
include(SERVER_ROOT.'/sections/forums/functions.php'); include(SERVER_ROOT.'/sections/forums/functions.php');
// Replace the old hard-coded forum categories
unset($ForumCats);
$ForumCats = $Cache->get_value('forums_categories');
if ($ForumCats === false) {
$DB->query("SELECT ID, Name FROM forums_categories");
$ForumCats = array();
while (list($ID, $Name) = $DB->next_record()) {
$ForumCats[$ID] = $Name;
}
$Cache->cache_value('forums_categories', $ForumCats, 0); //Inf cache.
}
//This variable contains all our lovely forum data //This variable contains all our lovely forum data
if(!$Forums = $Cache->get_value('forums_list')) { if(!$Forums = $Cache->get_value('forums_list')) {
$DB->query("SELECT $DB->query("SELECT
@ -30,11 +42,12 @@
t.IsLocked, t.IsLocked,
t.IsSticky t.IsSticky
FROM forums AS f FROM forums AS f
JOIN forums_categories AS fc ON fc.ID = f.CategoryID
LEFT JOIN forums_topics as t ON t.ID = f.LastPostTopicID LEFT JOIN forums_topics as t ON t.ID = f.LastPostTopicID
LEFT JOIN users_main AS um ON um.ID=f.LastPostAuthorID LEFT JOIN users_main AS um ON um.ID=f.LastPostAuthorID
LEFT JOIN forums_specific_rules AS sr ON sr.ForumID = f.ID LEFT JOIN forums_specific_rules AS sr ON sr.ForumID = f.ID
GROUP BY f.ID GROUP BY f.ID
ORDER BY f.CategoryID, f.Sort"); ORDER BY fc.Sort, fc.Name, f.CategoryID, f.Sort");
$Forums = $DB->to_array('ID', MYSQLI_ASSOC, false); $Forums = $DB->to_array('ID', MYSQLI_ASSOC, false);
foreach($Forums as $ForumID => $Forum) { foreach($Forums as $ForumID => $Forum) {
if(count($Forum['SpecificRules'])) { if(count($Forum['SpecificRules'])) {