mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 06:30:59 +01:00
Fixed the search capability
This commit is contained in:
parent
898a4bfca7
commit
9ffc5efc0c
@ -51,6 +51,8 @@
|
||||
|
||||
if (! $start) $start = 0;
|
||||
|
||||
if (! $query_result) $query_result = 0;
|
||||
|
||||
$orderby = "";
|
||||
if ($order)
|
||||
{
|
||||
@ -68,6 +70,27 @@
|
||||
}
|
||||
}
|
||||
|
||||
if ($search || $next) {
|
||||
if ($search) {
|
||||
$query_result = 0;
|
||||
} else
|
||||
$query_result++;
|
||||
$phpgw->db->query("SELECT name FROM newsgroups WHERE active='Y'$orderby");
|
||||
$j = 0;
|
||||
$i = 0;
|
||||
while($phpgw->db->next_record())
|
||||
{
|
||||
if (stristr($phpgw->db->f("name"),$query)) {
|
||||
if($i==$query_result) {
|
||||
$start = $j;
|
||||
break;
|
||||
} else
|
||||
$i++;
|
||||
}
|
||||
$j++;
|
||||
}
|
||||
}
|
||||
|
||||
$phpgw->db->query("SELECT con, name FROM newsgroups WHERE active='Y'$orderby LIMIT "
|
||||
.$phpgw->nextmatchs->sql_limit($start));
|
||||
|
||||
@ -85,7 +108,12 @@
|
||||
. "<input type=\"hidden\" name=\"tg\" value=\"".$tg."\">\n"
|
||||
. "<input type=\"hidden\" name=\"usercon\" value=\"".$usercon."\">\n"
|
||||
. "<input type=\"hidden\" name=\"order\" value=\"".$order."\">\n"
|
||||
. "<input type=\"hidden\" name=\"sort\" value=\"".$sort."\">\n";
|
||||
. "<input type=\"hidden\" name=\"sort\" value=\"".$sort."\">\n"
|
||||
. "<input type=\"hidden\" name=\"query_result\" value=\"".$query_result."\">\n";
|
||||
|
||||
$t->set_var("search_value",$query);
|
||||
$t->set_var("search",lang_common("search"));
|
||||
$t->set_var("next",lang_nntp("next"));
|
||||
|
||||
$t->set_var("nml",$phpgw->nextmatchs->left( $urlname,
|
||||
$start,
|
||||
|
Loading…
Reference in New Issue
Block a user