Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Help with A&B in global

Quote Reply
Help with A&B in global
Usage example:

Title (Manufacturer)
URL (Model Number) - Internal link to Detailed page

I'm using the global below to add a button to the Detailed page so visitors can list all other products by that manufacturer.

If the Title is Adam, it lists everything with that title.
If the Title is Adam & Eve it lists everything with that title.
If the Title is Adam&Eve it seams to list everything beginning with A.

The SQL table Title field is always entered as &.

Is there anything I can add to the global to correct this?

Code:
sub {
my $tbl = $DB->table('Links');
$tbl->select_options("ORDER BY URL");
my $title = $IN->param('title');
my $sth = $tbl->select( GT::SQL::Condition->new('isValidated','=',"Yes",'Title','LIKE',"$title%") );
my @loop;
while (my $hit = $sth->fetchrow_hashref) {
if ($CFG->{build_detailed}) { $hit->{detailed_url} = $CFG->{build_root_url} . "/" . $DB->table('Links')->detailed_url( $hit->{ID} ); }
if ($hit->{isNew} eq "Yes") { $hit->{isNew} = 1; } else { $hit->{isNew} = 0; }
if ($hit->{isPopular} eq "Yes") { $hit->{isPopular} = 1; } else { $hit->{isPopular} = 0; }
if ($hit->{isChanged} eq "Yes") { $hit->{isChanged} = 1; } else { $hit->{isChanged} = 0; }
push @loop, $hit;
}
return { links_loop => \@loop };
}

Last edited by:

MJB: Oct 23, 2010, 3:01 AM
Subject Author Views Date
Thread Help with A&B in global MJB 3306 Oct 23, 2010, 2:50 AM
Thread Re: [MJB] Help with A&B in global
MJB 3190 Oct 23, 2010, 5:43 AM
Post Re: [MJB] Help with A&B in global
Andy 3177 Oct 23, 2010, 8:04 AM