%
DIM texto
DIM palabras
DIM cantpalabras
DIM SQLwhere
DIM conn
DIM cursor
DIM Estan_buscando_contengan
DIM ListaEstan_buscando_contengan
set conn=NEW clsBaseDeDatos
set cursor=NEW clsCursor
set Estan_buscando_contengan = NEW clsEstan_buscando_contengan
set ListaEstan_buscando_contengan = NEW clsListaEstan_buscando_contengan
conn.abrir K_CONNECTION_STRING_MAIN
texto=trim(request("textobusqueda"))
SQLwhere = " Match(cabeza) against ('" & texto & "') OR Match(comentario) against ('" & texto & "') OR Match(claves) against ('" & texto & "') "
cursor.abrir conn, "SELECT calif, califs, (Match(cabeza) against ('" & texto & "') + Match(comentario) against ('" & texto & "') + Match(claves) against ('" & texto & "')) as relevancia, r.id, r.cabeza, left(r.comentario," & K_CANT_CARACTERES_TEXTO_FICHITA & ") as comentario , r.categoria, c.nombre, r.visitas FROM Recetas r LEFT JOIN Categorias c ON r.categoria=c.id WHERE " & SQLwhere& " ORDER BY relevancia DESC LIMIT 0,20", adOpenForwardOnly
' Loguear la búsqueda
Estan_buscando_contengan.ingrediente = texto
ListaEstan_buscando_contengan.additem Estan_buscando_contengan
session("title")="Recetas de postres con " & texto
session("description")="Listado de recetas de postres que en su texto contienen la clave " & texto
%>
<%
if cursor.eof then
%>
No hemos encontrado recetas con el texto "<%=texto%>".
<%
else
if instr(texto," ")>0 then
%>
Recetas que contienen las palabras: "<%=texto%>"
<%
else
%>
Recetas que contienen la palabra: "<%=texto%>"
<%
end if
end if
%>
<%
BloqueLinks468x60()
%>
<%
if ExisteArchivo( "imagenes/categoria" & id & ".gif") then
%>
<%
end if
%>
|
<%
reg=1 'Nº de registro en el que estoy
while not cursor.eof
if reg mod 2=1 then response.write ""
%>
|
<%
randomize
randomize
FichitaReceta cursor.campo("id"),cursor.campo("cabeza"), cursor.campo("comentario"), cursor.campo("calif"), cursor.campo("califs")
cursor.movenext
%>
|
<%
reg = reg +1 'Siguiente registro
if reg mod 2=1 then response.write " "
wend
if reg mod 2=1 then response.write ""
%>
|
<%
%>
|
<%
reg = reg +1 'Siguiente registro
if reg mod 2=1 then response.write " "
cursor.cerrar
set cursor=nothing
conn.cerrar
set conn=nothing
set Estan_buscando_contengan = nothing
set ListaEstan_buscando_contengan = nothing
%>
|
<% AdSense120x600_vertical_listados() %>
<% AdSense120x600_vertical_listados() %>
|
[ Volver ]