Functions
search_results_list.php File Reference

This file represents a View layer of the BMLT MVC pattern. It will do a meeting search, and return the results as comma-separated values (CSV). It is not an object-oriented file, and is quite simple to use. For many people, the procedural View Layer files may be all they need to see. The object-oriented stuff is encapsulated within. More...

Functions

 DisplaySearchResultsList ($in_http_vars, $in_root_offset= '/../')
 This function does a search, then builds an HTML markup of a tabular result, with each row being a meeting. It also allows sorting of the list vie 3 different axes.
 DisplayPageData (&$in_ar, $in_sort_keys, $in_page_no, $in_sort_key, $in_sort_dir, $in_http_vars, $in_query, $in_script_name, $in_radius=null, $in_long=null, $in_lat=null)
 This is called after the search has been executed. It lays out the table headers, sets up the sort links, and displays each meeting in its row.
 DisplayDataEditor ($in_localized_strings, $in_http_vars, $in_script_name)
 This creates the HTML for the edit data item, at the bottom of a logged-in search results page.
 DisplayMeeting (c_comdef_meeting &$in_mtg_obj, $in_http_vars, $in_script_name)
 This arranges one table row to be displayed for one meeting.
 DisplayResultCount ($in_num_results, $in_first, $in_last, $in_script_name, $in_radius=null, $in_long=null, $in_lat=null, $in_loc=null)
 This Builds a brief display over the table, indicating which meeting records are being covered by the current page.
 DisplayResultNav ($in_page_no, $in_sort_key, $in_sort_dir, $in_num_pages, $in_page_display_size, $in_query, $in_script_name, $in_radius=null, $in_long=null, $in_lat=null)
 This creates the numbered page navigation bar.

Detailed Description

This file represents a View layer of the BMLT MVC pattern. It will do a meeting search, and return the results as comma-separated values (CSV). It is not an object-oriented file, and is quite simple to use. For many people, the procedural View Layer files may be all they need to see. The object-oriented stuff is encapsulated within.

This file represents a View layer of the BMLT MVC pattern. It will do a meeting search, and display the results as a paged list. It will present a simple table list, with each line being a meeting, and will provide UI for sorting the results. It is not an object-oriented file, and is quite simple to use. For many people, the procedural View Layer files may be all they need to see. The object-oriented stuff is encapsulated within.

The way you use this file is to call DisplaySearchResultsCSV with an array that contains values that specify the search.

This file is part of the Basic Meeting List Toolbox (BMLT).

Find out more at: http://magshare.org/bmlt

BMLT is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

BMLT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this code. If not, see <http://www.gnu.org/licenses/>.

This is the list display for the basic HTML implementation of the BMLT.

This file generates HTML structure that is modified by the presentation code in the search_results_list.css and search_results_list_print.css files.

The way you use this file is to call DisplaySearchResultsList with an array that contains values that specify the search.

This file is part of the Basic Meeting List Toolbox (BMLT).

Find out more at: http://magshare.org/bmlt

BMLT is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

BMLT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this code. If not, see <http://www.gnu.org/licenses/>.


Function Documentation

DisplayDataEditor ( in_localized_strings,
in_http_vars,
in_script_name 
)

This creates the HTML for the edit data item, at the bottom of a logged-in search results page.

Returns:
a string, containing the HTML rendered by the function.
Parameters:
in_localized_stringsThe localized strings
in_http_varsThe HTTP GET and POST arguments.
in_script_nameA string. The name of the script for the links.

Referenced by DisplayPageData().

DisplayMeeting ( c_comdef_meeting &$  in_mtg_obj,
in_http_vars,
in_script_name 
)

This arranges one table row to be displayed for one meeting.

Returns:
a string, containing the HTML rendered by the function.
Parameters:
in_mtg_objA reference to an instance of c_comdef_meeting.
in_http_varsThe HTTP GET and POST arguments.
in_script_nameA string. The name of the script for the links.

Referenced by DisplayPageData().

DisplayPageData ( &$  in_ar,
in_sort_keys,
in_page_no,
in_sort_key,
in_sort_dir,
in_http_vars,
in_query,
in_script_name,
in_radius = null,
in_long = null,
in_lat = null 
)

This is called after the search has been executed. It lays out the table headers, sets up the sort links, and displays each meeting in its row.

