Gossamer Forum
Home : Products : Links 2.0 : Customization :

Two litle questions guys ... Please

Quote Reply
Two litle questions guys ... Please
I have two small questions ...

First question: Someone knows how I can write in a empty category something like: There's no links at this category ...

Second question: Where's the Search Only This Category Mod ? I can't find it!

PS: I'm sorry for my awful english, but I'm a brazilian girl ... Thanxs ... Smile

Bye Bye
Quote Reply
Re: Two litle questions guys ... Please In reply to
I'm not using templates ...
Quote Reply
Re: Two litle questions guys ... Please In reply to
For the search in current category mod, try this thread:

http://www.widgetz.com/links_mods/

[This message has been edited by t_dog (edited July 17, 1999).]
Quote Reply
Re: Two litle questions guys ... Please In reply to
If you aren't using templates, try this:

if ($links) {$output .= qq~
<font face="arial">$links</font>
~; }


add this below:

if ($total < 1) {$output .= qq~
<p align=center><font face=arial size=2>--- there are no programs in this category ---</font></p>
~; }
Quote Reply
Re: Two litle questions guys ... Please In reply to
if ($links) {$output .= qq~
<font face="arial">$links</font>
~; }
else {
$output .= qq~
There are no links
~;
}

my category search mod has been changed yet again.. this time it is only three lines long.. i will update it right now.. expect it to be on the site in about 15 minutes
Quote Reply
Re: Two litle questions guys ... Please In reply to
Hey widgetz, you know how to do a search OR in all database OR in the current category OR in the current category and in the respective subcategories ?
Quote Reply
Re: Two litle questions guys ... Please In reply to
ok.. you confused me.. can you give me an example? Smile
Quote Reply
Re: Two litle questions guys ... Please In reply to
3 options ...

First option: Search All Database
Second option: Search Only This Category
Third option: Search Only This Category And Subcategories

ok ?
Quote Reply
Re: Two litle questions guys ... Please In reply to
ohh

my mod searches the category and subs..

but if you want it to search category only..

youwould change the .... =~ /^$catsearch/

to

eq $catsearch

if you want it to do both..

the easiest way.. you change my mod to:
Code:
if ($in{'category'} && $in{'category'} ne "All") {
if ($in{'category'} =~ /+$/) {
($values[$db_category] =~ /^$in{'category'}/) or next LINE;
}
else {
($values[$db_category] eq $in{'category'}) or next LINE;
}
}

and the second part in category.html to:

Code:
<!-- 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=15 name="query"> <input type=submit value="Search!"></td></tr>
<tr><td><select name="category">
<option value="All" selected>in <%site_title%></option>
<option value="<%category_name_escaped%>" selected>in <%site_title%> only</option>
<option value="<%category_name_escaped%>+">in <%category_name_escaped%> and subcategories</option>
</select></td></tr>
<tr><td><small class="more"><a href="<%db_cgi_url%>/search.cgi">More search options</a></small></td></tr>
</table>
</div>
</form>

thanks!
jerry
Quote Reply
Re: Two litle questions guys ... Please In reply to
I have installed the category search mod, but I get "Unknown Tag: category_name_escaped

I am using templates.

Thanks in advance,
Kristin
Quote Reply
Re: Two litle questions guys ... Please In reply to
Thanks widgetz! Smile
Quote Reply
Re: Two litle questions guys ... Please In reply to
Hey Widgetz,
Nice mod,
however if I was to have an AltCategories field as in the Alternate Categories mod, how could I make the search pull results from links found in that field?
At the moment it will only pull results from the links with that category or subcategory in the category field of links.def
Thanks.
chmod
Quote Reply
Re: Two litle questions guys ... Please In reply to
FIRST.. kristin..

check:

sub site_html_category in site_html_templates.pl..

see if

Code:
category_name_escaped => $category_name_escaped,

exists in that list.. if not add it under category_name.. TELL ME IF IT IS OR IF IT IS NOT PLEASE.. (i shall add it to the instructions and people will stop asking me this question Smile)

jerry
Quote Reply
Re: Two litle questions guys ... Please In reply to
chomd.. it will probably list ALOT more links Smile but i guess you are right.. for now use this:

basically UNINSTALL My MOD but only in the SEARCH.cgi part..

then find this in sub search in search.cgi:

Code:
push (@{$link_results{$values[$db_category]}}, @values);

and replace it with:

Code:
if ($in{'category'} && $in{'category'} ne "All") {
push (@{$link_results{$values[$db_category]}}, @values) if ($values[$db_category] =~ /^$in{'category'}/);
if (defined $db_alt) {
@alt_categories = split(/\Q$db_delim\E/, $values[$db_alt]);
foreach (@alt_categories) {
push (@{$links{$_}}, @values) if ($_ eq $cat);
}
}
}

it might be a little slower too.. Smile i will think of another way.. cause i will probably need it to.. that is my tempoary conclusion

jerry
Quote Reply
Re: Two litle questions guys ... Please In reply to
CEGlobe said...

Quote:
If you aren't using templates, try this:
if ($links) {$output .= qq~
<font face="arial">$links</font>
~; }

add this below:

if ($total < 1) {$output .= qq~
<p align=center><font face=arial size=2>--- there are no programs in this category ---</font></p>
~; }

But what if you are using templates??
What do we do then?!!

Thanks

Gian

[This message has been edited by Gian (edited October 10, 1999).]
Quote Reply
Re: Two litle questions guys ... Please In reply to
Um, i did this a while ago. It was a hard thread to find, took me 2 minutes, but had a weird title. http://www.gossamer-threads.com/...m11/HTML/000869.html . Its not great but works and it saved alot of time.