diff options
author | Fabio Comuni <fabrix.xm@gmail.com> | 2011-09-27 08:57:16 +0200 |
---|---|---|
committer | Fabio Comuni <fabrix.xm@gmail.com> | 2011-09-27 08:57:16 +0200 |
commit | 939449602a58838f81045c9a0e9a205c8fa9e6bd (patch) | |
tree | 4d1889c9b2e762e5f361916d6c25d95d325c2f71 /include/text.php | |
parent | 7f02617517f16b5a26a8de66792c7cd028f9b195 (diff) | |
parent | 8d93eefea87bd36904fcb1daabc239361dd95a27 (diff) | |
download | volse-hubzilla-939449602a58838f81045c9a0e9a205c8fa9e6bd.tar.gz volse-hubzilla-939449602a58838f81045c9a0e9a205c8fa9e6bd.tar.bz2 volse-hubzilla-939449602a58838f81045c9a0e9a205c8fa9e6bd.zip |
Merge remote-tracking branch 'fabrix/newui'
Diffstat (limited to 'include/text.php')
-rw-r--r-- | include/text.php | 49 |
1 files changed, 31 insertions, 18 deletions
diff --git a/include/text.php b/include/text.php index cc1818163..ea64a3d28 100644 --- a/include/text.php +++ b/include/text.php @@ -538,22 +538,30 @@ function contact_block() { $total = intval($r[0]['total']); } if(! $total) { - $o .= '<h4 class="contact-h4">' . t('No contacts') . '</h4>'; - return $o; - } - $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 and `pending` = 0 ORDER BY RAND() LIMIT %d", - intval($a->profile['uid']), - intval($shown) - ); - if(count($r)) { - $o .= '<h4 class="contact-h4">' . sprintf( tt('%d Contact','%d Contacts', $total),$total) . '</h4><div id="contact-block">'; - foreach($r as $rr) { - $o .= micropro($rr,true,'mpfriend'); - } - $o .= '</div><div id="contact-block-end"></div>'; - $o .= '<div id="viewcontacts"><a id="viewcontacts-link" href="viewcontacts/' . $a->profile['nickname'] . '">' . t('View Contacts') . '</a></div>'; + $contacts = t('No contacts'); + $micropro = Null; + } else { + $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 and `pending` = 0 ORDER BY RAND() LIMIT %d", + intval($a->profile['uid']), + intval($shown) + ); + if(count($r)) { + $contacts = sprintf( tt('%d Contact','%d Contacts', $total),$total); + $micropro = Array(); + foreach($r as $rr) { + $micropro[] = micropro($rr,true,'mpfriend'); + } + } } + + $tpl = get_markup_template('contact_block.tpl'); + $o = replace_macros($tpl, array( + '$contacts' => $contacts, + '$nickname' => $a->profile['nickname'], + '$viewcontacts' => t('View Contacts'), + '$micropro' => $micropro, + )); $arr = array('contacts' => $r, 'output' => $o); @@ -826,9 +834,14 @@ function feed_salmonlinks($nick) { if(! function_exists('get_plink')) { function get_plink($item) { $a = get_app(); - $plink = (((x($item,'plink')) && (! $item['private'])) ? '<div class="wall-item-links-wrapper"><a href="' - . $item['plink'] . '" title="' . t('link to source') . '" target="external-link" class="icon remote-link"></a></div>' : ''); - return $plink; + if (x($item,'plink') && (! $item['private'])){ + return array( + 'href' => $item['plink'], + 'title' => t('link to source'), + ); + } else { + return false; + } }} if(! function_exists('unamp')) { @@ -981,4 +994,4 @@ if (!function_exists('str_getcsv')) { return false; } } -}
\ No newline at end of file +} |