Returns:
a string, containing the HTML rendered by the function.
Parameters:
in_arA reference to an array of c_comdef_meeting objects to be displayed.
in_sort_keysAn array of strings, representing the various sort keys.
in_page_noThe page number.
in_sort_keyThe sort key used for this display.
in_sort_dirThe sort direction used for this display.
in_http_varsThe HTTP GET and POST arguments.
in_queryA string. The query parameters for links.
in_script_nameThe name of the script, for links.
in_radiusA floating-point number. If this is the result of a radius search, this is the radius, in Km or miles.
in_longA floating-point number. If this is the result of a radius search, this is the longitude of the center point.
in_latA floating-point number. If this is the result of a radius search, this is the latitude of the center point.

Referenced by DisplaySearchResultsList().

DisplayResultCount ( in_num_results,
in_first,
in_last,
in_script_name,
in_radius = null,
in_long = null,
in_lat = null,
in_loc = null 
)

This Builds a brief display over the table, indicating which meeting records are being covered by the current page.

Returns:
a string, containing the HTML rendered by the function.
Parameters:
in_num_resultsAn integer. The number of meetings total in the search.
in_firstAn integer. The index of the first meeting displayed (1-based)
in_lastAn integer. The index of the last meeting displayed.
in_script_nameThe script name for the link.
in_radiusA floating-point number. If this is the result of a radius search, this is the radius, in Km or miles.
in_longA floating-point number. If this is the result of a radius search, this is the longitude of the center point.
in_latA floating-point number. If this is the result of a radius search, this is the latitude of the center point.
in_locA string. If a string search was used for the location, the location string is given here.

Referenced by DisplaySearchResultsList().

DisplayResultNav ( in_page_no,
in_sort_key,
in_sort_dir,
in_num_pages,
in_page_display_size,
in_query,
in_script_name,
in_radius = null,
in_long = null,
in_lat = null 
)

This creates the numbered page navigation bar.

Returns:
a string, containing the HTML rendered by the function.
Parameters:
in_page_noThe page selected.
in_sort_keyThe sort key used for this display.
in_sort_dirThe sort direction used for this display.
in_num_pagesThe number of pages in this search result.
in_page_display_sizeThe number of page links to be shown before paging arrows are displayed.
in_queryA string. The query parameters for links.
in_script_nameThe name of the script, for links.
in_radiusA floating-point number. If this is the result of a radius search, this is the radius, in Km or miles.
in_longA floating-point number. If this is the result of a radius search, this is the longitude of the center point.
in_latA floating-point number. If this is the result of a radius search, this is the latitude of the center point.

Referenced by DisplaySearchResultsList().

DisplaySearchResultsList ( in_http_vars,
in_root_offset = '/../' 
)

This function does a search, then builds an HTML markup of a tabular result, with each row being a meeting. It also allows sorting of the list vie 3 different axes.

Returns:
a string, containing the HTML generated by the search.
Parameters:
in_http_varsThe various HTTP GET and POST parameters. If this is defined and set to 'yes', then that means the client supports AJAX.
  • 'supports_ajax' We serve non-JavaScript content to clients that don't support AJAX, even if they support JavaScript.

This is necessary for links:

  • 'script_name' This is the HTTP path to the script.

The values that are important to the list paging are:

  • 'bmlt_page' This is a positive integer, specifying which page of results to display.
  • 'results_per_page' This is the number of meetings to list on one "page" of results. The search results are paged, so that a large search is broken into multiple pages of page_display_size results.
  • 'sort_key' This is the key to use for sorting. There are three possible values:
    • 'town' This is sorted by town, borough and neighborhood first, weekday and time second.
    • 'weekday' This is sorted by weekday first, town, borough and neighborhood second, then time
    • 'time' This is sorted by weekday first, time, second, then town, borough and neighborhood.
  • 'sort_dir' This is the direction of the sort. It can be one of the following:
    • 'asc' Ascending, from least to greatest.
    • 'desc' Descending, from greatest to least.

