Gossamer Forum
Home : Products : Links 2.0 : Customization :

Search ONLY Mod for 2.0?

Quote Reply
Search ONLY Mod for 2.0?
I have searched the entired links section, does anyone know if there is a search only MOD for 2.0? I cant seem to find one.
Quote Reply
Re: Search ONLY Mod for 2.0? In reply to
Glad you made that point, I use templates as well. Thanks! Smile
Quote Reply
Re: Search ONLY Mod for 2.0? In reply to
Yes, there is one from CEGlobe

Thiago Moretti
Quote Reply
Re: Search ONLY Mod for 2.0? In reply to
Ok, any idea who they are or how I can get it?????? Thanks
Quote Reply
Re: Search ONLY Mod for 2.0? In reply to
Ok. open search.cgi

Add

if ($in{'category'}){
($in{'category'} eq $values[$db_category]) or next LINE;
}


under

$db_file_name. Reason: $!");
flock (DB, 1) if ($db_use_flock);
LINE: while (<DB> ) {
/^#/ and next LINE; # Skip comment Lines.
/^\s*$/ and next LINE; # Skip blank lines.
chomp; # Remove trailing new line.
@values = &split_decode($_);
$grand_total++;


Then open site_html.pl

Under site_html_category, add

<select name=category>
<option selected value=>all of site
<option value="$category_name">just this category</select>

That's it.
Quote Reply
Re: Search ONLY Mod for 2.0? In reply to
Thanks a million!
Kelly
Quote Reply
Re: Search ONLY Mod for 2.0? In reply to
For templates here is the code but it still does not search deep in directories:

Instead of:

Code:
<select name=category>
<option selected value=>all of site
<option value="$category_name">just this category</select>

in site_html.pl under site_html_category

--------------------------------------------

Add this code in category.html :

Code:
<select name=category>
<option selected value=>all of site
<option value="<%category_name%>">just this category</select>

In between:

Code:
<form action="<%db_cgi_url%>/search.cgi" method="GET">
<div align="center"><center><p><input size="20" name="query"> <input type="submit"
value="Search">{insert code here}</p>
</center></div>
</form>

Thanks to socrates for pointing out the error...

Anyone have any ideas why it is not searching deep in directories?


elms


[This message has been edited by elms (edited March 13, 1999).]
Quote Reply
Re: Search ONLY Mod for 2.0? In reply to
elms,

Do you mean, site_heml_templates.pl? I understand site_html.pl is irrelevant, if you are using templates.
Quote Reply
Re: Search ONLY Mod for 2.0? In reply to
socrates,

Yes, I mean site_html_templates.pl . site_html.pl is referring to the file that the original mod was referring to.

sorry for the confusion...modified the post to separate it...

Hope it makes sense now...

elms



[This message has been edited by elms (edited March 11, 1999).]
Quote Reply
Re: Search ONLY Mod for 2.0? In reply to
Sorry I didn't get where to put the code.
Here is what I got edit the site_html_templates.pl goto the and add the code:
<select name=category>
<option selected value=>all of site <option value="$category_name">just this category</select>

but where do put the code?? What section of the site_html_templates.pl

Thanks
Evan
Quote Reply
Re: Search ONLY Mod for 2.0? In reply to
computel,

if you are using templates you need to insert the code in category.html . if you are using site_html.pl you need to follow what tmoretti said.

example:
Code:
<form action="<%db_cgi_url%>/search.cgi" method="GET">
<div align="center"><center><p><input size="30" name="query"> <input type="submit"
value="Search">{insert code here}</p>
</center></div>
</form>

This search mod does not search deep in directory structure.

elms
-------------------
http://www.webmerch.com
links@webmerch.com

[This message has been edited by elms (edited March 12, 1999).]
Quote Reply
Re: Search ONLY Mod for 2.0? In reply to
Thank You - elms and the gang. There is a small mistake in the code elms posted above. A greater than sign is missing for closing the tag. For those who might need, here is the complete code for templates. Paste it in "category.html"

<!-- Search Bar -->
<form action="<%db_cgi_url%>/search.cgi" method="GET">
<h2>Search</h2>
<div class="margin">
<table border="0" cellspacing="0" cellpadding="0">
<tr><td><strong class="search">Looking for something in particular?</strong></td></tr>
<tr><td><input type="text" size=20 name="query">
<select name="category">
<option selected value="">Entire site
<option value="<%category_name%>">This category</select>
<input type=submit value="Search!"></td></tr>
<tr><td><small class="more"><a href="<%db_cgi_url%>/search.cgi">More search options</a></small></td></tr>
</table>
</div>
</form>
Quote Reply
Re: Search ONLY Mod for 2.0? In reply to
Thanks Socrates,

Too close to another greater than sign. That's all it was. I guess I have seen my templates way too long to catch that. Fixed the original post now.

elms
Quote Reply
Re: Search ONLY Mod for 2.0? In reply to
WHERE SHOULD I INSERT YOUR CODES as:

UNDER site_html_category BUT IN WHAT SECTION?????? Please tell.. Thanks

========================================
Under site_html_category, add

<select name=category>
<option selected value=>all of site
<option value="$category_name">just this category</select>

========================================

MY CODES:

=====================

##########################################################
## Category Pages ##
##########################################################

sub site_html_category {
# --------------------------------------------------------
# This rountine will build a page based for the current category.
# Insert the following variables in the appropriate place.
#
# $category : The list of subcategories.
# $links : The list of links in this category.
# $time : The current time.
# $date : The current date.
# $title_linked : A linked version of the title bar.
# $title : An unlinked version of the title bar.
# $total : The total number of links in this category.
# $grand_total : The total number of links.
# $category_name : The category name.
# $category_name_escaped : The category name URL escaped (used for the Add function)
# $category_clean : The category name with _ and / removed.
#
# The following will work assuming you haven't changed the order of the
# category database. If you have, or have added new fields, you can access
# any of the information by using $category{$category_name}[field_num] where
# field number is the number (indexed from 0) of the field you want. Otherwise
# you can just use the following:
#
# $description : Category Description
# $meta_name : Meta Description Tag
# $meta_keywords : Meta Keywords Tag
# $header : Custom Header
# $footer : Custom Footer
# $related : A <li> list of related categories.
#

my ($output);

$output = qq~

<html>

<head>
<title>$site_title: $category_clean</title>
<meta name="description" content="$meta_name">
<meta name="keywords" content="$meta_keywords">

</head>

<$site_body>

<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td valign="middle" width="1%"><a href="http://www.delt.net"><img
src="http://www.trisoft.net/images/logo.gif" alt="Delt.NET" border="0"></a> </td>
<td valign="middle"><table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td align="left" valign="bottom"><p align="right"><font face="arial" size="-1"><right" valign="bottom"><a
class="menulink" href="$build_add_url">Add Site</a> - <a
href="$build_modify_url">Modify Site</a><font face="arial" size="-1"> - <a
href="http://www.trisoft.net/maillogin/">Check E-mail</a></font> </font></td>
</tr>
</table>
<hr size="1" noshade>
</td>
</tr>
</table>

<p><class="title">$title_linked</p>

<div align="center"><center>

<table border="0" cellpadding="5" cellspacing="0" width="100%" bgcolor="#FE701B">
<tr>
<td width="100%" bgcolor="#A0B8C8"><p align="left"><strong>$site_title: $category_clean </strong></td>
</tr>
</table>
</center></div>


<p><!------------- AD BANNER HERE ----------></p>
$site_menu

<p>$category_name_escaped</p>
<center>
<table border=0 bgcolor="#FFFFFF" width="100%">
<tr><td>

~; if ($header) { $output .= qq~<h2>$header</h2>
~; }
if ($category) { $output .= qq~
<div align="center"><center>

<table border="0" cellpadding="0" cellspacing="0" width="100%"
bgcolor="#FDAF20">
<tr><td>
<h3>Categories:</h3></td>
</tr>
</table>
</center></div>

$category

~; }
if ($links) {$output .= qq~
<div align="center"><center>

<table border="0" cellpadding="0" cellspacing="0" width="100%"
bgcolor="#FDAF20">
<tr>
<td><h3>Links:</h3></td>
</tr>
</table>
</center></div><br>

$links
~; }
if ($related) {
$output .= qq~
<div align="center"><center>

<table border="0" cellpadding="0" cellspacing="0" width="100%"
bgcolor="#FDAF20">
<tr><td>

<h2>Related Categories:</h2>
</td></tr>
</table>
</center></div>

<ul>$related</ul>
~; }

if ($prev or $next) { $output .= qq~<p>~; }
if ($prev) { $output .= qq~<strong><a href="$prev">Prev $build_links_per_page</a></strong> ~; }
if ($next) { $output .= qq~<strong><a href="$next">Next $build_links_per_page</a></strong> ~; }
if ($prev or $next) { $output .= qq~</p>~; }

if ($footer) { $output .= qq~<p>$footer</p>~; }

$output .= qq~

$site_footer

</body>
</html>
~;

return $output;
}

------------------
WebKing
WebKing@trisoft.net
http://www.trisoft.net
My ICQ # 25356171
Quote Reply
Re: Search ONLY Mod for 2.0? In reply to
Webking,

On your site you must be using templates are editing category.html. You are posting code in your site_html.pl and it does not match what you have on your site. You must modify category.html and follow the templates instructions. Though no one got back to the response that it does not search deeper in subcats, I am sure someone will reply.

If you want to use site_html.pl paste the code that socrates last posted and replace all:

<%variable%> with $variable.

elms

------------------
www.webmerch.com
links@webmerch.com






[This message has been edited by elms (edited March 14, 1999).]