Gossamer Forum
Home : Products : Links 2.0 : Customization :

Launching in frameset

(Page 2 of 4)
> > > >
Quote Reply
Re: Launching in frameset In reply to
Jerry and Digital Pimp;
I know that you guys worked hard on this mod. If it would be nice to share the complete instruction of this mod to everybody. Would you guys mind to make out a complete instruction sheet to show how to make the frameset?Because I read from the top to bottom of this message, I am completely lost.

Thanks a lot.
Quote Reply
Re: Launching in frameset In reply to
digi.. you are using a URL to pass information.. have you tried to use a link that has likea & or a % in the description??

um tim.. i don't even use this code!! it's off my head like i told you.. i know why it doesn't work for random though.. i'll fix that in a sec..

jerry
Quote Reply
Re: Launching in frameset In reply to
nope.. not yet... is this annoying?? more..

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

jerry

[This message has been edited by widgetz (edited September 10, 1999).]
Quote Reply
Re: Launching in frameset In reply to
padders.. that's the whole point of my second addition...

on the template.. you can put any info about the link.. like putting

<%Rating%> etc...

understand?

digitalpimps does too.. expect it is in URL form.. ie:

blah.cgi?ID=10&Something=HAha&Description=this is a description..&total=(&*&$

problem is.. description will be cutoff at this for netscape.. and (&*&$ won't work either.. he has to urlencode it.. still.. use the second post that i put up as well as the first one.. cause that way you can use any field by editing the template..

jerry

jerry
Quote Reply
Re: Launching in frameset In reply to
oh my gosh.. it's the next one..

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

jerry

[This message has been edited by widgetz (edited September 10, 1999).]
Quote Reply
Re: Launching in frameset In reply to
umm.. ok

[jump.cgi]

FIND:
Code:
require "admin/links.cfg"; # Change this to full path to links.cfg if you have problems.
require "$db_lib_path/db_utils.pl";
require "$db_lib_path/links.def";

BELOW ADD:
Code:
$build_use_templates ?
require "$db_lib_path/site_html_templates.pl" :
require "$db_lib_path/site_html.pl";

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

# Pull out the total number of links.
open (COUNT, "<$db_hits_path/index.count") or &error ("unable to open index count file: $db_hits_path/index.count. Reason: $!");
$count = int <COUNT>;
close COUNT;

# Get the random line from the url lookup database.
srand;
$find = 0; $rand = int (rand ($count + 0.5)); ($rand == $count) and ($rand--);
open (URL, "<$db_url_name") or &error ("unable to open url database: $db_url_name. Reason: $!");
while (<URL> ) {
$find++ == $rand or next;
/\d+$delim(.+)/o or next;
$goto = $1;
last;
}
close URL;
$goto or &error ("Can't find random line: $rand.");
}

UNDER ADD:
Code:
elsif ($in{'display'}) {
my (%rec) = &get_record ($in{$db_key});
($rec{$db_key} eq $in{$db_key}) ?
&site_html_jump_display (%rec) :
&error ("Unkown Link ID: $in{$db_key}");
exit;
}

FIND:
Code:
/\d+$delim(.+)/o or next;
$goto = $1;

CHANGE TO:
Code:
/(\d+)$delim(.+)/o or next;
($id, $goto) = ($1, $2);

####################################
IF YOU WANT TO USE YOUR RATING TEMPLATES AS THE TOP HEADER, SKIP THE NEXT STEPS AND GO TO THE NEXT MESSAGE
####################################

FIND:
Code:
# Now let's send the user to the url..
$goto ?
print "Location: $goto\n\n" :
&error ("Record not found ($in{$db_key})");

CHANGE TO:
Code:
# Now let's send the user to the url..
($goto) or &error ("Record not found ($in{$db_key})");
my (%rec) = &get_record ($id);
print "Content-type: text/html\n\n";
print qq~<html>
<head><title>$rec{'Title'}</title></head>
<body>
<frameset rows="70,*">
<frame name="top" src="$build_jump_url?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>~;

IF YOU USE TEMPLATES:

[site_html_templates.pl]

ADD THIS (above the 1; on the bottom):
Code:
sub site_html_jump_display {
my (%rec) = @_;
&html_print_headers;
print &load_template ('jump_display.html', {
%rec,
%globals
});
}

NEW TEMPLATE IN TEMPLATE FOLDER: jump_display.html

Code:
<html>
<head>
<title><%Title%></title>
</head>
<body>
Link: <%Title%>
Oh my gosh! look.. you can rate the link!!<p>
<form action="<%db_cgi_url%>/rate.cgi" method="POST">
<input type=hidden name="ID" value="<%ID%>">
<select name=rate>
<option>---
<option>1
<option>2
<option>3
<option>4
<option>5
<option>6
<option>7
<option>8
<option>9
<option>10
</select>
<input type=submit value="Rate this Link">
</form>
</body>
</html>

OTHERWISE, IF YOU DON'T USE TEMPLATES:

[site_html.pl]

ADD THIS (above 1; at the bottom):
Code:
sub site_html_jump_display {
my (%rec) = @_;
$output = qq~<html>
<head>
<title>$rec{'Title'}</title>
</head>
<body>
Link: $rec{'Title'}
Oh my gosh! look.. you can rate the link!!<p>
<form action="<%db_cgi_url%>/rate.cgi" method="POST">
<input type=hidden name="ID" value="$rec{$db_key}">
<select name=rate>
<option>---
<option>1
<option>2
<option>3
<option>4
<option>5
<option>6
<option>7
<option>8
<option>9
<option>10
</select>
<input type=submit value="Rate this Link">
</form>
</body>
</html>~;
return $output;
}

[This message has been edited by widgetz (edited September 11, 1999).]
Quote Reply
Re: Launching in frameset In reply to
To do this with rate templates..

[site_html.pl]

Code:
# Now let's send the user to the url..
$goto ?
print "Location: $goto\n\n" :
&error ("Record not found ($in{$db_key})");

CHANGE TO:
Code:
# Now let's send the user to the url..
($goto) or &error ("Record not found ($in{$db_key})");
my (%rec) = &get_record ($id);
print "Content-type: text/html\n\n";
print qq~<html>
<head><title>$rec{'Title'}</title></head>
<body>
<frameset rows="70,*">
<frame name="top" src="$build_rate_url?ID=$id" marginwidth="10" marginheight="10" scrolling="no" frameborder="no">
<frame name="bottom" src="$goto" marginwidth="10" marginheight="10" scrolling="auto" frameborder="no">
</frameset>
</body>
</html>~;

and then edit your rate template... you might want to change your success and failure forms too.. cause with such a small frame.. you might need to take off all those headers..

what i suggest.. you can make these yourself.. when they review.. it obviously gets the id.. print thanks for voting or something and then auto refresh to the rate page again.. (of course it won't only have ratings.. will have things like banner.. or a back button to your site.. or something else.. you know..)

jerry
Quote Reply
Re: Launching in frameset In reply to
Perfect! It runs great! Thanks, Jerry!

Cool!

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
if anyone wants to put this in resource center.. go ahead.. i think it would be useful.. i am probably going to use it for my developer.cgi (i have 3 jump.cgi clones FYI) they just go to different urls for each ID.. (3 URL fields..)

jerry
Quote Reply
Re: Launching in frameset In reply to
I think that Digital Pump or you should do it since you guys wrote the codes.

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'm too lazy too.. Wink

plus it seems other people are posting the things for me.. hehehe (like the rating image one and stuff like that)

Quote:
I think that Digital Pump or you should do it since you guys wrote the codes.

double check that sentence again....... PLZ..

eliot.. you should get ICQ.. idunno why.. but you should Wink [17144049.. mine]

jerry

hmm.. what was i going to work on next?? oh yea.. that category@ thing..

[This message has been edited by widgetz (edited September 10, 1999).]
Quote Reply
Re: Launching in frameset In reply to
I had ICQ for awhile, but it screwed up my Windows system. Also, I got a higher frequency of SPAM Mail with ICQ. So, I trashed it.

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
Well done;
I hope to see someone is not lazy enough to post the instruction on the resource center. I hope to see it there. Thanks to all of you for your hard work
Quote Reply
Re: Launching in frameset In reply to
http referer would work.. if you used it right..

query string is only the stuff in the url.. like

haha.cgi?this=is+a+query+string

jerry
Quote Reply
Re: Launching in frameset In reply to
Hello everyone!

I like what has been done, I was using frameit.cgi and found that is had bug. If you used more than on keyword, it would put a %20 between them, so the user would go back to

Code:
http://www.christian-search.net/cgi-bin/search.cgi?keywords=free%20cgi%20scripts

and then they get a "no matching records" error. Well, as I said, I like what has been done, but it need this same feature of being able to go back to the exact page on my domain that the user left. So, if I put this in there:

Code:
<a href=/"$ENV{'HTTP_REFERER'}/">Back to Your Search</a>

would that do it? I don't know if $ENV{'HTTP_REFERER'} is what frameit.cgi uses but whatever. God bless!

------------------
Daniel

dan@christian-search.net
http://www.christian-search.net
Quote Reply
Re: Launching in frameset In reply to
A couple things you could try:

1) Use $ENV{'QUERY_STRING'} rather than $ENV{'HTTP_REFERRER'}.

2) Use a javascript history link, such as the following:

