X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fcontacts.php;h=c8edea151866d91c2cd56e3b75d8f5a22526bac9;hb=cbc60d525e9140169c3b2d03998c53907b2fa3a7;hp=418cddf17a830018276702bed045ba05306b96f6;hpb=d9e9fd0359cb89416b486cbe9cb65f586abe6cd9;p=friendica.git diff --git a/mod/contacts.php b/mod/contacts.php index 418cddf17a..c8edea1518 100755 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -451,19 +451,7 @@ function contacts_content(&$a) { $a->set_pager_total($r[0]['total']); - $tpl = get_markup_template("contacts-top.tpl"); - $o .= replace_macros($tpl,array( - '$header' => t('Contacts') . (($nets) ? ' - ' . network_to_name($nets) : ''), - '$tabs' => $t, - '$total' => $r[0]['total'], - '$search' => $search_hdr, - '$desc' => t('Search your contacts'), - '$finding' => (strlen($search) ? '

' . t('Finding: ') . "'" . $search . "'" . '

' : ""), - '$submit' => t('Find'), - '$cmd' => $a->cmd - - )); $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `pending` = 0 $sql_extra $sql_extra2 ORDER BY `name` ASC LIMIT %d , %d ", intval($_SESSION['uid']), @@ -471,9 +459,9 @@ function contacts_content(&$a) { intval($a->pager['itemspage']) ); - if(count($r)) { + $contacts = array(); - $tpl = get_markup_template("contact_template.tpl"); + if(count($r)) { foreach($r as $rr) { if($rr['self']) @@ -505,24 +493,40 @@ function contacts_content(&$a) { } - $o .= replace_macros($tpl, array( - '$img_hover' => sprintf( t('Visit %s\'s profile [%s]'),$rr['name'],$rr['url']), - '$edit_hover' => t('Edit contact'), - '$contact_photo_menu' => contact_photo_menu($rr), - '$id' => $rr['id'], - '$alt_text' => $alt_text, - '$dir_icon' => $dir_icon, - '$thumb' => $rr['thumb'], - '$name' => $rr['name'], - '$username' => $rr['name'], - '$sparkle' => $sparkle, - '$url' => $url - )); + $contacts[] = array( + 'img_hover' => sprintf( t('Visit %s\'s profile [%s]'),$rr['name'],$rr['url']), + 'edit_hover' => t('Edit contact'), + 'photo_menu' => contact_photo_menu($rr), + 'id' => $rr['id'], + 'alt_text' => $alt_text, + 'dir_icon' => $dir_icon, + 'thumb' => $rr['thumb'], + 'name' => $rr['name'], + 'username' => $rr['name'], + 'sparkle' => $sparkle, + 'url' => $url, + 'item' => $rr, + ); } - $o .= '
'; + } - $o .= paginate($a); + + $tpl = get_markup_template("contacts-template.tpl"); + $o .= replace_macros($tpl,array( + '$header' => t('Contacts') . (($nets) ? ' - ' . network_to_name($nets) : ''), + '$tabs' => $t, + '$total' => $r[0]['total'], + '$search' => $search_hdr, + '$desc' => t('Search your contacts'), + '$finding' => (strlen($search) ? t('Finding: ') . "'" . $search . "'" : ""), + '$submit' => t('Find'), + '$cmd' => $a->cmd, + '$contacts' => $contacts, + '$paginate' => paginate($a), + + )); + return $o; }