2 include_once('include/text.php');
4 function match_content(&$a) {
10 $_SESSION['return_url'] = $a->get_baseurl() . '/' . $a->cmd;
12 $o .= replace_macros(get_markup_template("section_title.tpl"),array(
13 '$title' => t('Profile Match')
16 $r = q("SELECT `pub_keywords`, `prv_keywords` FROM `profile` WHERE `is-default` = 1 AND `uid` = %d LIMIT 1",
21 if(! $r[0]['pub_keywords'] && (! $r[0]['prv_keywords'])) {
22 notice( t('No keywords to match. Please add keywords to your default profile.') . EOL);
28 $tags = trim($r[0]['pub_keywords'] . ' ' . $r[0]['prv_keywords']);
32 if($a->pager['page'] != 1)
33 $params['p'] = $a->pager['page'];
35 if(strlen(get_config('system','directory_submit_url')))
36 $x = post_url('http://dir.friendica.com/msearch', $params);
38 $x = post_url($a->get_baseurl() . '/msearch', $params);
43 $a->set_pager_total($j->total);
44 $a->set_pager_itemspage($j->items_page);
47 if(count($j->results)) {
51 $tpl = get_markup_template('match.tpl');
52 foreach($j->results as $jj) {
53 $match_nurl = normalise_link($jj->url);
54 $match = q("SELECT `nurl` FROM `contact` WHERE `uid` = '%d' AND nurl='%s' LIMIT 1",
59 $connlnk = $a->get_baseurl() . '/follow/?url=' . $jj->url;
60 $o .= replace_macros($tpl,array(
61 '$url' => zrl($jj->url),
63 '$photo' => proxy_url($jj->photo),
64 '$inttxt' => ' ' . t('is interested in:'),
65 '$conntxt' => t('Connect'),
66 '$connlnk' => $connlnk,
73 info( t('No matches') . EOL);