".elgg_echo("koolielu:my_favorites").""; $uname = get_input('uname'); $uo = get_user_by_username($uname); $uid = false; if ($uo) { $uid = $uo->getGUID(); } //favorites list $idw = listMyFavorites($uid); $ids = array(); foreach($idw as $ida) { $ids []= $ida->waramu_id; } $sort_val = "created"; //default sort term if ( get_input('sortValue') ) { $sort_val = get_input('sortValue'); $_SESSION['sortTerm'] = $sort_val; } else if ( $_SESSION['sortTerm'] ){ $sort_val = $_SESSION['sortTerm']; } $sort_vals = array('created', 'download', 'favorites', 'title'); // because favorites ids come from our table, they have to be sorted locally by created time and title if ($sort_val == "created") $ids = sortMaterials($ids, $sort_val, "desc"); else if ($sort_val == "title") $ids = sortMaterials($ids, $sort_val, "asc"); $c .= elgg_view('object/listing_header',array('ids'=>$ids, 'sort_val'=>$sort_val, 'sort_vals'=>$sort_vals,'show_count'=>1)); $right_side = ""; $body = elgg_view_layout('two_column_left_sidebar', "", $c, $right_side); page_draw($title, $body); ?>