3 // Gets all the friends of a particular user, as specified in $parameter[0],
4 // and return it in a data structure with the idents of all the users
6 $ident = (int) $parameter[0];
8 if (!isset($_SESSION['friends_cache'][$ident]) || (time() - $_SESSION['friends_cache'][$ident]->created > 120)) {
9 $_SESSION['friends_cache'][$ident]->created = time();
10 $_SESSION['friends_cache'][$ident]->data = get_records_sql('SELECT f.friend AS user_id,u.name FROM '.$CFG->prefix.'friends f
11 JOIN '.$CFG->prefix.'users u ON u.ident = f.friend
12 WHERE f.owner = ?',array($ident));
14 $run_result = $_SESSION['friends_cache'][$ident]->data;*/
16 $run_result = get_records_sql('SELECT f.friend AS user_id,u.name FROM '.$CFG->prefix
.'friends f
17 JOIN '.$CFG->prefix
.'users u ON u.ident = f.friend
18 WHERE f.owner = ?',array($ident));