get_class_id()."' AND tcc.`Class_Template_ID` = 0". " LEFT JOIN `Sub_Class` AS rcc ON sub.`Subdivision_ID` = rcc.`Subdivision_ID` AND rcc.`Class_ID` = '".$reply_obj->get_class_id()."' AND rcc.`Class_Template_ID` = 0". " LEFT JOIN `Forum_Count` AS fc ON sub.`Subdivision_ID` = fc.`Subdivision_ID`". " LEFT JOIN `Message".$topic_obj->get_class_id()."` AS tpc ON fc.`Last_Topic_ID` = tpc.`Message_ID`". " LEFT JOIN `Message".$reply_obj->get_class_id()."` AS rpl ON fc.`Last_Reply_ID` = rpl.`Message_ID`". " LEFT JOIN `Message".$topic_obj->get_class_id()."` AS rpltpc ON rpl.`Topic_ID` = rpltpc.`Message_ID`". " LEFT JOIN `User` AS usr ON tpc.`User_ID` = usr.`User_ID`". " LEFT JOIN `User` AS usr2 ON rpl.`User_ID` = usr2.`User_ID`"; $query_where = "sub.`Parent_Sub_ID` = '".intval($sub)."' AND sub.`Subdivision_ID` = tcc.`Subdivision_ID` AND sub.`Checked` = 1"; $query_order = "fg.`Priority` DESC, fg.`ID`, sub.`Priority`"; $query_limit = $cc_env['RecordsPerPage'] ? intval($curPos).", ".$cc_env['RecordsPerPage'] : ""; $result_vars = '$Category, $CatDescription, $SubName, $SubDescription, $SubLink, $Topics, $Replies, $Last_Topic_ID, $Last_Topic_Link, $Last_Reply_Topic_Link, $Last_Topic_Author, $Last_Topic_Date, $Last_Topic_Subject, $Last_Topic_Message_full, $Last_Reply_ID, $Last_Reply_Topic_ID, $Last_Reply_Author, $Last_Reply_Date, $Last_Reply_Subject, $Last_Reply_Message_full'; unset($last_topic_link); // inside admin navigation if ($admin_mode) { $query_join.= " LEFT JOIN `Sub_Class` AS cc ON sub.`Subdivision_ID` = cc.`Subdivision_ID` AND cc.`Class_Template_ID` = 0"; $query_where.= " AND cc.`Class_ID` = '".$forum_obj->get_class_id()."'"; } ?>