35 header(
'Location: ' . XOOPS_URL .
'/index.php');
39 if (!empty(
$_GET[
'action'])) {
41 }
else if (!empty(
$_POST[
'action'])) {
45 if (!empty(
$_GET[
'query'])) {
47 }
else if (!empty(
$_POST[
'query'])) {
51 if (!empty(
$_GET[
'andor'])) {
53 }
else if (!empty(
$_POST[
'andor'])) {
57 if (!empty(
$_GET[
'mid'])) {
59 }
else if (!empty(
$_POST[
'mid'])) {
62 if (!empty(
$_GET[
'uid'])) {
64 }
else if (!empty(
$_POST[
'uid'])) {
67 if (!empty(
$_GET[
'start'])) {
69 }
else if (!empty(
$_POST[
'start'])) {
80 }
else if (
$action ==
"showall") {
85 }
else if (
$action ==
"showallbyuser") {
96 include
$GLOBALS[
'xoops']->path(
'header.php');
97 include
$GLOBALS[
'xoops']->path(
'include/searchform.php');
99 include
$GLOBALS[
'xoops']->path(
'footer.php');
107 if (
$action !=
'showallbyuser') {
109 $ignored_queries = array();
110 $temp_queries = preg_split(
'/[\s,]+/',
$query);
111 foreach ($temp_queries as $q) {
116 $ignored_queries[] =
$myts->addSlashes($q);
142 $mids = array_keys($modules);
145 include
$GLOBALS[
'xoops']->path(
'header.php');
151 echo
' <strong>' . htmlspecialchars(stripslashes($q)) .
'</strong>';
153 if (!empty($ignored_queries)) {
156 foreach ($ignored_queries as $q) {
157 echo
' <strong>' . htmlspecialchars(stripslashes($q)) .
'</strong>';
161 echo
' "<strong>' . htmlspecialchars(stripslashes(
$queries[0])) .
'</strong>"';
169 $count = count($results);
170 if (is_array($results) && $count > 0) {
172 echo
"<h4>" .
$module->getVar(
'name') .
"</h4>";
173 for(
$i = 0;
$i < $count;
$i++) {
174 if (isset($results[
$i][
'image']) && $results[$i][
'image'] !=
"") {
175 echo
"<img src='modules/" .
$module->getVar(
'dirname') .
"/" . $results[
$i][
'image'] .
"' alt='" .
$module->getVar(
'name') .
"' /> ";
177 echo
"<img style='width:26px; height:26px;' src='images/icons/posticon2.gif' alt='" .
$module->getVar(
'name') .
"' /> ";
179 if (!preg_match(
"/^http[s]*:\/\//i", $results[$i][
'link'])) {
180 $results[
$i][
'link'] =
"modules/" .
$module->getVar(
'dirname') .
"/" . $results[
$i][
'link'];
182 echo
"<strong><a href='" . $results[
$i][
'link'] .
"' title=''>" .
$myts->htmlspecialchars($results[$i][
'title']) .
"</a></strong><br />\n";
183 echo
"<span class='x-small'>";
184 $results[
$i][
'uid'] = @intval($results[$i][
'uid']);
185 if (!empty($results[$i][
'uid'])) {
187 echo
" <a href='" . XOOPS_URL .
"/userinfo.php?uid=" . $results[
$i][
'uid'] .
"' title=''>" .
$uname .
"</a>\n";
189 echo !empty($results[$i][
'time']) ?
" (" .
formatTimestamp(intval($results[$i][
'time'])) .
")" :
"";
190 echo
"</span><br />\n";
193 $search_url = XOOPS_URL .
'/search.php?query=' . urlencode(stripslashes(implode(
' ',
$queries)));
194 $search_url .=
"&mid={$mid}&action=showall&andor={$andor}";
195 echo
'<p><a href="' . htmlspecialchars($search_url) .
'" title="' .
_SR_SHOWALLR .
'">' .
_SR_SHOWALLR .
'</a></p>';
205 include
$GLOBALS[
'xoops']->path(
'include/searchform.php');
210 case 'showallbyuser':
211 include
$GLOBALS[
'xoops']->path(
'header.php');
215 $count = count($results);
216 if (is_array($results) && $count > 0) {
218 $next_count = count($next_results);
220 if (is_array($next_results) && $next_count == 1) {
228 echo
' <strong>' . htmlspecialchars(stripslashes($q)) .
'</strong>';
231 echo
' "<strong>' . htmlspecialchars(stripslashes(
$queries[0])) .
'</strong>"';
236 echo
"<h5>" .
$module->getVar(
'name') .
"</h5>";
237 for (
$i = 0;
$i < $count;
$i ++) {
238 if (isset($results[
$i][
'image']) && $results[$i][
'image'] !=
'') {
239 echo
"<img src='modules/" .
$module->getVar(
'dirname',
"n") .
"/" . $results[
$i][
'image'] .
"' alt='" .
$module->getVar(
'name') .
"' /> ";
241 echo
"<img style='width:26px; height:26px;' src='images/icons/posticon2.gif' alt='" .
$module->getVar(
"name") .
"' /> ";
243 if (!preg_match(
"/^http[s]*:\/\//i", $results[$i][
'link'])) {
244 $results[
$i][
'link'] =
"modules/" .
$module->getVar(
'dirname') .
"/" . $results[
$i][
'link'];
246 echo
"<strong><a href='" . $results[
$i][
'link'] .
"'>" .
$myts->htmlspecialchars($results[$i][
'title']) .
"</a></strong><br />\n";
247 echo
"<span class='x-small'>";
248 $results[
$i][
'uid'] = @intval($results[$i][
'uid']);
249 if (!empty($results[$i][
'uid'])) {
251 echo
" <a href='" . XOOPS_URL .
"/userinfo.php?uid=" . $results[
$i][
'uid'] .
"'>" .
$uname .
"</a>\n";
253 echo !empty($results[$i][
'time']) ?
" (" .
formatTimestamp(intval($results[$i][
'time'])) .
")" :
"";
254 echo
"</span><br />\n";
257 $search_url = XOOPS_URL .
'/search.php?query=' . urlencode(stripslashes(implode(
' ',
$queries)));
258 $search_url .=
"&mid={$mid}&action={$action}&andor={$andor}";
259 if (
$action ==
'showallbyuser') {
260 $search_url .=
"&uid={$uid}";
264 echo
'<td align="left">';
265 $search_url_prev = $search_url .
"&start={$prev}";
266 echo
'<a href="' . htmlspecialchars($search_url_prev) .
'">' .
_SR_PREVIOUS .
'</a></td>';
268 echo
'<td> </td>';
269 if (
false != $has_next) {
271 $search_url_next = $search_url .
"&start={$next}";
272 echo
'<td align="right"><a href="' . htmlspecialchars($search_url_next) .
'">' .
_SR_NEXT .
'</a></td>';
274 echo
'</tr></table>';
278 include
$GLOBALS[
'xoops']->path(
'include/searchform.php');
282 include
$GLOBALS[
'xoops']->path(
'footer.php');