X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=mod%2Fsuggest.php;h=00033b2d246feba8b84f961dc4edf4a8587844aa;hb=75be187216255c7c45421cb5f9596118a954f878;hp=a86b412b3235e7484d9a6fe9f92e412e84b64bb7;hpb=488a38cd85bc349d5bc5f5d9541613ccec1f1806;p=friendica.git
diff --git a/mod/suggest.php b/mod/suggest.php
index a86b412b32..00033b2d24 100644
--- a/mod/suggest.php
+++ b/mod/suggest.php
@@ -36,7 +36,7 @@ function suggest_init(&$a) {
}
// Now check how the user responded to the confirmation query
if(!$_REQUEST['canceled']) {
- q("insert into gcign ( uid, gcid ) values ( %d, %d ) ",
+ q("INSERT INTO `gcign` ( `uid`, `gcid` ) VALUES ( %d, %d ) ",
intval(local_user()),
intval($_GET['ignore'])
);
@@ -44,13 +44,15 @@ function suggest_init(&$a) {
}
}
-
+
function suggest_content(&$a) {
+ require_once("mod/proxy.php");
+
$o = '';
if(! local_user()) {
notice( t('Permission denied.') . EOL);
@@ -59,11 +61,8 @@ 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') . '
';
+ $a->page['aside'] .= follow_widget();
$r = suggestion_query(local_user());
@@ -73,25 +72,49 @@ function suggest_content(&$a) {
return $o;
}
- $tpl = get_markup_template('suggest_friends.tpl');
+ require_once 'include/contact_selectors.php';
foreach($r as $rr) {
- $connlnk = $a->get_baseurl() . '/follow/?url=' . (($rr['connect']) ? $rr['connect'] : $rr['url']);
-
- $o .= replace_macros($tpl,array(
- '$url' => zrl($rr['url']),
- '$name' => $rr['name'],
- '$photo' => $rr['photo'],
- '$ignlnk' => $a->get_baseurl() . '/suggest?ignore=' . $rr['id'],
- '$ignid' => $rr['id'],
- '$conntxt' => t('Connect'),
- '$connlnk' => $connlnk,
- '$ignore' => t('Ignore/Hide')
- ));
+ $connlnk = $a->get_baseurl() . '/follow/?url=' . (($rr['connect']) ? $rr['connect'] : $rr['url']);
+ $ignlnk = $a->get_baseurl() . '/suggest?ignore=' . $rr['id'];
+ $photo_menu = array(
+ 'profile' => array(t("View Profile"), zrl($rr["url"])),
+ 'follow' => array(t("Connect/Follow"), $connlnk),
+ 'hide' => array(t('Ignore/Hide'), $ignlnk)
+ );
+
+ $contact_details = get_contact_details_by_url($rr["url"], local_user(), $rr);
+
+ $entry = array(
+ 'url' => zrl($rr['url']),
+ 'itemurl' => (($contact_details['addr'] != "") ? $contact_details['addr'] : $rr['url']),
+ 'img_hover' => $rr['url'],
+ 'name' => $contact_details['name'],
+ 'thumb' => proxy_url($contact_details['thumb'], false, PROXY_SIZE_THUMB),
+ 'details' => $contact_details['location'],
+ 'tags' => $contact_details['keywords'],
+ 'about' => $contact_details['about'],
+ 'account_type' => (($contact_details['community']) ? t('Forum') : ''),
+ 'ignlnk' => $ignlnk,
+ 'ignid' => $rr['id'],
+ 'conntxt' => t('Connect'),
+ 'connlnk' => $connlnk,
+ 'photo_menu' => $photo_menu,
+ 'ignore' => t('Ignore/Hide'),
+ 'network' => network_to_name($rr['network'], $rr['url']),
+ 'id' => ++$id,
+ );
+ $entries[] = $entry;
}
- $o .= cleardiv();
-// $o .= paginate($a);
+ $tpl = get_markup_template('viewcontact_template.tpl');
+
+ $o .= replace_macros($tpl,array(
+ '$title' => t('Friend Suggestions'),
+ '$contacts' => $entries,
+
+ ));
+
return $o;
}