change photo paths relative to current directory server

This commit is contained in:
redmatrix 2015-06-03 22:40:54 -07:00
parent 3e05ac762e
commit 2be31c767c
2 changed files with 3 additions and 3 deletions

View file

@ -31,7 +31,7 @@ function lsearch_init(&$a) {
if(count($r)) {
foreach($r as $rr)
$results[] = array('name' => $rr['name'], 'url' => $rr['homepage'], 'photo' => $rr['photo'], 'tags' => $rr['tags']);
$results[] = array('name' => $rr['name'], 'url' => $rr['homepage'], 'photo' => $a->get_baseurl() . '/photo/' . $rr['id'], 'tags' => $rr['tags']);
}
$output = array('total' => $total, 'items_page' => $perpage, 'page' => $page + 1, 'results' => $results);

View file

@ -16,7 +16,7 @@ function msearch_post(&$a) {
if(count($r))
$total = $r[0]['total'];
$r = q("SELECT MATCH `tags` AGAINST ('%s') AS `score`, `name`, `homepage`,`photo`,`tags` FROM `profile` WHERE MATCH `tags` AGAINST ('%s') ORDER BY `score` DESC LIMIT %d , %d ",
$r = q("SELECT MATCH `tags` AGAINST ('%s') AS `score`, `id`, `name`, `homepage`,`photo`,`tags` FROM `profile` WHERE MATCH `tags` AGAINST ('%s') ORDER BY `score` DESC LIMIT %d , %d ",
dbesc($search),
dbesc($search),
intval($startrec),
@ -26,7 +26,7 @@ function msearch_post(&$a) {
$results = array();
if(count($r)) {
foreach($r as $rr)
$results[] = array('name' => $rr['name'], 'url' => $rr['homepage'], 'photo' => $rr['photo'], 'tags' => $rr['tags']);
$results[] = array('name' => $rr['name'], 'url' => $rr['homepage'], 'photo' => $a->get_baseurl() . '/photo/' . $rr['id'], 'tags' => $rr['tags']);
}
$output = array('total' => $total, 'items_page' => $perpage, 'page' => $page + 1, 'results' => $results);