2 include_once('include/text.php');
3 require_once('include/socgraph.php');
4 require_once('include/contact_widgets.php');
5 require_once('mod/proxy.php');
7 function match_content(&$a) {
13 $a->page['aside'] .= follow_widget();
14 $a->page['aside'] .= findpeople_widget();
16 $_SESSION['return_url'] = $a->get_baseurl() . '/' . $a->cmd;
18 $o .= replace_macros(get_markup_template("section_title.tpl"),array(
19 '$title' => t('Profile Match')
22 $r = q("SELECT `pub_keywords`, `prv_keywords` FROM `profile` WHERE `is-default` = 1 AND `uid` = %d LIMIT 1",
27 if(! $r[0]['pub_keywords'] && (! $r[0]['prv_keywords'])) {
28 notice( t('No keywords to match. Please add keywords to your default profile.') . EOL);
34 $tags = trim($r[0]['pub_keywords'] . ' ' . $r[0]['prv_keywords']);
38 if($a->pager['page'] != 1)
39 $params['p'] = $a->pager['page'];
41 if(strlen(get_config('system','directory')))
42 $x = post_url(get_server().'/msearch', $params);
44 $x = post_url($a->get_baseurl() . '/msearch', $params);
49 $a->set_pager_total($j->total);
50 $a->set_pager_itemspage($j->items_page);
53 if(count($j->results)) {
57 $tpl = get_markup_template('match.tpl');
58 foreach($j->results as $jj) {
59 $match_nurl = normalise_link($jj->url);
60 $match = q("SELECT `nurl` FROM `contact` WHERE `uid` = '%d' AND nurl='%s' LIMIT 1",
64 $jj->photo = str_replace("http:///photo/", get_server()."/photo/", $jj->photo);
65 $connlnk = $a->get_baseurl() . '/follow/?url=' . $jj->url;
66 $o .= replace_macros($tpl,array(
67 '$url' => zrl($jj->url),
69 '$photo' => proxy_url($jj->photo, false, PROXY_SIZE_THUMB),
70 '$inttxt' => ' ' . t('is interested in:'),
71 '$conntxt' => t('Connect'),
72 '$connlnk' => $connlnk,
78 info( t('No matches') . EOL);