![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
02/03/2008, 07:45
|
![Avatar de salbatore](http://static.forosdelweb.com/customavatars/avatar175308_4.gif) | | | Fecha de Ingreso: abril-2007 Ubicación: Springfield
Mensajes: 1.567
Antigüedad: 17 años, 10 meses Puntos: 19 | |
Re: Problemilla con un buscador El codigo da Salbatore:
<?php
$isearch_path = '.';
$isearch_get_post_vars = array(
'action',
's',
's_all',
's_any',
's_exact',
's_without',
'page',
'internet',
'utf8',
'group',
'groups',
'partial',
'advanced',
);
define('IN_ISEARCH', true);
require_once "$isearch_path/inc/core.inc.php";
require_once "$isearch_path/inc/search.inc.php";
/* Open the search component (read only) */
isearch_open(True);
if (!isset($advanced))
{
$advanced = False;
}
if (!isset($partial))
{
$partial = $isearch_config['search_partial'];
}
if (isset($s_all))
{
/* Using advanced search form. Build up search string. */
$s = '';
$s_without = isearch_cleanSearchString($s_without);
if ($s_all != '')
{
$s .= '+' . str_replace(' ', '+', $s_all);
}
$s_any = isearch_cleanSearchString($s_any);
if ($s_any != '')
{
$s .= ' ' . $s_any;
}
$s_all = isearch_cleanSearchString($s_all);
if ($s_all != '')
{
$s .= '-' . str_replace(' ', '-', $s_without);
}
}
if (isset($internet))
{
$s = urlencode(isearch_cleanSearchString($s));
header( "Location: http://www.iSearchTheNet.com/search.php?s=$s&lang=" . $isearch_config['lang_name'] . "&style=" . $isearch_config['style_name'] );
/* Close the search component */
isearch_close();
exit; /*** EXIT ***/
}
/* Check the action and set the page title accordingly */
if (isset($action))
{
$isearch_pageTitle = $isearch_lang['results_title'];
}
else
{
$isearch_pageTitle = $isearch_lang['search_title'];
}
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE>' . $isearch_pageTitle . '</TITLE>
<META HTTP-EQUIV="Content-Type" content="text/html; charset=' . $isearch_config['char_set'] . '">
<META HTTP-EQUIV="Content-Language" CONTENT="' . $isearch_languageCode . '">
<META NAME="author" CONTENT="Ian Willis">
<META NAME="copyright" CONTENT="Copyright Ian Willis. All rights reserved.">
<LINK REL=StyleSheet HREF="' . $isearch_path . '/style/' . $isearch_config['style_name'] . '.css" TYPE="text/css">
</HEAD>
<BODY onLoad="self.focus();">
';
include("$isearch_path/inc/header.inc.php");
echo "
<H1 class=\"isearch\">$isearch_pageTitle</H1>\n
";
if (!isset($s))
{
/* We do not have a search string to process */
$s = '';
}
else
{
/* Process the search form data */
if ($isearch_config['char_set'] == "utf-8")
{
$s = utf8_decode($s);
}
/* Clean the search strings */
$s = isearch_cleanSearchString($s);
if (isset($groups))
{
$group = '';
foreach ($groups as $g)
{
if ($g == 'isearch_all')
{
$group = '';
break;
}
if ($group != '')
{
$group .= ',';
}
$group .= $g;
}
}
else if (!isset($group) || ($group == 'isearch_all'))
{
/* Search all groups */
$group = '';
}
isearch_find($s, $group, $partial);
if (!isset($page))
{
$page = 1;
}
isearch_showResults($page);
}
/* Display the search form */
require_once "$isearch_path/inc/form_internal.inc.php";
/* Close the search component */
isearch_close();
include "$isearch_path/inc/footer.inc.php";
;echo '</BODY>
</HTML>
';
?> |