Gossamer Forum
Home : Products : Links 2.0 : Customization :

Need help with "Ask.com style banners/headers at the top of a visited link in the form of frames"! Please!

Quote Reply
Need help with "Ask.com style banners/headers at the top of a visited link in the form of frames"! Please!
Hi all

I've been trying to setup "Ask.com style banners/headers at the top of a visited link in the form of frames." mod unsuccessfully. It seems pretty simple to setup but after trying numerous time as instructed in the mod (& even after making a bit of changes on my own ) I just can't get it to work!!

I tried searching the Forum but it didn't help. As my last option i'm asking u guys to kindly help me out! below is the code of my modified jump.cgi (starting from where i started to modify it):

sub main {
# --------------------------------------------------------
my %in = &parse_form();

$linksmenu = $in{'linksmenu'};
$id = $in{$db_key};
$delim = quotemeta($db_delim);
$time = time();

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.");
}
elsif (exists $in{$db_key}) {
# Make sure this is a valid looking id.
($id =~ /^\d+$/) or &error ("Invalid id: $id");

# 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");

# Bump the counter one.
if (open (HIT, "<$db_hits_path/$id")) {
my ($count, $old_time, @IP, $ip, $visited);
chomp ($count = <HIT>);
chomp ($old_time = <HIT>);
chomp (@IP = <HIT>);
(($time - $old_time) > 21600) and (@IP = ());
foreach $ip (@IP) {
$ip eq $ENV{'REMOTE_ADDR'} and ($visited++ and last);
}
if (!$visited) {
push (@IP, $ENV{'REMOTE_ADDR'});
$count = $count + 1;
open (HIT, ">$db_hits_path/$id") or &error ("Can't open for output counter file. Reason: $!");
if ($db_use_flock) { flock (HIT, 2) or &error ("Can't get file lock. Reason: $!"); }
local $" = "\n";
print HIT "$count\n$time\n@IP";
close HIT;
}
}
else {
open (HIT, ">$db_hits_path/$id") or &error ("Can't increment counter file. Reason: $!");
print HIT "1\n$time\n$ENV{'REMOTE_ADDR'}";
close HIT;
}
}
else {
&error ("No link specified!");
}

# Print the Links Menu in the frames..
if ($linksmenu == 1) { &linksmenu; exit; }

# Now let's send the user to the url..
$goto ?
print "Content-type: text/html\n\n";
print qq|

<HTML>
<HEAD>
<TITLE>Visiting a link</title>
</HEAD>
<FRAMESET ROWS="21%,4%,75%" frameborder=0 framespacing=0 border=0>
<NOFRAME>This site uses Frames but your browser doesn't support it. <a href="$goto">Click here</a> to see a non-frame version of this site</NOFRAME>
<FRAME NAME="header" SRC="http://www.mywebsite.com/directory/visitinglinkheader.shtml" scrolling="no" noresize>
<FRAME NAME="linksmenu" SRC="http://www.mywebsite.com/cgi-bin/directory/jump.cgi?ID=$id&linksmenu=1" marginheight=0 marginwidth=0 scrolling="no" noresize>
<FRAME NAME="website" SRC="$goto" noresize>
</FRAMESET>
</HTML>

|;

&error ("Record not found ($in{$db_key})");

}

sub linksmenu {
print<<EndHTML;
<HTML>
<HEAD>
<TITLE>Links Menu</TITLE>
</HEAD>
<BODY>

<center>
<font face="verdana,arial" size=2><a href="/directory/" target="_parent"><<< Back to Links</a></font>

<font face="verdana,arial" size=2><a href="http://www.mywebsite.com/cgi-bin/directory/rate.cgi?ID=$id" target="_parent">Rate this Link</a></font>

<font face="verdana,arial" size=2><a href="$goto" target="_parent">Remove Frames</a></font>
</center>

</BODY>
</HTML>
EndHTML
}

sub error {
# ------------------------------------------
#
print "Content-type: text/plain\n\n";
print "Error: $_[0]\n";
exit;
}

Please note that i have intentionally put the http://www.mywebsite.com as my link in there.

I would really appreciate any help at all with this.

Thanks
Deep Impact


Quote Reply
Re: [Deep Impact] Need help with "Ask.com style banners/headers at the top of a visited link in the form of frames"! Please! In reply to
if i catch good your cuestion u must create a directory in the cgi-bin in /links/admin/data/header
there u put a ask.txt for example and in that ask.txt u put what u like to show up in the header ok
then in your category.html u put <%header%> and then u do a build and it should show up and do the same for the footer.
Dont forgot to go in the modify category then list all and there u can put in the category if u have one called town there put in the blank space of header put ask.txt
Hope this helps u
Saludos
Chris