Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Launching Link in Framset

Quote Reply
Launching Link in Framset
Hello everyone,

I know this mod exists for Links 2.0, what about Links SQL?

------------------
James L. Murray
VirtueTech, Inc.
www.virtuetech.com


Quote Reply
Re: Launching Link in Framset In reply to
it works almost the same as links 2.0



------------------
Jerry Su
Links SQL User
------------------
Quote Reply
Re: Launching Link in Framset In reply to
Hello Jerry,

I was checking out your modification in the following thread, but the code you changed in the links 2.0 jump.cgi isn't the same in the jump.cgi script for Links SQL.

http://www.gossamer-threads.com/...um3/HTML/002930.html

Can you please do me a favor and tell me what changes would need to be made for Links SQL? I would really appreciate it.

It is a great mod! Smile

------------------
James L. Murray
VirtueTech, Inc.
www.virtuetech.com


Quote Reply
Re: Launching Link in Framset In reply to
Code:
$goto ? print $in->redirect ($goto) : return &error ("Record not found: $id");

to

Code:
($goto) or &error ("Record not found: $id");
print $in->header();
print qq~<html>
<head><title>${$rec}{'Title'}</title></head>
<body>
<frameset rows="70,*">
<frame name="top" src="jump.cgi?ID=$id&display=1" marginwidth="10" marginheight="10" scrolling="no" frameborder="no">
<frame name="bottom" src="$goto" marginwidth="10" marginheight="10" scrolling="auto" frameborder="no">
</frameset>
</body>
</html>~;

------------------
Jerry Su
Links SQL User
------------------
Quote Reply
Re: Launching Link in Framset In reply to
Hello Jerry,

thanks. I'll try it out. Hopefully adding all the rate and option links won't be hard.


------------------
James L. Murray
VirtueTech, Inc.
www.virtuetech.com




[This message has been edited by Ground Zero (edited February 10, 2000).]
Quote Reply
Re: Launching Link in Framset In reply to
Hello,

It didn't work. Any ideas on how to make this work.

------------------
James L. Murray
VirtueTech, Inc.
www.virtuetech.com


Quote Reply
Re: Launching Link in Framset In reply to
i just realized there is a bug in jump.cgi after rereading this thread..

Code:
$goto ? print $in->redirect ($goto) : return &error ("Record not found: $id");

should be..

Code:
$goto ? print $in->redirect ($goto) : print &error ("Record not found: $id");

ok.. newayz..

have i ever showed you...

http://www.pdamania.com/review2.cgi?ID=1002

------------------
Jerry Su
Links SQL User
------------------
Quote Reply
Re: Launching Link in Framset In reply to
Hello Jerry,

Any chance I get get review.cgi v2.0 now? I'm definitly waiting....I would really appreciate it!

------------------
James L. Murray
VirtueTech, Inc.
www.virtuetech.com


Quote Reply
Re: Launching Link in Framset In reply to
Hello Jerry,

That part worked to get it into the frames when a user goes to a link. How do I get it to work like the Links 2.0 mod were it called the jump_display.html template.

I tried to incorporate the code from your Links 2.0 mod into Links SQL but it did not work. I got software errors and compilation errors.

I want to be able to allow the user to rate the link and what not. Just like Eliot did on his site Anthrotech....thats a nice setup..



------------------
James L. Murray
VirtueTech, Inc.
www.virtuetech.com


Quote Reply
Re: Launching Link in Framset In reply to
I got everything working on this mod, with one exception. It seems that in Internet Explorer, the top frame always goes to the home page of my site, and not the jumpframe that I have set up in the code for this mod. It works perfectly in Navigator though. Also, when I just type in the full path to the top redirect in IE, it works fine, I get what I expect. I don't think it's a browser thing, I tried the paintballcity.com that appears to also be using this mod and it works fine in IE... Anyone have any ideas what might be causing it? It's really weird.

Jerry


Quote Reply
Re: Launching Link in Framset In reply to
Netscape Navigator is more forgiving of minor errors than MSIE in that respect. You need to check your HTML code carefully, maybe even print it out, and make sure that it's really doing what you asked it to do. If you know what page is different in MSIE and NN then start there. You might have to even go back one, or to the begining, but you've got to start somewhere :)

http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/

Quote Reply
Re: Launching Link in Framset In reply to
I don't know if you have figured this out, James....But I have...and the instructions posted by Jerry are bit incomplete for most novice programmers...

Here is what I did....(works in Links SQL 1.11):

1) Add the following text in the @EXPORT = qw/ section:

Code:

&site_html_jump_display &site_html_jump_error


2) Add the following subs in your HTML_Templates.pm file:

Code:

