Gossamer Forum
Home : Products : Links 2.0 : Customization :

Launching in frameset

(Page 1 of 4)
> >
Quote Reply
Launching in frameset
I'm attempting what should be a fairly easy mod that launches the site links inside of a frameset with a footer containing a rating form specific to the site in the main frame. It will also have a link to colapse the frameset, and to return to the directory of sites. So here's the deal, I'm thinking of just using an external script, which will be called by the jump.cgi script. What I need to know is how can I get the site's title from inside the jump.cgi, in order to pass it along to the frame script. Here is what I started with: (inside jump.cgi)

# Let's get the URL.
open (URL, "<$db_url_name") or &error ("unable to open url database: $db_url_name. Reason: $!");
while (<URL> ) {
(/^$id$delim(.+)/o) or next;
chomp ($goto = $1);
last;
}
close URL;
$goto or &error ("Can't find link id: $id");
# My addition, I need to put the title
# into $title
# Frame it Mod ~ Let's get the title.
open (URL, "<$db_links_name") or &error ("unable to open links database: $db_links_name. Reason: $!");
while (<URL> ) {
(/^$id$delim(.+)/o) or next;
chomp ($goto = $1);
last;
}
close URL;
$goto or &error ("Can't find link id: $id");

# I need help with getting this variable ;(



Further on, I added this:

# Now let's send the user to the url..
print "Location: http://www.gqfitness.com/cgi-bin/frameit.cgi?url=$goto&title=GQ+Fitness.com,+Directory:$title\n\n"

# ... this part should work,
# once I have the $title variable ...

Help pleez Wink



------------------
Quote Reply
Re: Launching in frameset In reply to
Ok that's looks like it may work a bit better then what I had in mind, but I still need a way for the script to generate the html for the footer frame, because the bottom frame has to have ID & Title variables contained inside the voting form etc. Like I said this is a simple mod, but I'm just learning Cgi, (I do have other programming exp Smile It's still going to have to call the other script for the bottom frame, unless there is a way for me to write inside that frameset, without calling another script. Am I right/wrong? Maybe you have an easy way to write the footer as well?
Thanks again!

------------------
Quote Reply
Re: Launching in frameset In reply to
umm.. you should make a subroutine or something in jump.cgi that says if ($in{'display'} eq "frame" or something and then with the ID input you can use get_records to get all the info..

jerry
Quote Reply
Re: Launching in frameset In reply to
go down

Code:
_| |_
\ /
\ /
\ /
\/

jerry

[This message has been edited by widgetz (edited September 10, 1999).]
Quote Reply
Re: Launching in frameset In reply to
Alright, I got the footer thing figured out. But now all I'm getting back is a blank screen, with this as the source:

<html>
<head><title>The Don Lemmon Show</title></head>
<body>
<frameset border="0" frameborder="0" rows="*,40">
<frame NAME="body" SRC="http://www.donlemmon.com" SCROLLING="auto" MARGINWIDTH="0" MARGINHEIGHT="0" target="_parent">
<frame NAME="footer" SRC="http://www.gqfitness.com/cgi-bin/frameit.cgi?id=4&title=The Don Lemmon Show&referrer=http://www.gqfitness.com/directory/Nutrition/&url=http://www.donlemmon.com&footer=YES" SCROLLING="no" MARGINWIDTH="0" MARGINHEIGHT="0" BORDER="0" NORESIZE target="_parent">
</frameset>
</body>
</html>

Looks syntatically correct, but then why isn't actually showing the contents of the frames? Each URL works independantly... I will experiment, but maybe I'm missing something. Oh and here is the modified code:

# Now let's send the user to the url..

($goto) or &error ("Record not found ($in{$db_key})");
my (%rec) = &get_record ($in{$db_key});

print "Content-type: text/html\n\n";
print qq~<html>
<head><title>$rec{'Title'}</title></head>
<body>
<frameset border="0" frameborder="0" rows="*,40">
<frame NAME="body" SRC="$goto" SCROLLING="auto" MARGINWIDTH="0" MARGINHEIGHT="0" target="_parent">
<frame NAME="footer" SRC="http://www.gqfitness.com/cgi-bin/frameit.cgi?id=$id&title=$rec{'Title'}&referrer=$ENV{'HTTP_REFERER'}&url=$goto&footer=YES" SCROLLING="no" MARGINWIDTH="0" MARGINHEIGHT="0" BORDER="0" NORESIZE target="_parent">
</frameset>
</body>
</html>~;

}
Thanks for your help!

------------------
Quote Reply
Re: Launching in frameset In reply to
Ok fixed it... the body tags should be after the frameset tags. Here it is if anyone is interested:

# Now let's send the user to the url..

($goto) or &error ("Record not found ($in{$db_key})");
my (%rec) = &get_record ($in{$db_key});

print "Content-type: text/html\n\n";
print qq~<html>
<head><title>$rec{'Title'}</title></head>

<frameset border="0" frameborder="0" rows="*,40">
<frame NAME="body" SRC="$goto" SCROLLING="auto" MARGINWIDTH="0" MARGINHEIGHT="0" target="_parent">
<frame NAME="footer" SRC="http://www.gqfitness.com/cgi-bin/frameit.cgi?id=$id&title=$rec{'Title'}&referrer=$ENV{'HTTP_REFERER'}&url=$goto&footer=YES" SCROLLING="no" MARGINWIDTH="0" MARGINHEIGHT="0" BORDER="0" NORESIZE target="_parent">
<noframes>
<body></body>
</noframes>
</frameset>
</html>~;

------------------
Quote Reply
Re: Launching in frameset In reply to
hehe.. i guess you didn't understand me.. Smile

you shouldn't use the url for the thingy.. as then it can be edited.. all the title and stuff should be retrieved with perl..

it's really simple.. just use sub get_records

jerry
Quote Reply
Re: Launching in frameset In reply to
Well it works now regardless. I also had to modify part of the script for the random link function, it was returning $id=random , when of course I wanted the table key. I just added $id = $rand after the call. It still doenst return the title, but that isn't necessary anyways, it is worded so that it doesn't matter.

------------------
Quote Reply
Re: Launching in frameset In reply to
I really like the idea of frames thing but a little confused.

In the bottom frame, i would like to be able to have a small form for reviwing with widgetz mod, a back to category page you just come from, an "open this page in new window and send this page back to category" and close frame.

I have read this post and not sure where to start! If anyone has any time perhaps they can write out what to do for us non-perl gurus :-)

