Example #1
0
 /**
  * Setup the sort tool and return it for contributions display
  *
  * @return titania_sort
  */
 public static function build_sort()
 {
     // Setup the sort and set the sort keys
     $sort = new titania_sort();
     $sort->set_sort_keys(self::$sort_by);
     // Show update time descending and limit to the topics per page by default
     $sort->set_defaults(phpbb::$config['topics_per_page'], 't', 'd');
     $sort->result_lang = 'TOTAL_CONTRIBS';
     return $sort;
 }
Example #2
0
            $message = $faq->generate_text_for_display();
            // Grab attachments
            $attachments = new titania_attachment(TITANIA_FAQ, $faq->faq_id);
            $attachments->load_attachments();
            $parsed_attachments = $attachments->parse_attachments($message);
            phpbb::$template->assign_vars(array('FAQ_SUBJECT' => $faq->faq_subject, 'FAQ_TEXT' => $message, 'FAQ_VIEWS' => $faq->faq_views, 'S_DETAILS' => true, 'S_ACCESS_TEAMS' => $faq->faq_access == TITANIA_ACCESS_TEAMS ? true : false, 'S_ACCESS_AUTHORS' => $faq->faq_access == TITANIA_ACCESS_AUTHORS ? true : false, 'U_EDIT_FAQ' => titania::$contrib->is_author || phpbb::$auth->acl_get('u_titania_faq_edit') ? $faq->get_url('edit') : false, 'U_CANONICAL' => $faq->get_url()));
            foreach ($parsed_attachments as $attachment) {
                phpbb::$template->assign_block_vars('attachment', array('DISPLAY_ATTACHMENT' => $attachment));
            }
        } else {
            titania::page_header(titania::$contrib->contrib_name . ' - ' . phpbb::$user->lang['FAQ_LIST']);
            titania::_include('functions_display', 'titania_topic_folder_img');
            // Setup the sort tool
            $sort = new titania_sort();
            $sort->set_url(titania::$contrib->get_url('faq'));
            $sort->set_defaults(phpbb::$config['topics_per_page']);
            $sort->request();
            $faqs = array();
            $sql_ary = array('SELECT' => 'f.*', 'FROM' => array(TITANIA_CONTRIB_FAQ_TABLE => 'f'), 'WHERE' => 'f.contrib_id = ' . titania::$contrib->contrib_id . '
						AND f.faq_access >= ' . titania::$access_level, 'ORDER_BY' => 'f.left_id ASC');
            // Main SQL Query
            $sql = phpbb::$db->sql_build_query('SELECT', $sql_ary);
            // Handle pagination
            if ($sort->sql_count($sql_ary, 'faq_id')) {
                $sort->build_pagination($faq->get_url());
                // Get the data
                $result = phpbb::$db->sql_query_limit($sql, $sort->limit, $sort->start);
                while ($row = phpbb::$db->sql_fetchrow($result)) {
                    $faqs[$row['faq_id']] = $row;
                }
                phpbb::$db->sql_freeresult($result);
Example #3
0
            trigger_error('NO_USER');
        }
        titania_url::$params['u'] = $user_id;
    }
    $url_params = array('keywords' => $keywords, 'sf' => $search_fields, 'type' => $search_type, 'c' => $categories, 'sc' => $search_subcategories, 'versions' => $phpbb_versions);
    foreach ($url_params as $name => $value) {
        if ($value) {
            titania_url::$params[$name] = $value;
        }
    }
    // Redirect if sent through POST so the parameters are in the URL (for easy copying/pasting to other users)
    redirect(titania_url::build_url(titania_url::$current_page, titania_url::$params));
}
// Setup the sort tool
$sort = new titania_sort();
$sort->set_defaults(phpbb::$config['posts_per_page']);
$sort->request();
// Setup the search tool and make sure it is working
titania_search::initialize();
if (titania_search::$do_not_index) {
    // Solr service is down
    trigger_error('SEARCH_UNAVAILABLE');
}
// Initialize the query
$query = titania_search::create_find_query();
// Query fields
$query_fields = array();
switch ($search_fields) {
    case 'titleonly':
        $query_fields[] = 'title';
        break;
Example #4
0
 /**
  * Setup the sort tool and return it for posts display
  *
  * @return titania_sort
  */
 public static function build_sort()
 {
     // Setup the sort and set the sort keys
     $sort = new titania_sort();
     $sort->set_sort_keys(self::$sort_by);
     $sort->set_defaults(phpbb::$config['topics_per_page']);
     return $sort;
 }