Gossamer Forum
Home : Products : Links 2.0 : Customization :

CATEGORY and SEARCH SORT.. (mods)

Quote Reply
CATEGORY and SEARCH SORT.. (mods)
ok.. i know quite a few of you wanted these like 2 months ago.. i'm just gonna start releasing some of the script.. (ending with admin mod) that you guys wanted..

this one might be a little hard for some of you to install.. so please do search.cgi, category.cgi, site_html.pl or site_html_templates.pl

ok.. the category.cgi portion of this mod is intended for people with loopy's multiple category mod.. (i will release a regular version mod later when i feel like it..)

also.. before you do this.. remember that the sorting gets rid of the categories that are returned with the links.. ie:

category : that : this : link : is : in
link..
link..

but it still has the category results at the top of the first page..

hmm.. yea.. don't install category.cgi yet unless you have multiple category mod.. it might work though.. and it might mess things up.. just don't do it..

oh yea.. this version of category.cgi happens to store more subcategory information than needed cause that is the only way it will work with subcategories like yahoo.. (v2)

anyways.. the files are here:

jsu7785.hypermart.net/search.txt
jsu7785.hypermart.net/category.txt

ok.. put this in either site_html.pl or site_html_templates.pl depending on which you use..
jsu7785.hypermart.net/site_html.txt

here is an example of how i did the automatic "link" that when you click also had an image.. the images.. btw are ascend.gif and descend.gif.. you can get your own anywhere..
jsu7785.hypermart.net/usage.txt

you will have to change the properties in the subroutine added to site_html.pl where the images are:

Code:
$sort_image = qq~<img src="$build_root_url/images/descend.gif" width="14" height="7" border="0">~ if ($in{'order'} eq "d");

AND

$sort_image = qq~<img src="$build_root_url/images/ascend.gif" width="14" height="7" border="0">~;

jerry

[This message has been edited by widgetz (edited April 15, 2000).]
Quote Reply
Re: CATEGORY and SEARCH SORT.. (mods) In reply to
What a cool way to release mods, out of nowhere and all together at the same time Smile.
I tested your search sort and it works ok.
I couldn't do much with it, I'm working on that category search thing, and splitting them with links.

Lavon

[This message has been edited by Bmxer (edited October 03, 1999).]
Quote Reply
Re: CATEGORY and SEARCH SORT.. (mods) In reply to
i forgot about a file..

jsu7785.hypermart.net/db_utils.txt

replace that with your current sub build_sorthit..

it no longer sorts by new cool etc..

but it will sort by anything they want it to sort by.. ascending and descending..

jerry

[This message has been edited by widgetz (edited April 15, 2000).]
Quote Reply
Re: CATEGORY and SEARCH SORT.. (mods) In reply to
Widgetz,
I have installed your sort mod but it doesn't seem to work for me.
Please take a look at
------------------------------------------
http://www.etcmall.com/catalog/Gift_and_Flowers/Gifts/
------------------------------------------
I think I might miss something or I didn't setup right.

Please help
Den
Quote Reply
Re: CATEGORY and SEARCH SORT.. (mods) In reply to
$build_category_url

you need to give the path of category.cgi in your links.cfg file

jerry
Quote Reply
Re: CATEGORY and SEARCH SORT.. (mods) In reply to
Widgetz,
I did it already and get new problem. When I click on sort, it links to the home page.
This is how I did
- d/l your mod, put search.cgi and category.cgi on the root
- copy your site_html.txt code and paste into site_html template.pl
- copy your db_utils.txt and replace with sub build_sorthit
in db_utils.pl
- add the variable in both sub site_html_category and site_html_search_results?
- put ><%site_link1%> ... in my category.html template file.

few questions I would like to ask
- how come I don't see descend/ascend image on other fields?
- how to make search and sort the results in order?

Could you please go and take a look again and see of what could be wrong.

Thank you for your help
Den
Quote Reply
Re: CATEGORY and SEARCH SORT.. (mods) In reply to
$category_name_escaped

is that not defined in nph-build.cgi?

