Gossamer Forum
Home : Products : Gossamer Links : Discussions :

jumping to URL's

Quote Reply
jumping to URL's
Question regarding <%db_cgi_url%>/jump.cgi?ID=<%ID%>

If in Links properties there is more than one field that contains a URL entry (ie <%URL%> and <%Store_URL%>) is it possible to jump to that url also.

For example, I notice that the link to <%URL%> uses the following code

<a class="<%category_links%>" href="<%db_cgi_url%>/jump2.cgi?ID=<%ID%>">

When users click on the link they go to the URL and because I am using the frames plugin I get the frame at the top. So is it possible to have the same action when users click on Store URL?

thanks for any help I can get, I am sure I am overlooking something simple.
Quote Reply
Re: [knewt] jumping to URL's In reply to
Mmmm...I don't really think there is a quick work around this one. It would require a fair bit of hacking to the plugin, as well as the templates Unimpressed

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!

Last edited by:

Andy: Feb 5, 2003, 1:04 PM
Quote Reply
Re: [knewt] jumping to URL's In reply to
Yes, and it's probably quite trivial, if you are willing to hack jump.cgi and make a change to the URL field you have in your templates.

As I've said, jump.cgi is my favorite program to hack on ;)

jump.cgi looks for several parameters for what to do.

if "random" is sent in, it picks an id at random. If ID is sent in, it does a bunch of stuff either showing a detail page, jumping to that ID, etc.

So, all you need to do, is pass in the parameter you want, then have jump.cgi do something else with it.

Quite possibly the easiest thing to do is pass in a new parameter &Store_URL=1

<%if Store_URL%>
<a class="<%category_links%>" href="<%db_cgi_url%>/jump2.cgi?ID=<%ID%>&Store_URL=<%Store_URL%>">
<%endif%>

You really always want to wrap something like this in an "if" to avoid unknown tag errors, or broken links.

In ../Links/User/Jump.pm you want to add:

my $alt_url = $IN->param('Store_URL') || ''; ## at the top, so you know something is going on down below

Then, where you see:

Code:
# 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()"} );
}
}


Change the red line to:

Code:
$goto = ( $alt_url ? $rec->{Store_URL} : $rec->{URL} );


I haven't tested it, but barring a typo, it should work.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [knewt] jumping to URL's In reply to
BTW...

If you want to track hits to the store URL and the URL separately, you'd need to duplicate the routine I quoted above, and expand the one-liner if test, into a clause updating Store_Hits rather than Hits if you are using the alt_url.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.