// *****************************************************
// *****************************************************
// - Get the search results for the forum categories:
$query = "SELECT c.name AS title,"
. " c.description AS text,"
. " c.hits,"
. " c.pub_access,"
. " c.published,"
. " '' AS created,"
. " '$section_name' AS section,"
. " '2' AS browsernav,"
. " CONCAT('index.php?option=com_kunena&Itemid=', '$Itemid', '&func=showcat&catid=',c.id) AS href"
. " FROM #__fb_categories AS c"
. " WHERE ( $whereA )"
. " AND c.published = 1";
if ($access == 0) {
$query .= " AND c.pub_access = 0";
} else {
$query .= " AND c.pub_access <= $access";
}
$query .= " ORDER BY $orderA";
$database->setQuery( $query, 0, $limit );
$row1 = $database->loadObjectList();
// *****************************************************
// *****************************************************
// - Get the search results for the forum post messages:
$query2 = "SELECT b.subject AS title,"
. " a.message AS text,"
. " b.hits,"
. " c.pub_access,"
. " c.published,"
. " c.description,"
. " FROM_UNIXTIME(b.time) AS created,"
. " CONCAT('$section_name','/', c.name) AS section,"
. " '2' AS browsernav,"
. " CONCAT('index.php?option=com_kunena&Itemid=', '$Itemid', '&func=view&catid=',b.catid,'&id=',b.thread) AS href"
. " FROM #__fb_messages_text AS a"
. " INNER JOIN #__fb_messages AS b ON b.id = a.mesid"
. " INNER JOIN #__fb_categories AS c ON c.id = b.catid"
. " WHERE ( $whereB )"
. " AND c.published = 1";
if ($access == 0) {
$query2 .= " AND c.pub_access = 0";
} else {
$query2 .= " AND c.pub_access <= $access";
}
$query2 .= " ORDER BY $orderB";
$database->setQuery( $query2, 0, $limit );
$row2 = $database->loadObjectList();
|