Gossamer Forum
Home : Products : Links 2.0 : Discussions :

A couple of observations

Quote Reply
A couple of observations
I don't recall seeing these discussed previously:

1) When I search my links through the user interface with an "&" in the search term (I have a lot of "track & field" listings), the search results come back with & nbsp; (no space between "&" and "nbsp;" -- UBB code turns that into " ") before the link. What is it that causes this behavior? I've thought abut converting &'s and "'s to HTML equivalents throughout the database, but haven't wanted to bother... Would that solve the problem?

2) While adding links through admin, the script apparently does not reserve the link # currently being added. Thus, if a user submits a link for validation at the same time, you have to be paying attention and manually change the submitted link # to one taken before validating. For low volume submissions, this isn't too big of a deal, but for large sites it could get quite nasty. Do other people experience this, or is it just a peculiarity of my installation?

3) Ah shucks, I forgot what the third one was. Maybe it'll come back to me...

Thanks,
Dan

------------------
Run-Down Running Links: http://run-down.com/


[This message has been edited by Dan Kaplan (edited January 19, 2000).]
Quote Reply
Re: A couple of observations In reply to
1) You can try using the regular expression for & as follows in your site_html_search_results routine in the site_html_templates.pl file:

Code:
$query =~ s/\&\ /\&/g;

OR

Code:
$query =~ s/\& /\&/g;

2) Yes...I have seen this happen once in awhile. And there is no stable answer to this problem. One would think that file flocking would take care of this...but nope, still happens.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
http://www.anthrotech.com
Be sure to visit the Resource Center for FAQ's, Modifications and Extra Goodies!!
----------------------





Quote Reply
Re: A couple of observations In reply to
Hi Eliot,

Thanks for the reply. Nice sig file. Smile

1) Where would I place that line? Here's what I have currently:

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,
next => $next,
cat_hits => $cat_hits,
link_hits => $link_hits,
%in,
%globals
});
}
Would it go in front of my $term =...?

2) Oh well, I'll just have to stay on my toes. At least I know it's not something I did. Does anyone know if the same thing happens in Links SQL? Seeing as how that's geared for much larger sites, the problem could easily be magnified.

Thanks,
Dan
Quote Reply
Re: A couple of observations In reply to
1) Place the codes AFTER $my term....

2) This does not happen in SQL version of LINKS to my knowledge, because the id.txt structure is used in flatfile systems. In SQL, basically, the numbers of records are enumerated in a fashion that does not produce the problem you see in the flat file system.
(Try searching the SQL LINKS Forum for information relating to this issue. Also, for reference, you might want to check out www.mysql.org for information pertaining to data structure and management.)

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
http://www.anthrotech.com
Be sure to visit the Resource Center for FAQ's, Modifications and Extra Goodies!!
----------------------





Quote Reply
Re: A couple of observations In reply to
Hi Eliot,

Thanks for the help. #1 turned out to be a silly, and a bit strange, problem. I tried your two suggested lines, and neither made a difference. I took a peek at the search source code, and the <strong>&</strong>nbsp; made me suspicious of link.html. Sure enough, I had a hard coded space between the image and the link info (before the href and everything). For some reason it is treated as a space everywhere except when a searh is performed with "&" in the query. I would've thought that the search is only searching the database, but this would indicate otherwise...?

As far as MySQL, I actually just downloaded the documentation and started reading over it this weekend. There's a lot there, but I hope to get up to speed on it soon.

Thanks,
Dan