get rid of html from mod_suggest

This commit is contained in:
friendica
2013-03-06 17:52:58 -08:00
parent b32b0102f7
commit 5a9dae78a2
5 changed files with 58 additions and 32 deletions

View File

@@ -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 .= '<h2>' . t('Friend Suggestions') . '</h2>';
$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;
}