$rpv) { $pd .= "&".$rp."=".$rpv; } } //print $_SESSION['wquery']; /*translation:Search results*/ $title = elgg_echo("koolielu:search_results"); $c = ""; if ($show_adv_serach) { $c .= elgg_view('object/advsearch'); } else { $c .= elgg_view('object/search'); } /*translation:You searched for*/ $c .= elgg_echo("koolielu:searched_for").": "; $c .= $_SESSION['searchTerm']; $sact = "search?searchValue"; if ($_SESSION['result_params']) { $sact = "advsearch?fti_search_input"; //$c .= "
"; if ( isset($_SESSION['results']) && count($_SESSION['results'])>0 ) { $sort_val = "date"; //default sort term $sort_opts = array( /*translation:Date*/ elgg_echo('koolielu:sortby_Date'), /*translation:Download*/ elgg_echo('koolielu:sortby_Download'), /*translation:Favorites*/ elgg_echo('koolielu:sortby_Favorites'), /*translation:Title*/ elgg_echo('koolielu:sortby_Title') ); // selection on sort terms $sort_vals = array('created', 'download', 'favorites', 'title'); // need because of its different from last row /*translation:Sorted by*/ $c .= "
"; foreach ($_SESSION['results'] as $ri=>$ris) { /*translation:Found*/ $c .= elgg_echo('koolielu:waramu_search_found').": ".$ris['count']." ".$ri; $sids = array(); $array_for_sort = array(); foreach($ris['results'] as $sri) { if ( $_SESSION['sortTerm'] == "favorites" ) { $fav_nr = get_data_row("SELECT COUNT(ID) as num FROM {$CONFIG->dbprefix}koolielu_favorite_resources WHERE waramu_id = '{$sri}'"); $array_for_sort[$sri] = $fav_nr->num; } else if ( $_SESSION['sortTerm'] == "download" ) { $dow_nr = get_data_row("SELECT url_stat FROM {$CONFIG->dbprefix}koolielu_resource_stats WHERE waramu_id='{$sri}'"); $array_for_sort[$sri] = $dow_nr->url_stat; } else { $sids[] = $sri; } } if ( $array_for_sort ) { arsort($array_for_sort); foreach ($array_for_sort as $aaf => $aav) { $sids[] = $aaf; } } // in case sorting for date, then displaying newest before if ( $_SESSION['sortTerm'] == "created" ) { $sids = array_reverse($sids); } $c .= ""; $c .= waramu_list_resources($sids); } } else { /*translation:No resources matched your search criterions*/ $c .= elgg_echo("koolielu:no_search_results"); } $c .= ""; $body = elgg_view_layout('two_column_left_sidebar', "", $c); page_draw($title, $body); ?>