2 include_once('include/text.php');
3 require_once('include/socgraph.php');
4 require_once('include/contact_widgets.php');
6 function match_content(&$a) {
12 $a->page['aside'] .= follow_widget();
13 $a->page['aside'] .= findpeople_widget();
15 $_SESSION['return_url'] = $a->get_baseurl() . '/' . $a->cmd;
17 $o .= replace_macros(get_markup_template("section_title.tpl"),array(
18 '$title' => t('Profile Match')
21 $r = q("SELECT `pub_keywords`, `prv_keywords` FROM `profile` WHERE `is-default` = 1 AND `uid` = %d LIMIT 1",
26 if(! $r[0]['pub_keywords'] && (! $r[0]['prv_keywords'])) {
27 notice( t('No keywords to match. Please add keywords to your default profile.') . EOL);
33 $tags = trim($r[0]['pub_keywords'] . ' ' . $r[0]['prv_keywords']);
37 if($a->pager['page'] != 1)
38 $params['p'] = $a->pager['page'];
40 if(strlen(get_config('system','directory')))
41 $x = post_url(get_server().'/msearch', $params);
43 $x = post_url($a->get_baseurl() . '/msearch', $params);
48 $a->set_pager_total($j->total);
49 $a->set_pager_itemspage($j->items_page);
52 if(count($j->results)) {
56 $tpl = get_markup_template('match.tpl');
57 foreach($j->results as $jj) {
58 $match_nurl = normalise_link($jj->url);
59 $match = q("SELECT `nurl` FROM `contact` WHERE `uid` = '%d' AND nurl='%s' LIMIT 1",
63 $jj->photo = str_replace("http:///photo/", get_server()."/photo/", $jj->photo);
64 $connlnk = $a->get_baseurl() . '/follow/?url=' . $jj->url;
65 $o .= replace_macros($tpl,array(
66 '$url' => zrl($jj->url),
68 '$photo' => proxy_url($jj->photo),
69 '$inttxt' => ' ' . t('is interested in:'),
70 '$conntxt' => t('Connect'),
71 '$connlnk' => $connlnk,
77 info( t('No matches') . EOL);