------------------
-------------------------
http://www.freeontheweb.com/
Reviewed and rated resources for webmasters
-------------------------
Quote Reply
Re: Launching in frameset In reply to
I have done this...with the original rate form in the top frame. To take a look at what I've done, go to:

anthrotech.com/resources/Education/

Then click on any of the links.

I have also added the original "Location" codes between the <body></body> tags that will still jump to the URL for people who do not have Java enabled browsers or have turned off Java.

Smile

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: Launching in frameset In reply to
There is a small glitch I've come accross with linking the rate.cgi in the top frame.

I have used the following codes for the top frame link:

Code:
/cgibin/wwwvl/rate.cgi?ID=$in{$db_key}
/cgibin/wwwvl/rate.cgi?ID=$rec{'ID'}

Here is the complete codes I have in the jump.cgi file:

Code:
($goto) or &error ("Record not found ($in{$db_key})");
my (%rec) = &get_record ($in{$db_key});
print "Content-type: text/html\n\n";
print qq~<html>
<head><title>$rec{'Title'}</title></head>
<frameset rows="90,*">
<frame name="top" src="/cgibin/wwwvl/rate.cgi?ID=$in{$db_key}" 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 "Location: $goto\n\n" :
&error ("Record not found ($in{$db_key})");
print qq~</body>
</noframes>
</frameset>
</html>~;

The problem is that when someone clicks on the "Random Link" link, the rate.html file is not opened in the top frame.

Anyone know how to solve this glitch?

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: Launching in frameset In reply to
Is that so? The "thrid party" script is freeware, and simple to use. Maybe you could prove your statement about the 404 with a URL? It works great here, and I don't have any of the problems your having. For some reason I get the feeling like you have something against me trying to help out here. Or maybe we both found out a way to do the same thing, but my way works with the random links and also works if you want to frame other outside links, like I do when using my Net search utility. It can be used with any of the remote links on your site, for instance a banner link. It's very customizable, and you don't have to touch the rate.cgi script.

Here is the URL to the FrameIt script:
http://www.verysimple.com/scripts/frameit.html

and an example of it working with the random link:
http://www.gqfitness.com/...s/jump.cgi?ID=random

any questions?

------------------
1010100101010010001
http://www.gqfitness.com
http://www.digitalskyline.com
Quote Reply
Re: Launching in frameset In reply to
Look at the code I have posted above. Mine is working great, but I am using another script from Matts Script Archive called "FrameIt". It's a single CGI program that launches the link you specify in the frameset. If you look at my code above, and then customize the FrameIt script to display what you want it to where it's footer HTML is, you see it's pretty simple. You'll also have to add a couple variables to pass the page title and ID to the frameit script so that your vote functions work. Look at my site for an example @ http://www.gqfitness.com/directory . Good Luck!

PS If you need help customizing the frameit script I can send you mine via email if you request it.


------------------
1010100101010010001
www.gqfitness.com
www.digitalskyline.com

