Hi All,
I'm having a lot of trouble with this one. I would like to also make search consider wall posts and comments. Where should I be working?
Thank you,
Jason
While I feel like I'm getting closer to working this out, I'm getting some results that I just don't understand. So far I have cloned into /components/OssnComments/classes/OssnComments.php
public function searchComments($q, array $args = array()) {
$params['from'] = 'ossn_object';
$params['type'] = 'user';
$params['subtype'] = 'wall';
$params['wheres'] = array(
"(title LIKE '%{$q}%' OR description LIKE '%{$q}%')"
);
$vars = array_merge($params, $args);
$search = $this->searchObject($vars, true);
if(!$search) {
return false;
}
if($vars['count'] === true) {
return $search;
}
foreach($search as $comment) {
$commententity[] = ossn_get_comment($comment->guid);
}
$data = $commententity;
return $data;
}
In /components/OssnComments/ossn_com.php I have added
ossn_add_hook('search', 'type:wall', 'comment_search_handler');
function comment_search_handler($hook, $type, $return, $params) {
$comments = new OssnComments;
$data = $comments->searchComments($params['q']);
$count = $comments->searchComments($params['q'], array(
'count' => true
));
$comment['user'] = $data;
$search = ossn_plugin_view('user/search/view', $comment);
$search .= ossn_view_pagination($count);
if(empty($data)) {
return ossn_print('ossn:search:no:result');
}
return $search;
}
and when my url is http://www.site,com/search?type=wall&q=hello
I get this
Exception: Call to undefined method OssnComments:searchObject in /home/hostname/public_html/classes/OssnBase.php:74 Stack trace:#0 /home/hostname/public_html/components/OssnComments/classes/OssnComments.php(27): OssnBase->__call('searchObject', Array)#1 /home/hostname/public_html/components/OssnComments/ossn_com.php(58): OssnComments->searchComments('hello')#2 /home/hostname/public_html/libraries/ossn.lib.system.php(223): comment_search_handler('search', 'type:wall', NULL, Array)#3 /home/hostname/public_html/components/OssnSearch/ossn_com.php(45): ossn_call_hook('search', 'type:wall', Array)#4 /home/hostname/public_html/libraries/ossn.lib.page.php(67): ossn_search_page(Array, 'search')#5 /home/hostname/public_html/index.php(22): ossn_load_page('search, Array)#6 {main}
What am I missing or doing wrong? Please.
Thank You,
Jason
Due to the many requests in the past for additonal features and components we have decided to develope a premium version. Features like Hashtags, Videos, Polls, Events, Stories, Link Preview, etc included in it.
$199 (Life Time)