These are used to specify a search:

  • 'services' This is an array of positive integers. This is interpreted as an array of integers. Each integer represents the ID of a Service Body. A positive integer means that the search will look specifically for meetings that contain that Service Body ID. If the integer is negative (preceded by a minus sign -), then the criteria will be to look for meetings that don't contain that ID. If no 'services' values are given, then the search will not use the Service Body field as a search criteria.
  • 'weekdays' This is an array of positive integers ( 1-7). This is interpreted as an array of integers. Each integer represents a weekday (1 -> Sunday, 7 -> Saturday). A positive integer means that the search will look specifically for meetings that occur on that weekday. If the integer is negative (preceded by a minus sign -), then the criteria will be to look for meetings that don't occur on that weekday. If no 'weekdays' values are given, then the search will not use the weekday field as a search criteria.
  • 'bmlt_search_type' This is set to 'advanced' if the search is an advanced one (we need to take more criteria into consideration).
  • 'advanced_search_mode' This is set if the call was made from the advanced search page.
  • 'advanced_formats' This is the formats array, but is only counted if the bmlt_search_type is set to 'advanced'.
  • 'advanced_service_bodies' This is the same, but for Service Bodies.
  • 'advanced_weekdays' ...and weekdays.
  • 'advanced_published' This is a switch to indicate whether or not to display published or unpublished meetings. It is only viable for logged-in users, and can have these values:
    • -1 Search for ONLY unpublished meetings
    • 0 Search for published and unpublished meetings.
    • 1 Search for ONLY published meetings.
  • 'formats' This is an array of positive integers. This is interpreted as an array of integers. Each integer represents a format shared ID. A format ID means that the search will look specifically for meetings that have that format. If the format is negative (preceded by a minus sign -), then the criteria will be to look for meetings that don't have that format. If no 'formats' values are given, then the search will not use the formats field as a search criteria.
  • 'langs' This is an array of 2-character strings. This is interpreted as an array of strings. Each string represents a language code, and is a 2-character string. A language string means that the search will look specifically for meetings that are in that language. If the language is preceded by a minus sign -, then the criteria will be to look for meetings that are not in that language. If no 'langs' values are given, then the search will not use the lang_enum field as a search criteria.

The following values specify a start time "window." The meeting must start on, or after StartsAfterH/M, and can start no later than StartsBeforeH/M

  • 'StartsAfterH' A positive integer between 0 and 23. The hour of the minimal start time for meetings, in military time.
  • 'StartsAfterM' A positive integer between 0 and 59. The minute of the minimal start time for meetings, in military time.
  • 'StartsBeforeH' A positive integer between 0 and 23. The hour of the maximal start time for meetings, in military time.
  • 'StartsBeforeM' A positive integer between 0 and 59. The minute of the maximal start time for meetings, in military time.

The following values specify a time duration "window." The meeting can last no longer than MaxDurationH/M, and no less than MinDurationH/M.

  • 'MinDurationH' A positive integer. This is the number of hours in the minimal duration.
  • 'MinDurationM' A positive integer. This is the number of minutes in the minimal duration.
  • 'MaxDurationH' A positive integer. This is the number of hours in the maximal duration.
  • 'MaxDurationM' A positive integer. This is the number of minutes in the maximal duration.

This is how meetings are located. We don't use address lookups. Instead, we geolocate the meetings via the longitude and latitude fields in each record. If you don't specify a geolocation, then the entire database is searched. If you do specify one, then only the portion within the radius is searched.

  • 'geo_width' A floating point number. This is the radius (not diameter) of the search, in MILES (not Kilometers). If this is negative, then it should be an integer, and that indicates an auto-radius is requested to find the number of meetings in the integer.
  • 'geo_width_km' A floating point number. This is the radius (not diameter) of the search, in KILOMETERS (not Miles). If this is negative, then it should be an integer, and that indicates an auto-radius is requested to find the number of meetings in the integer.
  • 'long_val' If one of the three radius specifiers is zero or undefined, this is ignored. This is a floating point number that specifies the longitude, in degrees, of the center of the search radius.
  • 'lat_val' If one of the three radius specifiers is zero or undefined, this is ignored. This is a floating point number that specifies the latitude, in degrees, of the center of the search radius.
  • 'SearchString' A string. If this is specified, then all the string fields of the meetings specified by the above criteria will be searched for the string. By default, if the language supports metaphone (sound like search), then that is used.
  • 'StringSearchIsAnAddress' A boolean. Nonzero means that the given string should not be checked against any of the fields in the meeting data. Instead, it is to be considered a submission to the Google Maps geocode, and will be used to determine a cernter point in a local search.
  • 'SearchStringAll' If nonzero, then all of the words in the search string will have to be matched for a meetings to qualify.
  • 'SearchStringExact' If nonzero, metaphone will not be used, and the spelling must be exact.
  • 'meeting_ids' An array of positive integers. Each integer is an ID of an individual meeting. If this is set, all other search criteria are ignored.
  • 'meeting_key' A string. This is the xact name of the key to match. If this is null (Default), the following three are ignored.
  • 'meeting_key_value' A string. The value to match.
  • 'meeting_key_match_case' If true, the case must match. Default is false.
  • 'meeting_key_contains' If this is false, then the string must be complete. Default is true (contains).
    Parameters:
    in_root_offsetThis is used for administration. It makes sure that the URIs to the AJAX handlers are referenced correctly. I am not proud of this. It represents a design flaw. My design has a glass jaw, and can't handle the context being shifted around without some handholding.

Referenced by GetSearchResults().

 All Classes Files Functions Variables Enumerations