[This message has been edited by Digital Pimp (edited September 08, 1999).]
Quote Reply
Re: Launching in frameset In reply to
My codes work just fine and I don't need to use a third party script. It is integrated nicely with the jump.cgi and rate.cgi files.
I am able to use the rate.html template in the top frame to pass the tags and variables.
That is NOT the problem

The problem is with RANDOM links. When someone clicks on the RANDOM LINK link, the rate.html file does not appear.

BTW: I checked out your site and the bottom frame doesn't work. HTTP 404 NOT FOUND! So, I think that your codes do not work as perfectly as you've stated.

Wink

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us

[This message has been edited by Eliot (edited September 08, 1999).]
Quote Reply
Re: Launching in frameset In reply to
[Posted in Error]

Regards,



------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us

[This message has been edited by Eliot (edited September 08, 1999).]

[This message has been edited by Eliot (edited September 08, 1999).]

[This message has been edited by Eliot (edited September 08, 1999).]
Quote Reply
Re: Launching in frameset In reply to
well.. DUH..

find somewhere inside of the jump.cgi the place where it prints the location to the random link.. and just change that so it fits with the code above...

the reason it doesn't work right now is cause the random link uses a different

print "Location: $something\n\n";

i took out my random link thing.. so i have no clue where it is.. i remembered it to be at the top of sub main though..

jerry
Quote Reply
Re: Launching in frameset In reply to
Do you mean this line, Jerry?

Code:
if ($id eq "random") {
my ($count, $rand, $find);

I suppose I could delete these lines. However, I was just wondering if there is a way to allow people to still vote for the Random Link?

Thanks, Jerry. (I did think of deleting the random codes, but I was still fishing for a way to vote for the random link.)

Smile

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: Launching in frameset In reply to
I have been informed that my script is not working correctly in Netscape (the dying browser). Sorry I forgot to check it. It's got to do with the fact that IE parses the URL and fixes things like spaces by replacing them with %20, NS, being an unforgiving POS browser, still attempts to pass a URL with spaces, which obviously doesnt work because of the way http and servers handle the data.
What I have to do to fix it is parse the title before passing it to the second script. I will replace spaces with +'s, the frameit script already decodes +'s as spaces, so that will be the only change to make this script work on all browsers.

As for the demeanor of this discussion, I'd have to attribute it to users disposition. (a new internet related illness) Wink

------------------
1010100101010010001
http://www.gqfitness.com
http://www.digitalskyline.com
Quote Reply
Re: Launching in frameset In reply to
still not there.. but close..

Code:
_| |_
\ /
\ /
\ /
\/

jerry

[This message has been edited by widgetz (edited September 10, 1999).]
Quote Reply
Re: Launching in frameset In reply to
Thanks, Jerry. I appreciate your effort and time. I will try those codes when I get home tonight.

It makes sense. I did come up with a quick and dirty solution, which was editing the rate_top.html template, which was the page that was popping up in the top frame.

But I like your solution because it allows people to vote for the random link.

Thanks again.

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: Launching in frameset In reply to
Close, but no cigar. Smile

I added all the codes. No I get a blank screen in the top frame, with the following HTML SOURCE CODE:

Code:
<html>
<head>
<title></title>
</head>
<frameset rows="90,*">
<frame name="top" src="http://www.anthrotech.com/cgibin/wwwvl/jump.cgi?ID=random&display=1" marginwidth="0" marginheight="0" scrolling="no" frameborder="no">
<frame name="bottom" src="http://www.uiowa.edu/~commstud/resources/GenderMedia/cyber.html" marginwidth="0" marginheight="0" scrolling="auto" frameborder="no">
<noframes>
<body>Location: http://www.uiowa.edu/~commstud/resources/GenderMedia/cyber.html

</body>
</noframes>
</frameset>
</html>

Oh well...I will work on it some more. Something has to click.

Thanks again, Jerry! Smile

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: Launching in frameset In reply to
Hello all;
When this one got done and perfectly run. Can anyone please post a complete instruction or details on the resources center? So that everyone can share.

Thanks for your effort.
Quote Reply
Re: Launching in frameset In reply to
That would have to be up to Jerry since he has written most if not all of the codes for this particular modification.

Smile

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: Launching in frameset In reply to
Jerry..

i am not sure about this but is there a way so that on the bottom frame you can have lots of variables about the link, ie you could have the link name, number of hits and this sort of stuff as well as the rate it form included and a link to the correct review.cgi link?

I do not really understand it all that welso was wondering if you can help....

Thanks a lot :-)

------------------
-------------------------
http://www.freeontheweb.com/
Reviewed and rated resources for webmasters
-------------------------
Quote Reply
Re: Launching in frameset In reply to
That's how mine works, you can pass any information you want to the frameit script, and include it in the footer.



------------------
1010100101010010001
http://www.gqfitness.com
http://www.digitalskyline.com
> >