diff options
author | Mike Macgirvin <mike@macgirvin.com> | 2010-07-09 17:39:55 -0700 |
---|---|---|
committer | Mike Macgirvin <mike@macgirvin.com> | 2010-07-09 17:39:55 -0700 |
commit | 4a92de756395b403b13849917dcb519fe57db016 (patch) | |
tree | d6024a68c0383d2bc5a814156b6683c66a6fbf82 /mod | |
parent | 03689fa6b0240532a00a63fbead6dab9d95adbb5 (diff) | |
download | volse-hubzilla-4a92de756395b403b13849917dcb519fe57db016.tar.gz volse-hubzilla-4a92de756395b403b13849917dcb519fe57db016.tar.bz2 volse-hubzilla-4a92de756395b403b13849917dcb519fe57db016.zip |
directory enhancements
Diffstat (limited to 'mod')
-rw-r--r-- | mod/directory.php | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/mod/directory.php b/mod/directory.php index 6d0e1f426..0a7d7355e 100644 --- a/mod/directory.php +++ b/mod/directory.php @@ -10,22 +10,44 @@ function directory_content(&$a) { )); - $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"); + $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"); if(count($r)) { $tpl = file_get_contents('view/directory_item.tpl'); + if(in_array('small', $a->argv)) + $photo = 'thumb'; + else + $photo = 'photo'; + foreach($r as $rr) { - $profile_link = $a->get_baseurl() . '/profile/' . ((strlen($rr['nickname'])) ? $rr['nickname'] : $rr['profile_uid']); + $profile_link = $a->get_baseurl() . '/profile/' . ((strlen($rr['nickname'])) ? $rr['nickname'] : $rr['profile_uid']); + $details = ''; + if(strlen($rr['locality'])) + $details .= $rr['locality']; + if(strlen($rr['region'])) { + if(strlen($rr['locality'])) + $details .= ', '; + $details .= $rr['region']; + } + if(strlen($rr['country-name'])) { + if(strlen($details)) + $details .= ', '; + $details .= $rr['country-name']; + } + if(strlen($rr['dob'])) + $details .= '<br />Age: ' ; // . calculate age($rr['dob'])) ; + if(strlen($rr['gender'])) + $details .= '<br />Gender: ' . $rr['gender']; $o .= replace_macros($tpl,array( '$id' => $rr['id'], '$profile-link' => $profile_link, - '$photo' => $rr['photo'], + '$photo' => $rr[$photo], '$alt-text' => $rr['name'], '$name' => $rr['name'], - '$details' => $details // FIXME + '$details' => $details )); |