Hi, could anyone tell me what to do in order for Linksql to be able to search for the word: AT&T.
Jun 20, 2003, 4:56 AM
Veteran (1921 posts)
Jun 20, 2003, 4:56 AM
Post #2 of 8
Views: 2568
This is how I have done something similar:
In Search.pm find the line:
$args->{query} =~ s,^\s*|\s*$,,g;
after this add:
$args->{query} =~ s,&,and,g;
and then in the record for AT&T add ATandT in a field which is searched - I have added a keyword field to my Links table so that I can add extra words which I don't want to include in the description but which I want that listing returned for.
In Search.pm find the line:
$args->{query} =~ s,^\s*|\s*$,,g;
after this add:
$args->{query} =~ s,&,and,g;
and then in the record for AT&T add ATandT in a field which is searched - I have added a keyword field to my Links table so that I can add extra words which I don't want to include in the description but which I want that listing returned for.
Jul 16, 2003, 4:40 AM
Veteran (1921 posts)
Jul 16, 2003, 4:40 AM
Post #4 of 8
Views: 2537
Hi Alina,
Unfortunately I don't think that there is an easy way to do this without modifying core files within Links. The Search.pm file isn't one of your templates - it is a file within the Links installation. I think you will find it in the directory cgi-bin/admin/Links/User
It is not really recommended that you modify these files as they will be overwritten when you upgrade to the next version of Links. However, if you keep a note somewhere of any changes you make then you can quickly add them in again when you upgrade.
If I have misunderstood and you really have looked in Search.pm and can't find the line, let me know and I'll have another look.
Laura.
The UK High Street
Unfortunately I don't think that there is an easy way to do this without modifying core files within Links. The Search.pm file isn't one of your templates - it is a file within the Links installation. I think you will find it in the directory cgi-bin/admin/Links/User
It is not really recommended that you modify these files as they will be overwritten when you upgrade to the next version of Links. However, if you keep a note somewhere of any changes you make then you can quickly add them in again when you upgrade.
If I have misunderstood and you really have looked in Search.pm and can't find the line, let me know and I'll have another look.
Laura.
The UK High Street
Jul 17, 2003, 4:58 PM
Veteran (1921 posts)
Jul 17, 2003, 4:58 PM
Post #6 of 8
Views: 2492
Are you sure you have 2.00? That seems quite old? I think things have changed a lot since then.
This is what I have in Search.pm for the start of the query sub:
sub query {
# ------------------------------------------------------------------
# Query the database.
#
my $query = $IN->param('query');
my $term = $IN->escape($IN->param('query'));
# First get our search options.
my $args = $IN->get_hash;
$args->{query} =~ s,^\s*|\s*$,,g;
$args->{query} =~ s,&,and,g; #I've added this line
This is what I have in Search.pm for the start of the query sub:
sub query {
# ------------------------------------------------------------------
# Query the database.
#
my $query = $IN->param('query');
my $term = $IN->escape($IN->param('query'));
# First get our search options.
my $args = $IN->get_hash;
$args->{query} =~ s,^\s*|\s*$,,g;
$args->{query} =~ s,&,and,g; #I've added this line
Jul 20, 2003, 5:41 AM
Veteran / Moderator (6956 posts)
Jul 20, 2003, 5:41 AM
Post #7 of 8
Views: 2486
Hmm... if you are running 2.0 you really might want to upgrade to the 2.12 version. Lots of changes, fixes, and such.
How easy the upgrade would be, depends on how many plugins and customizations you have made, but to use the new features from GT, and Community, you'll need to upgrade sooner or later.
A *LOT* of things got moved around, switched around, and broken up differently, which is possibly why your code isn't matching up.
If you are going to modify core links code, you _really_ should consider doing it on the 2.12 version, since older versions are substantially different, and if you ever do try to upgrade, later on, you'll find the chore of adding in your tweaks much, much harder.
PUGDOG� Enterprises, Inc.
The best way to contact me is to NOT use Email.
Please leave a PM here.
How easy the upgrade would be, depends on how many plugins and customizations you have made, but to use the new features from GT, and Community, you'll need to upgrade sooner or later.
A *LOT* of things got moved around, switched around, and broken up differently, which is possibly why your code isn't matching up.
If you are going to modify core links code, you _really_ should consider doing it on the 2.12 version, since older versions are substantially different, and if you ever do try to upgrade, later on, you'll find the chore of adding in your tweaks much, much harder.
PUGDOG� Enterprises, Inc.
The best way to contact me is to NOT use Email.
Please leave a PM here.