link suggestions into the main code

This commit is contained in:
Friendika 2011-11-01 21:27:11 -07:00
parent 158028a0ac
commit e38aa67263
4 changed files with 11 additions and 0 deletions

View file

@ -32,9 +32,11 @@ function findpeople_widget() {
'$label' => t('Connect/Follow'), '$label' => t('Connect/Follow'),
'$hint' => t('Examples: Robert Morgenstein, Fishing'), '$hint' => t('Examples: Robert Morgenstein, Fishing'),
'$findthem' => t('Find'), '$findthem' => t('Find'),
'$suggest' => t('Friend Suggestions'),
'$similar' => t('Similar Interests'), '$similar' => t('Similar Interests'),
'$inv' => $inv '$inv' => $inv
)); ));
} }

View file

@ -165,6 +165,9 @@ function common_friends($uid,$cid) {
function suggestion_query($uid, $start = 0, $limit = 40) { function suggestion_query($uid, $start = 0, $limit = 40) {
if(! $uid)
return array();
$r = q("SELECT count(glink.gcid) as `total`, gcontact.* from gcontact $r = q("SELECT count(glink.gcid) as `total`, gcontact.* from gcontact
left join glink on glink.gcid = gcontact.id left join glink on glink.gcid = gcontact.id
where uid = %d and not gcontact.nurl in ( select nurl from contact where uid = %d) where uid = %d and not gcontact.nurl in ( select nurl from contact where uid = %d)

View file

@ -1,6 +1,7 @@
<?php <?php
require_once('include/socgraph.php'); require_once('include/socgraph.php');
require_once('include/contact_widgets.php');
function suggest_content(&$a) { function suggest_content(&$a) {
@ -10,6 +11,10 @@ function suggest_content(&$a) {
return; return;
} }
$a->page['aside'] .= follow_widget();
$a->page['aside'] .= findpeople_widget();
$o .= '<h2>' . t('Friend Suggestions') . '</h2>'; $o .= '<h2>' . t('Friend Suggestions') . '</h2>';

View file

@ -5,6 +5,7 @@
<input id="side-peoplefind-url" type="text" name="search" size="24" title="$hint" /><input id="side-peoplefind-submit" type="submit" name="submit" value="$findthem" /> <input id="side-peoplefind-url" type="text" name="search" size="24" title="$hint" /><input id="side-peoplefind-submit" type="submit" name="submit" value="$findthem" />
</form> </form>
<div class="side-link" id="side-match-link"><a href="match" >$similar</a></div> <div class="side-link" id="side-match-link"><a href="match" >$similar</a></div>
<div class="side-link" id="side-suggest-link"><a href="suggest" >$suggest</a></div>
{{ if $inv }} {{ if $inv }}
<div class="side-link" id="side-invite-link" ><a href="invite" >$inv</a></div> <div class="side-link" id="side-invite-link" ><a href="invite" >$inv</a></div>
{{ endif }} {{ endif }}