Index: script/dbsearch.inc =================================================================== --- script/dbsearch.inc (revision 130) +++ script/dbsearch.inc (working copy) @@ -4,15 +4,18 @@ Processing for search results page - Set view type - + Set view type and sort order + + + - + + - + + + If sort order field has changed, adjust the fields list + + + + + + + + + + + + + + + Compose a list with the userfields the user can sort on + Use _sort_fields from configuration files if present + + + + + + + + + + + + + + SELECT + userfieldfield AS _userfield_field, + userfieldname AS _userfield_name, + userfieldid AS _userfield_id, + 1 + FROM + userfields + WHERE + userfielddatabaseid='' + AND + ( + userfieldcondition IS NULL + OR + userfieldcondition LIKE '' + ) + ORDER BY + userfieldorder + + + + + + + + + + + + + + + var + search_field1 = ' ' + mbglobals("_userfield_field") + mbglobals("_ch_lf"), + search_field2 = '\t' + mbglobals("_userfield_field") + mbglobals("_ch_lf"); + + if ( + (mbglobals("_sort_fields").search(search_field1) != -1) + || + (mbglobals("_sort_fields").search(search_field2) != -1) + ) + { + mbparser.output(""); + mbglobals("_sort_field_found") = true; + } + + + + + + + + + + + + + + + + + + + + + + + + + Function to set onmouseover attribute in HTML markup for the search results in tiles mode + - mbparser.output(""); var mouseOverText = mbglobals("_result_properties"); // Escape the markup for use in a JavaScript string literal mouseOverText = mouseOverText.replace("\\", "\\\\"); - mouseOverText = mouseOverText.replace("\"", "\\\"); + mouseOverText = mouseOverText.replace("\"", "\\\""); // Escape the markup for use in an HTML attribute value // mouseOverText = server.HTMLEncode(mouseOverText); @@ -43,7 +148,7 @@ ( /name="img-[0-9]*"/, "$&" + " onmouseover=\"return escape("" + mouseOverText.replace("$", "$$") + "");\"" - ); + ) + mbglobals("_ch_nl");