I use Unloggedin Menu, how i can change the search query "/search?type=groups" in that way, that not logged in users become only public groups displayed and that the query "/search?type=groups&q=private" also show no results for non logged in users?
.
<?php
function groups_search_handler($hook, $type, $return, $params) {
$groups = new OssnGroup();
if(ossn_isLoggedin()) {
$data = $groups->searchGroups($params['q']);
$count = $groups->searchGroups($params['q'], array(
'count' => true,
));
} else {
$data = $groups->searchGroups($params['q'], array(
'entities_pairs' => array(
array(
'name' => 'membership',
'value' => OSSN_PUBLIC,
),
),
));
$count = $groups->searchGroups($params['q'], array(
'count' => true,
'entities_pairs' => array(
array(
'name' => 'membership',
'value' => OSSN_PUBLIC,
),
),
));
}
$group['groups'] = $data;
$search = ossn_plugin_view('groups/search/view', $group);
$search .= ossn_view_pagination($count);
if(empty($data)) {
return ossn_print('ossn:search:no:result');
}
return $search;
}
I beleive like this you need to change handler.
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)