elgg_echo('koolielu:sortby_Date'), /*translation:Download*/ 'download'=>elgg_echo('koolielu:sortby_Download'), /*translation:Favorites*/ 'favorites'=>elgg_echo('koolielu:sortby_Favorites'), /*translation:Title*/ 'title'=>elgg_echo('koolielu:sortby_Title') ); $c = ""; if ($rids && $sort_vals) { $ids = array(); $array_for_sort = array(); if ( $sort_val == "favorites" || $sort_val == "download" ) { if ( $sort_val == "favorites" ) $sqlq = "SELECT COUNT(ID) as stat FROM {$CONFIG->dbprefix}koolielu_favorite_resources WHERE waramu_id = "; else if ( $sort_val == "download" ) $sqlq = "SELECT url_stat as stat FROM {$CONFIG->dbprefix}koolielu_resource_stats WHERE waramu_id="; foreach($rids as $ri) { $fav_nr = get_data_row($sqlq . "'".$ri."'"); $array_for_sort[$ri] = $fav_nr->stat; } } else { $ids = $rids; } if ( $array_for_sort ) { arsort($array_for_sort); foreach ($array_for_sort as $aaf => $aav) { $ids[] = $aaf; } } if ($show_count && count($ids)>=$show_count) { /*translation:Waramu has*/ $c .= "
".elgg_echo("koolielu:waramu_has").": ".count($ids)."
"; } $c .= "
"; /*translation:Sorted by*/ $c .= elgg_echo("koolielu:sortedby").": "; foreach ($sort_opts as $sot => $so) { if (in_array($sot, $sort_vals)) { $style=''; if ($sort_val == $sot) $style = 'style="text-decoration:underline;" '; if ($b) $c .= ''.$so.' '; } } $c .= "
"; } $c .= waramu_list_resources($ids, true, $vars['show_koolielu']); echo $c; ?>