Code:
<a href="javascript:history.go(-1)">Back to Previous Page</a>

You can also increase the number of pages back like -2. Of course, browsers interpret the number of pages back in frames differently. So, you will have to test it for yourself.

Hope this helps.

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
Only problem with using Javascript, is that not everyone has it turned on Wink

------------------
1010100101010010001
http://www.gqfitness.com
http://www.digitalskyline.com
Quote Reply
Re: Launching in frameset In reply to
hmm.. isn't the referer of a frame the page that the frame is in?? Wink

hehe.. scary..

who doest use javascript now anyways?

plus.. if they don't it's not like a popup will popup and say "you don't use javascript! you are in the 80's man! what's wrong with you??!!".. it will just do nothing.. won't it?

jerry
Quote Reply
Re: Launching in frameset In reply to
Hi all,

Widgetz, you're a genius! I have been following this thread with interest for some time now.

I installed the mod but I didn't want to use the Ratings template so I created a new jump_display.html template so I could have a customized top frame.

After following the instructions up to where the Ratings templates were utilized, the jump.cgi script returned a fatal error: undefined subroutine at line 82 (the site_html_jump_display sub).

So to jump.cgi I added:

Code:
$build_use_templates ?
require "$db_lib_path/site_html_templates.pl" :
require "$db_lib_path/site_html.pl";

