4 function directory_content(&$a) {
7 $tpl .= file_get_contents('view/directory_header.tpl');
9 $o .= replace_macros($tpl, array(
13 $r = q("SELECT `profile`.*, `profile`.`uid` AS `profile_uid`, `user`.`nickname` FROM `profile` LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid` WHERE `is-default` = 1 AND `publish` = 1 ORDER BY `name` ASC");
16 $tpl = file_get_contents('view/directory_item.tpl');
18 if(in_array('small', $a->argv))
25 $profile_link = $a->get_baseurl() . '/profile/' . ((strlen($rr['nickname'])) ? $rr['nickname'] : $rr['profile_uid']);
27 if(strlen($rr['locality']))
28 $details .= $rr['locality'];
29 if(strlen($rr['region'])) {
30 if(strlen($rr['locality']))
32 $details .= $rr['region'];
34 if(strlen($rr['country-name'])) {
37 $details .= $rr['country-name'];
39 if(strlen($rr['dob']))
40 $details .= '<br />Age: ' ; // . calculate age($rr['dob'])) ;
41 if(strlen($rr['gender']))
42 $details .= '<br />Gender: ' . $rr['gender'];
44 $o .= replace_macros($tpl,array(
46 '$profile-link' => $profile_link,
47 '$photo' => $rr[$photo],
48 '$alt-text' => $rr['name'],
49 '$name' => $rr['name'],
50 '$details' => $details
56 $o .= "<div class=\"directory-end\" ></div>\r\n";
59 notice("No entries (some entries may be hidden).");