i can swear it is.. but so many people say it isn't..

the reason it goes to the homepage is cause $category_name_escaped is not defined in the category input..

jerry
Quote Reply
Re: CATEGORY and SEARCH SORT.. (mods) In reply to
Widgetz,
I went to check on my nph-build.cgi and I've found $category_name_escaped in 2 location

--------------------------------------------
sub build_category_pages {
# -----------------------------------------
# This routine builds all the category pages. Each category uses
# the same template which is defined in &site_html_category.

my ($cat, $url, $dir, @related, $relation, $page_num, $next_page, $numlinks);
local ($category, $links, $title_linked, $title, $total, $category_name, $category_name_escaped);
local ($description, $related, $meta_name, $meta_keywords, $header, $footer, $next, $prev);
---------------------------------------------
and
---------------------------------------------
$title_linked = &build_linked_title ($cat);
$title = &build_unlinked_title ($cat);
$total = ($#{$links{$cat}} + 1) / ($#db_cols + 1);
$category_name = $cat;
$category_name_escaped = &urlencode ($cat);
$category_clean = &build_clean ($cat);
--------------------------------------------
Please tell me how to defined in the category input?

Thanks again Jerry Smile
Quote Reply
Re: CATEGORY and SEARCH SORT.. (mods) In reply to
i looked at this thread before but i could not follow it.
what script needed for SORT Search thingy for links
Quote Reply
Re: CATEGORY and SEARCH SORT.. (mods) In reply to
In regard to the category.cgi file:

I just finished this mod for the @ sign in categories.
http://www.gossamer-threads.com/scripts/forum/resources/Forum3/HTML/003110.html

Now I also want to add the mod on this page but I do not see how the two get combined. It appears parts have been eliminated.

Thanks!
Adam
Quote Reply
Re: CATEGORY and SEARCH SORT.. (mods) In reply to
I have installed the Mod, (single search.cgi, with the necessary changes in site_html.templates.pl, I don't have installed the multiple categories mod) it Works well, but I have problems for that the Next Page doesn't appear... Frown

search_error.html

Code:
Sort By
<%site_link1%>

<%site_link2%>

<%site_link3%>

<%site_link4%>

<%site_link5%>

<%site_link6%>


<%if next%>
<p>Pages: <%next%></p>
<%endif%>


Also, in all the places where I have <%site_linkx%> appears me the name of the field but this way:


Code:
<a href="/cgi-bin/search.cgi?query=el&order=a&sort=11">< color="#ffffff">Rating</font></a>


Can you help me?

Thanks in advance.

Carlos

[This message has been edited by Nomada (edited April 21, 2000).]
Quote Reply
Re: CATEGORY and SEARCH SORT.. (mods) In reply to
Widgetz has changed the spanning codes if you look closely at the search.cgi script...he is using $span for both $next and $prev.

Replace the following codes you have:

Code:
<%if span%>
<p>Pages: <%span%></p>
<%endif%>

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: CATEGORY and SEARCH SORT.. (mods) In reply to
 
Quote:
the fields appear me in English and I need them to appear in Spanish...

The quick and dirty method is to change the name of the fields in the %db_def file to Spanish.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: CATEGORY and SEARCH SORT.. (mods) In reply to
 Now works!!

I have also needed to change the variable in the site_html_templates.pl in the sub build_search_results

Code:
sub site_html_search_results {
# --------------------------------------------------------
# This routine displays the search results.
#
my $term = &urlencode ($in{'query'});
&html_print_headers;
print &load_template ('search_results.html', {
term => $term,
link_results => $link_results,
category_results => $category_results,
span => $span,
cat_hits => $cat_hits,
link_hits => $link_hits,
site_link1 => &site_html_sort_link("Title"),
site_link2 => &site_html_sort_link("Votes"),
site_link3 => &site_html_sort_link("Rating"),
site_link4 => &site_html_sort_link("Hits"),
site_link5 => &site_html_sort_link("Date"),
site_link6 => &site_html_sort_link("isNew"),
%in,
%globals
});
}

But I have another problem (how strange that I have problems with Links2...? Smile), the fields appear me in English and I need them to appear in Spanish...

Should I change the name of the fields in all the scripts?

Thanks again,

Carlos

[This message has been edited by Nomada (edited April 22, 2000).]

[This message has been edited by Nomada (edited April 22, 2000).]
Quote Reply
Re: CATEGORY and SEARCH SORT.. (mods) In reply to
Thank you Eliot:

I have changed the name of the fields and now it works, but I have also had to change the name in the templates and in the scripts that make the call to the name of the field...

However, in Spanish we use signs of accentuation I have had to replace some fields like Title for:
Code:
'T&iacute;tulo'
so that appears Título. And do I ask, can it generate some error, or when taking quotation marks '' does it avoid the problems?

Many thanks,

Carlos

[This message has been edited by Nomada (edited April 23, 2000).]

[This message has been edited by Nomada (edited April 23, 2000).]

[This message has been edited by Nomada (edited April 23, 2000).]
Quote Reply
Re: CATEGORY and SEARCH SORT.. (mods) In reply to
Hi to all:

How I can make work this mod to order the links in category.html without the loopy's multiple category mod?

I have put it to work for search_results.html and it works very well but with the categories I have been making tests and one doesn't eat to make it... Frown

Thank you in advance

Carlos
Quote Reply
Re: CATEGORY and SEARCH SORT.. (mods) In reply to
 
Quote:
How I can make work this mod to order the links in category.html without the loopy's multiple category mod?

I don't understand your request...sorry.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: CATEGORY and SEARCH SORT.. (mods) In reply to
ohhh!! stupid me, that doesn't work, the pages of the categories are created by the nph_build.pl

I regret to make you lose time...


Thanks again,

Carlos

[This message has been edited by Nomada (edited April 29, 2000).]
Quote Reply
Re: CATEGORY and SEARCH SORT.. (mods) In reply to
 
Quote:
I don't have installed the multiple category mod...

Search the Forum for "Loopy" and you will find Topics that have his Mod linked.

I have linked his Mod six times in the past two months.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: CATEGORY and SEARCH SORT.. (mods) In reply to
Thanks for the clarification....I do not use the category.cgi nor intend to due to bandwidth issues.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: CATEGORY and SEARCH SORT.. (mods) In reply to
Anybody is using category.cgi?
Instructions of Widgetz wasn't enough detailed how to use the user-interactive category.cgi script.
I didn't find any detailed instructions how to use, so I decided to write one.

For beginners here's how it works:
It creates a dynamic page when a user clicks to the link containing category.cgi.
The input parameters can be: category, page, order, sort
Category parameter: the name of the category
Page parameter: number of the current page. If not spanned its value is 1.
Order parameter: a (ascend) or d (descend)
Sort parameter: should contain the field number of the links.db what we would like to sort by

So the link should look like (example category is Computer/Printers):
<a href="URL_of_your_website?Computer_Printer&page=1&order=a&sort=1">

This should look like following in your template files:
<a href="<%build_root_url%>/category%>?<%category%>&page=<%page%>&order=<%order%>&sort=<%sort%>">

Of course you should insert the necessary variables to site_html_category:
e.g.: page => $page,
order => $order,
etc.

The tutorial above is just for general purpose, which means you can understand how it works,
but it doesn't mean it will work for sure.
I didn't installed this mod, yet, just inspected the code & wrote a tutorial for it.
You should change the instructions if something isn't working.

Good luck,
Webmaster33

[This message has been edited by webmaster33 (edited May 13, 2000).]
Quote Reply
Re: CATEGORY and SEARCH SORT.. (mods) In reply to
Wouldn't you know it. I could use this mod and widgetz has just taken it down.

Does anyone know where I can get this mod? I only need to be able to sort the categories.

Thanks

Quote Reply
Re: [widgetz] CATEGORY and SEARCH SORT.. (mods) In reply to
hello every one.

looks this MOD is best solution to my topic about sort oprion.



but when im trying to download this files, its down.

please eny body have this mods, mail it to me.

or put ir to forum.

please.