From 5a9dae78a2839d8d466a5c3ecda9e83cf1f4c50c Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 6 Mar 2013 17:52:58 -0800 Subject: get rid of html from mod_suggest --- mod/suggest.php | 43 +++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 20 deletions(-) (limited to 'mod/suggest.php') diff --git a/mod/suggest.php b/mod/suggest.php index b66b06e65..f891ebefc 100644 --- a/mod/suggest.php +++ b/mod/suggest.php @@ -18,7 +18,11 @@ function suggest_init(&$a) { } +function suggest_aside(&$a) { + $a->set_widget('follow', follow_widget()); + $a->set_widget('findpeople', findpeople_widget()); +} function suggest_content(&$a) { @@ -31,37 +35,36 @@ function suggest_content(&$a) { $_SESSION['return_url'] = $a->get_baseurl() . '/' . $a->cmd; - $a->page['aside'] .= follow_widget(); - $a->page['aside'] .= findpeople_widget(); - - - $o .= '

' . t('Friend Suggestions') . '

'; - $r = suggestion_query(local_user(),get_observer_hash()); if(! $r) { - $o .= t('No suggestions available. If this is a new site, please try again in 24 hours.'); - return $o; + info( t('No suggestions available. If this is a new site, please try again in 24 hours.')); + return; } - $tpl = get_markup_template('suggest_friends.tpl'); + $arr = array(); foreach($r as $rr) { $connlnk = $a->get_baseurl() . '/follow/?url=' . $rr['xchan_addr']; - $o .= replace_macros($tpl,array( - '$url' => chanlink_url($rr['xchan_url']), - '$name' => $rr['xchan_name'], - '$photo' => $rr['xchan_photo_m'], - '$ignlnk' => $a->get_baseurl() . '/suggest?ignore=' . $rr['xchan_hash'], - '$conntxt' => t('Connect'), - '$connlnk' => $connlnk, - '$ignore' => t('Ignore/Hide') - )); + $arr[] = array( + 'url' => chanlink_url($rr['xchan_url']), + 'name' => $rr['xchan_name'], + 'photo' => $rr['xchan_photo_m'], + 'ignlnk' => $a->get_baseurl() . '/suggest?ignore=' . $rr['xchan_hash'], + 'conntxt' => t('Connect'), + 'connlnk' => $connlnk, + 'ignore' => t('Ignore/Hide') + ); } - $o .= cleardiv(); -// $o .= paginate($a); + + $o = replace_macros(get_markup_template('suggest_page.tpl'),array( + '$title' => t('Channel Suggestions'), + '$entries' => $arr + )); + return $o; + } -- cgit v1.2.3