]> git.mxchange.org Git - friendica.git/blob - mod/directory.php
6d0e1f426828cbd9c6c2695c5e54a9d344c54fca
[friendica.git] / mod / directory.php
1 <?php
2
3
4 function directory_content(&$a) {
5
6
7         $tpl .= file_get_contents('view/directory_header.tpl');
8
9         $o .= replace_macros($tpl, array(
10
11         ));
12
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");
14         if(count($r)) {
15
16                 $tpl = file_get_contents('view/directory_item.tpl');
17
18                 foreach($r as $rr) {
19                         $profile_link = $a->get_baseurl() . '/profile/' . ((strlen($rr['nickname'])) ? $rr['nickname'] : $rr['profile_uid']);
20
21
22                         $o .= replace_macros($tpl,array(
23                                 '$id' => $rr['id'],
24                                 '$profile-link' => $profile_link,
25                                 '$photo' => $rr['photo'],
26                                 '$alt-text' => $rr['name'],
27                                 '$name' => $rr['name'],
28                                 '$details' => $details   // FIXME
29
30
31                         ));
32
33                 }
34                 $o .= "<div class=\"directory-end\" ></div>\r\n";
35         }
36         else
37                 notice("No entries (some entries may be hidden).");
38
39         return $o;
40 }