|
|
[Perlfect-search] Re: Results
Charles Chilcote perlfect-search@perlfect.com
Thu, 5 Feb 2004 16:15:15 -0500
This is a multi-part message in MIME format.
------=_NextPart_000_0033_01C3EC03.3DAB4F40
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
>
>Thanks for your help with indexing PDFs. It now works.
>
>Is there any way of changing the number of results per page? Also can =
it =3D
>be customized so PDFs open in a new window, ie add target=3D3D"_blank" =
to =3D
>the PDF's A tag?
>
>cheers
>
>
Greetings,
I also wanted the pdf links to open in a new window. Although I imagine =
this isn't the prettiest code, it seems to get the job done. =20
I suppose an extension list variable could be created in the conf.pl =
file to determine what file types would cause a new window, and then use =
that for the comparison instead the hard-coded "pdf" value below.
I added this code to the cast_template subroutine. Red=3DNew, =
Blue=3DOriginal=20
my $cscext =3D get_suffix($url);
if($cscext ne "pdf") {
$template->cast_loop ("results", [{rank =3D> $first+(++$rank),=20
url =3D> $url,
highlight_link =3D> $highlight_link,
visibleurl =3D> $visible_url,=20
title =3D> $title,=20
date =3D> $date,=20
score =3D> $score,
description =3D> $desc,
size =3D> sprintf("%.0f", $sizes_db{$_}/1000) || =
1,
}]);
}
else {
my $blankpage =3D '" target=3D"_blank';
$template->cast_loop ("results", [{rank =3D> $first+(++$rank),=20
url =3D> $url . $blankpage,
highlight_link =3D> $highlight_link,
visibleurl =3D> $visible_url,=20
title =3D> $title,=20
date =3D> $date,=20
score =3D> $score,
description =3D> $desc,
size =3D> sprintf("%.0f", $sizes_db{$_}/1000) || =
1,
}]); =20
}
Charles Chilcote
Programmer/Analyst
Nitterhouse Concrete Products, Inc.
http://www.nitterhouse.com/Home.html
------=_NextPart_000_0033_01C3EC03.3DAB4F40
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV>
<DIV>><BR>>Thanks for your help with indexing PDFs. It now =
works.</DIV>
<DIV>><BR>>Is there any way of changing the number of results per =
page?=20
Also can it =3D<BR>>be customized so PDFs open in a new window, ie =
add=20
target=3D3D"_blank" to =3D<BR>>the PDF's A tag?</DIV>
<DIV>><BR>>cheers<BR>></DIV>
<DIV>></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>Greetings,</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>I also wanted the pdf links to open in a new=20
window. </FONT><FONT size=3D2>Although I imagine this isn't the =
prettiest=20
code, it seems to get the job done. </FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>I suppose an extension list variable could be =
created in the=20
conf.pl file to determine what file types would cause a new window, and =
then use=20
that for the comparison instead the hard-coded "pdf" value=20
below.</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>I added this code to the </FONT><FONT=20
size=3D2>cast_template subroutine. Red=3DNew, =
Blue=3DOriginal </FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT face=3D"MS Sans Serif"><FONT =
color=3D#ff0000> my=20
$cscext =3D get_suffix($url);<BR> if($cscext ne "pdf") =
{<BR></FONT><FONT color=3D#0000ff> =
$template->cast_loop=20
("results", [{rank =3D> $first+(++$rank),=20
<BR> &nb=
sp; =20
url =3D>=20
$url,<BR> &nbs=
p; =20
highlight_link =3D>=20
$highlight_link,<BR>  =
; =
=20
visibleurl =3D> $visible_url,=20
<BR> &nb=
sp; =20
title =3D> $title,=20
<BR> &nb=
sp; =20
date =3D> $date,=20
<BR> &nb=
sp; =20
score =3D>=20
$score,<BR> &n=
bsp; =20
description =3D>=20
$desc,<BR> &nb=
sp; =20
size =3D> sprintf("%.0f", $sizes_db{$_}/1000) ||=20
1,<BR> &=
nbsp; =20
}]);<BR></FONT><FONT color=3D#ff0000> =
}<BR> =20
else {<BR> my $blankpage =3D '"=20
target=3D"_blank';<BR> $template->cast_loop =
("results",=20
[{rank =3D> $first+(++$rank),=20
<BR> &nb=
sp; =20
url =3D> $url .=20
$blankpage,<BR> &nbs=
p;  =
;=20
highlight_link =3D>=20
$highlight_link,<BR>  =
; =
=20
visibleurl =3D> $visible_url,=20
<BR> &nb=
sp; =20
title =3D> $title,=20
<BR> &nb=
sp; =20
date =3D> $date,=20
<BR> &nb=
sp; =20
score =3D>=20
$score,<BR> &n=
bsp; =20
description =3D>=20
$desc,<BR> &nb=
sp; =20
size =3D> sprintf("%.0f", $sizes_db{$_}/1000) ||=20
1,<BR> &=
nbsp; =20
}]); <BR> }</FONT></FONT></DIV>
<DIV><FONT face=3D"MS Sans Serif"></FONT> </DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>Charles Chilcote</FONT></DIV>
<DIV><FONT size=3D2>Programmer/Analyst</FONT></DIV>
<DIV><FONT size=3D2>Nitterhouse Concrete Products, Inc.</FONT><BR><FONT =
size=3D2><A=20
href=3D"http://www.nitterhouse.com/Home.html">http://www.nitterhouse.com/=
Home.html</A></FONT></DIV></DIV></BODY></HTML>
------=_NextPart_000_0033_01C3EC03.3DAB4F40--
|
|