3 function viewcontacts_init(&$a) {
5 require_once("mod/profile.php");
6 profile_load($a,$a->argv[1]);
11 function viewcontacts_content(&$a) {
13 if(((! count($a->profile)) || ($a->profile['hide-friends']))) {
14 notice( t('Permission denied.') . EOL);
18 $o .= '<h3>' . t('View Contacts') . '</h3>';
21 $r = q("SELECT COUNT(*) as `total` FROM `contact` WHERE `uid` = %d AND `blocked` = 0 AND `pending` = 0",
22 intval($a->profile['uid'])
25 $a->set_pager_total($r[0]['total']);
27 $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `blocked` = 0 AND `pending` = 0 ORDER BY `name` ASC LIMIT %d , %d ",
28 intval($a->profile['uid']),
29 intval($a->pager['start']),
30 intval($a->pager['itemspage'])
33 notice( t('No contacts.') . EOL );
37 $tpl = load_view_file("view/viewcontact_template.tpl");
43 $o .= replace_macros($tpl, array(
45 '$alt_text' => t('Visit ') . $rr['name'] . t('\'s profile'),
46 '$thumb' => $rr['thumb'],
47 '$name' => $rr['name'],
52 $o .= '<div id="view-contact-end"></div>';