Gossamer Forum
Home : Products : Gossamer Links : Discussions :

A simple solution to a 2nd Url?

Quote Reply
A simple solution to a 2nd Url?
I am looking for some feedback as to whether this is a simple way to use the jump.cgi routines to jump to a 2nd URL. I do not need tracking of the clicks - and obviously if I did then this would require some additional modification. The field I need to track is SiteURL.

Firstly, I modified Jump.pm as follows changes are in red:-

Near Line 39:

Code:


Change:

my $sth = $db->select ( { isValidated => 'Yes' }, ['ID', 'URL'] );

To:

my $sth = $db->select ( { isValidated => 'Yes' }, ['ID', 'SiteURL'] );


And again near Line 94:

Code:


Change:

# Jump to a URL, bump the hit counter.
else {
$goto = $rec->{URL};

my $ip = $ENV{REMOTE_HOST} || $ENV{REMOTE_ADDR} || 'None';
my $click_db = $DB->table ('ClickTrack');
my $rows = $click_db->count ( { LinkID => $id, IP => $ip, ClickType => 'Hits' } );
if (! $rows) {
$db->update ( { Hits => \"Hits + 1" }, { ID => $id }, { GT_SQL_SKIP_INDEX => 1 } );
$click_db->insert ( { LinkID => $id, IP => $ip, ClickType => 'Hits', Created => \"NOW()"} );
}
}
}

To:

# Jump to a URL, bump the hit counter.
else {
$goto = $rec->{SiteURL};

# my $ip = $ENV{REMOTE_HOST} || $ENV{REMOTE_ADDR} || 'None';
# my $click_db = $DB->table ('ClickTrack');
# my $rows = $click_db->count ( { LinkID => $id, IP => $ip, ClickType => 'Hits' } ); # if (! $rows) {
# $db->update ( { Hits => \"Hits + 1" }, { ID => $id }, { GT_SQL_SKIP_INDEX => 1 } );
# $click_db->insert ( { LinkID => $id, IP => $ip, ClickType => 'Hits', Created => \"NOW()"} );

# }
# }
}


I then saved this file as Jump2.pm

The ## commenting out of the above lines stops the tracking. As I indicated above, additional changes would be needed if you need to track the clicks (although leaving this in, I have found, will track the clicks - but it will add to the clicks from your URL field - some may like this).



Next in jump.cgi I made the following simple change:

Near Line 18:

Code:


Change:

use Links::User::Jump;

To:

use Links::User::Jump2;


I saved this file as jump2.cgi - but you could use whatever you like.

There would no doubt be an easier way to do this - but not being a programmer I haven't been able to find one.

In any event, maybe someone will find this useful.



Regards,



Clint.
--------------------------
http://AffiliatesDirectory.com
The Affiliate Programs Directory
Subject Author Views Date
Thread A simple solution to a 2nd Url? Clint 2013 Nov 8, 2002, 2:41 PM
Thread Re: [Clint] A simple solution to a 2nd Url?
Andy 1925 Nov 10, 2002, 7:59 AM
Thread Re: [Andy] A simple solution to a 2nd Url?
Clint 1874 Nov 15, 2002, 12:36 PM
Post Re: [Clint] A simple solution to a 2nd Url?
Andy 1868 Nov 15, 2002, 11:15 PM