sub site_html_jump_display {
#---------------------------------------------------------
# Top Frame for Jump.cgi

my ($tags, $dynamic) = @_;
my $template = defined $dynamic ? $dynamic->param('t') : undef;
(ref $tags eq 'HASH') or croak "HTML_TEMPLATES: Argument '$tags' must be hash reference";

defined $dynamic and &load_user ($dynamic, $tags);
my $output = &load_template ('jump_display.html', {
%$tags,
%GLOBALS
}, undef, $template);
defined $dynamic and &clean_output($dynamic, \$output);
print $output;
}


AND

Code:

sub site_html_jump_error {
#---------------------------------------------------------
# Error Page for jump.cgi

my ($tags, $dynamic) = @_;
my $template = defined $dynamic ? $dynamic->param('t') : undef;
(ref $tags eq 'HASH') or croak "HTML_TEMPLATES: Argument '$tags' must be hash reference";

defined $dynamic and &load_user ($dynamic, $tags);
my $output = &load_template ('jump_error.html', {
%$tags,
%GLOBALS
}, undef, $template);
defined $dynamic and &clean_output($dynamic, \$output);
print $output;
}


Note: You do not have to add the second sub-routine...you can use sub site_html_error instead.

3) Create two new template files: jump_display.html and jump_error.html. If you chose not to add the second sub above, then you do not need to create the second template file. The jump_display.html can contain the following:

a) Rate Form
b) Links to other interactive options
c) Link to Category Page using the following codes and tags:

Code:

<a href="<%build_root_url%>/<%Category%>/">Category Page</a>


4) Then in the jump.cgi file, change the following codes, add the following codes in the load modules section:

Code:

use Links;
use HTML_Templates;


Note: I have put my modules in a different directory and I am using the following codes:

Code:

use Links::Links;
use Links::HTML_Templates;


But if you are using the default structure of Links SQL, you should be fine with the first set of module codes.

5) Add the following codes in the jump.cgi file:

Code:

print $in->header('text/html');


in the sub main routine before the my... codes.

6) Then replace the following codes in the sub main routine in the jump.cgi file:

Code:

my ($db, $id, $sth, $total, $rec, $offset, $goto, $track, $update);


with the following codes:

Code:

my ($db, $id, $sth, $total, $rec, $offset, $goto, $track, $update, $category, $name);


7) Then add the following set of codes:

Code:

elsif ($in->{'display'}) {
$rec = $db->get_record($id, 'HASH');
$rec or &Links::DBSQL::cgierr ("Can't find link ID: $id");
$category = $rec->{'CategoryID'};
$name = &get_category_name ($category);
&site_html_jump_display ({Category => $name}, $dynamic);
exit;
}


BEFORE the following codes:

Code:

# Otherwise, if we have a link, let's look it up.
elsif (defined $id) {


8) Then replace the following codes (as Widgetz/jerrysu provided before):

Code:

$goto ? print $in->redirect ($goto) : return &error ("Record not found: $id");


to the following codes:

Code:

print qq~
<html>
<head>
<title>${$rec}{'Title'}</title>
</head>
<frameset rows="100,*" frameborder="0" border="0" frameborder="no" border="no" framespacing="0">
<frame name="top" src="$LINKS{build_jump_url}?ID=$id&display=1" marginwidth="0" marginheight="0" scrolling="no" frameborder="no">
<frame name="bottom" src="$goto" marginwidth="0" marginheight="0" scrolling="auto" frameborder="no">
<noframes>
<body>
~;
$goto ?
print "Go to: <a href=\"$goto\">${$rec}{'Title'}</a>\n\n" :
&error ("Record not found: $id)");
print qq~
</body>
</noframes>
</frameset>
</html>~;


Note: As widgetz/jerrysu noted, if you are using the default version of jump.cgi, you should change the return to print.

That should do it...

Note: Remember the error subs I referred to above...well, you can replace all occurrences of &error with &site_html_error OR site_html_jump_error depending whether or not you added the new sub or not.

Man...Links SQL is fun. Smile

Hope this helps.

Regards,

Eliot


Quote Reply
Re: Launching Link in Framset In reply to
Hello everyone!

I didn't everything just as Anthro provided, but I got this software error:

Execution of jump.cgi aborted due to compilation errors.

I know that is sorta a broad error but does this give a hint to anything? God bless!



<><------------><>
Daniel
http://www.christian-search.net
<><------------><>
Quote Reply
Re: Launching Link in Framset In reply to
In Reply To:
I didn't everything just as Anthro provided, but I got this software error:
Welp...can't really take responsibility for hacks you have implemented. Follow ALL the steps provided above and see what happens first, rather than hacking in midstream of implementing the mod!

Good luck!

Regards,

Eliot Lee