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
Quote Reply
Re: [Clint] A simple solution to a 2nd Url? In reply to
If you don't need tracking of the second URL, then why not just print it directly into the templates?

<a href="<%SiteURL%>"><%Title%></a>


Unsure

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!
Quote Reply
Re: [Andy] A simple solution to a 2nd Url? In reply to
Andy:

Good point. That's what I was using, however sometimes for 'affiliate' type llinks, it is preferable to 'hide' the real URL, as history shows some people remove the part of the link that enables clicks to be tracked (at the merchants end that is).

That's the only reason I can see for the above, where tracking is not involved - but I do recall this question being asked by quite a few people in the forums.

Regards,



Clint.
--------------------------
http://AffiliatesDirectory.com
The Affiliate Programs Directory
Quote Reply
Re: [Clint] A simple solution to a 2nd Url? In reply to
Why make life hard for yourself then? Wink How about making URL the one that the script goes to (i.e no mods to the core script are needed), and then using a mouseover to show the URL2, or SiteURL link ?

Just thowing some idea at ya Tongue

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!