The easiest way would be to make a new template called compare.html,. Add a new global called "
do_compare", with:
Code:
sub {
my $link_id_1 = $IN->param("ID1");
my $link_id_2 = $IN->param("ID2");
if ($link_id_1 !~ /^\d+$/ || $link_id_2 !~ /^\d+$/) {
return; # dont seem to be valid
} else {
my $link1 = $DB->table("Links")->get( $link_id_1 );
my $link2 = $DB->table("Links")->get( $link_id_2 );
if ($link1->{Title} && $link2->{Title}) {
$link1 = Links::SiteHTML::tags('link', $link1);
$link2 = Links::SiteHTML::tags('link', $link2);
return { 'link1' => $link1, 'link2' => $link2 };
} else {
return;
}
}
}
Then in the new compare.html template, something like:
Code:
<%do_compare%>
Link 1 title: <%link1.Title%>
Link 2 title: <%link2.Title%>
Link 1 title: <%link1.URL%>
Link 2 title: <%link2.URL%>
Totally untested, but that should work =) Call with:
page.cgi?p=compare;ID1=1234;ID2=334
You could do it using a stand-alone script too, but the above solution should work just as well =)
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my
Amazon Wish List GLinks ULTRA Package | GLinks ULTRA Package PRO Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin |
Pre-Made Template Sets |
FREE GLinks Plugins!