3 function viewcontacts_init(&$a) {
5 profile_load($a,$a->argv[1]);
10 function viewcontacts_content(&$a) {
12 if(((! count($a->profile)) || ($a->profile['hide-friends']))) {
13 notice( t('Permission denied.') . EOL);
17 $o .= '<h3>' . t('View Contacts') . '</h3>';
20 $r = q("SELECT COUNT(*) as `total` FROM `contact` WHERE `uid` = %d AND `blocked` = 0 AND `pending` = 0",
21 intval($a->profile['uid'])
24 $a->set_pager_total($r[0]['total']);
26 $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `blocked` = 0 AND `pending` = 0 ORDER BY `name` ASC LIMIT %d , %d ",
27 intval($a->profile['uid']),
28 intval($a->pager['start']),
29 intval($a->pager['itemspage'])
32 notice( t('No contacts.') . EOL );
36 $tpl = load_view_file("view/viewcontact_template.tpl");
42 $o .= replace_macros($tpl, array(
44 '$alt_text' => t('Visit ') . $rr['name'] . t('\'s profile'),
45 '$thumb' => $rr['thumb'],
46 '$name' => $rr['name'],
51 $o .= '<div id="view-contact-end"></div>';