aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-03-05 21:00:25 -0800
committerfriendica <info@friendica.com>2013-03-05 21:00:25 -0800
commit4062be28699eb5fba93ff43ffb4d3e9ed7c4af6c (patch)
tree0b5a625703008a7dd7c4dda2590b6585b3380384 /mod
parentfbda9ababc76c103d82118a8f3cf24e619bfb80d (diff)
downloadvolse-hubzilla-4062be28699eb5fba93ff43ffb4d3e9ed7c4af6c.tar.gz
volse-hubzilla-4062be28699eb5fba93ff43ffb4d3e9ed7c4af6c.tar.bz2
volse-hubzilla-4062be28699eb5fba93ff43ffb4d3e9ed7c4af6c.zip
basic friend suggestions (but not "new to the network and have no friends at all" suggestions)
Diffstat (limited to 'mod')
-rw-r--r--mod/suggest.php21
1 files changed, 10 insertions, 11 deletions
diff --git a/mod/suggest.php b/mod/suggest.php
index 4aed2e61a..a5de5da04 100644
--- a/mod/suggest.php
+++ b/mod/suggest.php
@@ -8,10 +8,10 @@ function suggest_init(&$a) {
if(! local_user())
return;
- if(x($_GET,'ignore') && intval($_GET['ignore'])) {
- q("insert into gcign ( uid, gcid ) values ( %d, %d ) ",
+ if(x($_GET,'ignore')) {
+ q("insert into xign ( uid, xchan ) values ( %d, '%s' ) ",
intval(local_user()),
- intval($_GET['ignore'])
+ dbesc($_GET['ignore'])
);
}
@@ -37,10 +37,9 @@ function suggest_content(&$a) {
$o .= '<h2>' . t('Friend Suggestions') . '</h2>';
+ $r = suggestion_query(local_user(),get_observer_hash());
- $r = suggestion_query(local_user());
-
- if(! count($r)) {
+ if(! $r) {
$o .= t('No suggestions available. If this is a new site, please try again in 24 hours.');
return $o;
}
@@ -49,13 +48,13 @@ function suggest_content(&$a) {
foreach($r as $rr) {
- $connlnk = $a->get_baseurl() . '/follow/?url=' . (($rr['connect']) ? $rr['connect'] : $rr['url']);
+ $connlnk = $a->get_baseurl() . '/follow/?url=' . $rr['xchan_addr'];
$o .= replace_macros($tpl,array(
- '$url' => zid($rr['url']),
- '$name' => $rr['name'],
- '$photo' => $rr['photo'],
- '$ignlnk' => $a->get_baseurl() . '/suggest?ignore=' . $rr['id'],
+ '$url' => zid($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')