Gossamer Forum
Home : Products : Links 2.0 : Discussions :

Spaces in search terms

Quote Reply
Spaces in search terms
Using info from a previous thread I have the search term coming up in results pages by using the <%term%> tag. But I also get a percentage sign + 20 showing where the space should be between words in the search term. How can I get rid of this?

Thanks,
Alan

Quote Reply
Re: Spaces in search terms In reply to
Not sure why. It doesn't do that normally.

In site_html_templates.pl in sub site_html_search_results you could use some regex to replace the percent20 with a space...the code below is the original - you could try replacing that line with the code below it or add the regex under it.

Code:
my $term = &urlencode ($in{'query'});
Try:
Code:
my $term = $in{'query'};
(Not sure if that will have any unwanted effects).


Installs:http://wiredon.net/gt
FAQ:http://www.perlmad.com

Quote Reply
Re: Spaces in search terms In reply to
AHA. Help! I just went to open site_html_templates.pl in my browser and I got a 500 error. (Actually ALL of the .pl files are giving a 500 - and I also can't open any of the .pl files that are still on my PC from the original download.)

Quote Reply
Re: Spaces in search terms In reply to
1) Revert back to an older site_html_templates.pl file...you should keep local backups of all your data. You can also check the syntax of the file, with the following command via telnet:

Code:

perl -c site_html_templates.pl


Then report the syntax errors.

2) Also, you should use <%query%> as the input textbox value in your search form codes in the search_results.html file:

Code:

<input type="text" name="query" value="<%query%>">


<%term%> should only be used in query strings that will add + signs for spaces between inputted keywords.

Regards,

Eliot Lee
Quote Reply
Re: Spaces in search terms In reply to
Many thanks! Substituting query for term worked and I am no longer getting the percent20 showing.

Two questions:

1) is it normal that I cannot open the .pl files either on the server or locally?

2) Could you pleasetake a look at my problem with numbers of search results (max hits) displayed?? It is posted in the installation forum as "Number of links in results page".

Thanks again. These forums are a great help and much appreciated!!

Alan


Quote Reply
Re: Spaces in search terms In reply to
In Reply To:
1) is it normal that I cannot open the .pl files either on the server or locally?
No...it is not normal, unless you have mistakingly encrypted the file or password protected it locally and uploaded it as an encrypted file to your server, which in some cases, this causes the problems you are experiencing.

In Reply To:
2) Could you pleasetake a look at my problem with numbers of search results (max hits) displayed?? It is posted in the installation forum as "Number of links in results page".
I've already looked at the Thread and it seems that you are already getting appropriate advice from other Links 2.0 users.

bye...


Regards,

Eliot Lee