right after:

Code:
require "admin/links.cfg"; # Change this to full path to links.cfg if you have problems.
require "$db_lib_path/db_utils.pl";
require "$db_lib_path/links.def";

This allowed the site_html_jump_display subroutine in site_html_templates.pl to be accessed.

HOWEVER, it seems that the template fields (ie. <%title_linked%> ) aren't being retrieved because a "Unkown Tag" error occurs when the top frame is built.

I have modified the sub site_html_jump_display in site_html_templates.pl to read:

Code:
sub site_html_jump_display {
# --------------------------------------------------------
# This routine determines how the top frame will look like.

my (%rec) = @_;

&html_print_headers;
print &load_template ('jump_display.html', {
total => $total,
grand_total => $grand_total,
link_results => $link_results,
title_linked => $title_linked,
%rec,
%globals
});
}

and placed it at the end of the
########################################################################################
# THE FOLLOWING ARE CGI GENERATED PAGES AND THE TEMPLATE MUST BE PRINTED, NOT RETURNED!#
########################################################################################
section.

I am no Perl genius and I greatly appreciate Widgetz' work on this mod. What have I done wrong?

Thanks,

Eric

P.S. when I use src="$build_rate_url?ID=$id" instead of src="$build_jump_url?ID=$id&display=1" it works perfectly.

[This message has been edited by Heisenberg (edited September 11, 1999).]
Quote Reply
Re: Launching in frameset In reply to
if you want title linked.. you have to add this to the end of site_html_templates.pl (above 1 Wink...

Code:
sub title_linked {
# --------------------------------------------------------
# Returns a string of the current category broken up
# by section, with each part linked to the respective section.

my $input = shift;
my (@dirs, $dir, $output, $path, $last);

@dirs = split (/\//, $input);
$last = &build_clean(pop @dirs);

$output = qq| <A HREF="$build_root_url/">$site_title</A> :|;
DIR: foreach $dir (@dirs) {
$path .= "/$dir";
if ($build_detailed) {
foreach (@softwarecat) { next DIR if ($dir eq $_); }
}
$dir = &build_clean ($dir);
$output .= qq| <A HREF="$build_root_url$path/">$dir</A> :|;
}
$output .= " $last";

return $output;
}

and then add this to the jump_display list..

Code:
title_linked => &title_linked("$rec{'Category'}/$rec{'Title'}"),

(it's cause title_linked is something from nph-build.cgi

jerry

Quote Reply
Re: Launching in frameset In reply to
Hey Widgetz, it works like a hot damn!!

I made sure to add target="_top" to <A HREF="$build_root_url$path/"> in the title_linked subroutine that was brought over from nph-build.cgi so that when visitors click on the links in the <%title_linked%> they are transported to the page on the site without frames.

I was also able to add a "Remove Frame" feature easily by using:
<a href="<%URL%>" target="_top">Remove Frame</a>

Thanks for a great mod!

Eric

P.S. Eliot's Javascript suggestion <a href="javascript:history.go(-1)">Back to Previous Page</a> works great too!
Quote Reply
Re: Launching in frameset In reply to
cool eliot.. all i'm gonna do with mine is put a reloading top frame that rotates a bunch of ads ;0)

KA CHING!

jerry
Quote Reply
Re: Launching in frameset In reply to
i went to a few of your sites.. and eliot has made really good use of this Smile

eliot.. i think you should make the rate form so that it will load in the top frame.. and then auto refresh back to it's http referer.. get me? that way they can stay at the persons site..

i also went to digtal pumps... but i got a 400 http error on the footer frame.. cause he's using he's frameit thingy..

http://www.gqfitness.com/.../links/jump.cgi?ID=5

is that only on netscape?

anyways.. i guess i'll use this on my own site too..

jerry
Quote Reply
Re: Launching in frameset In reply to
Eliot.. what do you use for reporting a dead link?

Could not find a mod about it...

Thanks

------------------
-------------------------
http://www.freeontheweb.com/
Reviewed and rated resources for webmasters
-------------------------
Quote Reply
Re: Launching in frameset In reply to
Yea...You can put virtually any of the tags in the top frame. I have the following features installed in my top frame:

1) Link to Home Page
2) Spider Site
3) Recommend Link
4) Report Dead Link
5) Translate Link
6) Link to Category Page where link is posted
7) Close Frame Option
8) Link to Previous Page

Just wanted to note this so that if others are interested in putting other tags in the top frame, they can.

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
> > > >