Gossamer Forum
Home : Products : Links 2.0 : Customization :

(Hits: 0 Votes: 0 Rating: 0)

Quote Reply
(Hits: 0 Votes: 0 Rating: 0)
Every time I get this result


(Hits: 0 Votes: 0 Rating: 0)


in my links I think This is not working. (no increment) please help me to get this right of this






Quote Reply
Re: (Hits: 0 Votes: 0 Rating: 0) In reply to
Try building the site from admin control. I hope this will help.

regards,

Pagla

Quote Reply
Re: (Hits: 0 Votes: 0 Rating: 0) In reply to
The hits display is updated as part of rebuilding the pages. Same is true for Votes and Ratings except there must be at least 10 Votes or Ratings for a link before it will display.

I hope this helps.

- Bobsie
bobsie@orphanage.com
http://goodstuff.orphanage.com/
Quote Reply
Re: (Hits: 0 Votes: 0 Rating: 0) In reply to
 
I tried that But no results
And I have put hits and votes manually from admin page then that link show that

Do you think where is the problem.

Quote Reply
Re: (Hits: 0 Votes: 0 Rating: 0) In reply to
In your links.html

Add this:

<DIV align="right"><small class="date">
<font color="#000000" face="Geneva, Arial, Helvetica, sans-serif" size="-2"><b>(Hits:</b></font>
<font color="#ff0000" face="Geneva, Arial, Helvetica, sans-serif" size="-2"><%Hits%></font>
<font color="#000000" face="Geneva, Arial, Helvetica, sans-serif" size="-2"><b> Votes:</b></font> <font color="#ff0000" face="Geneva, Arial, Helvetica, sans-serif" size="-2"><%Votes%></font>
<font color="#000000" face="Geneva, Arial, Helvetica, sans-serif" size="-2"><b> Rating:</b></font>
<font color="#ff0000" face="Geneva, Arial, Helvetica, sans-serif" size="-2"> <%Rating%></font>
<font color="#000000" face="Geneva, Arial, Helvetica, sans-serif" size="-2"><b>)</b></font></small>
</DIV>

One thing I read while searching the forum was that they have to be on separate lines.

Hope that helps.

George

Quote Reply
Re: (Hits: 0 Votes: 0 Rating: 0) In reply to
that is the code I have. But thanks for your help
My problem is No hits counting

always I get Hits: 0 . even I rebuild the pages.

do you think where is the problem

Quote Reply
Re: (Hits: 0 Votes: 0 Rating: 0) In reply to
Have you changed anything in nph-build.cgi?

Have you given the db's the correct permissions?

Have you defined the correct path to your databases in links.cfg?


Glenn

Quote Reply
Re: (Hits: 0 Votes: 0 Rating: 0) In reply to
1.Yes I have Changed nph-build.cgi because I have some mods Installed.
2.My links.db I have permision 644
other db's I have 666 Is this correct.
3.Iam sure path is correct.


Quote Reply
Re: (Hits: 0 Votes: 0 Rating: 0) In reply to
1. Which mods did you install?

2. Do your links go through jump.cgi when clicked on (jump.cgi is what creates the hit counters that nph-build.cgi uses when it rebuilds).

3. Your links.db should have 666 permissions and the data directory should have 777 permissions as should the data/hits and data/rates directories.

- Bobsie
bobsie@orphanage.com
http://goodstuff.orphanage.com/
Quote Reply
Re: (Hits: 0 Votes: 0 Rating: 0) In reply to
Yes you are right My links not going through jump.cgi
I have direct links to that sites
And also I have logo mods installd (not file upload mod)
expirate mod,isLinked,isBest
Please let me know How can I get this correct.

Quote Reply
Re: (Hits: 0 Votes: 0 Rating: 0) In reply to
If you are bypassing jump.cgi, then your hit counters will not update since jump.cgi is the script that creates and increments the hit counters for each link. I don't understand why anyone would want to bypass jump.cgi and use direct URLs to begin with unless they are not concerned with the number of hits (some people do not like/use that feature).

Your URLs to the links in your detail page should use something like this if you are using templates (as shown in the default detailed.html):
Code:
<a class="link" href="<%db_cgi_url%>/jump.cgi?ID=<%ID%>">Visit this link</a>
If you are not using templates, you specify the URL as follows in sub site_html_detailed, site_html.pl:
Code:
<a class="link" href="$build_jump_url?$db_key=$rec{$db_key}">Visit this link</a>
I hope this helps.

- Bobsie
bobsie@orphanage.com
http://goodstuff.orphanage.com/
Quote Reply
Re: (Hits: 0 Votes: 0 Rating: 0) In reply to
<a class="link" href="<%db_cgi_url%>/jump.cgi?ID=<%ID%>">Visit this link</a>

Sory I dont have above line in my details.html (Iam using templates).
Insted of that I have these lines in my site_html_templates.pl


sub site_html_detailed {
# --------------------------------------------------------
# This routine will build a single page per link. It's only
# really useful if you have a long review for each link --
# or more information then can be displayed in a summary.
#
my %rec = @_;
if ($rec{'isLinked'} eq 'Yes') {
$linkurl = qq|<a href="$rec{'URL'}" target="newwin">Visit this Link</a>|;
}

else {
$linkurl = qq|No Web Site|;
}
return &load_template ('detailed.html', {
total => $total,
grand_total => $grand_total,
title_unlinked => $title_unlinked,
title_linked => $title_linked,
linkurl => $linkurl,
%rec,
%globals
} );
}

sub site_html_detailed_error {
# --------------------------------------------------------
# This routine determines how the modify failure page will look like.
my $error = shift;
&html_print_headers;
print &load_template ('detailed_error.html', {
error => $error,
%in,
%globals
});
}
------------------------------------------------------------
But now Iam using new Info.cgi mod for my detail page
Here is my jump.cgi I think this have to be changed
because when I clicked this link http://www.lanka2000.com/jump.cgi?ID=12
It is not jumping to that link its try to find http://www.lank2000.com/jump.cgi?ID=12 this in that sever
and give me file not found error. I think this because jump cgi not re direct to http://www.lank2000.com this


So please check my jump.cgi

#!/usr/bin/perl
# -------------
# Links
# -------------
# Links Manager
#
# File: jump.cgi
# Description: Increments the number of hits for the specified link,
# and sends the user off to the appropriate page.
# Author: Alex Krohn
# Email: alex@gossamer-threads.com
# Web: http://www.gossamer-threads.com/
# Version: 2.0
#
# (c) 1998 Gossamer Threads Inc.
#
# This script is not freeware! Please read the README for full details
# on registration and terms of use.
# =====================================================================
#
# Form Input:
# '$db_key' = key number # Send as form input the key name and key value
# # of the link you want to go to.
#
# Setup:
# Make sure the require statement below points to the config file.

# Required Librariers
# --------------------------------------------------------
eval {
($0 =~ m,(.*)/[^/]+,) && unshift (@INC, "$1"); # Get the script location: UNIX /
($0 =~ m,(.*)\\[^\\]+,) && unshift (@INC, "$1"); # Get the script location: Windows \

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";
};
if ($@) {
print "Content-type: text/plain\n\n";
print "Error including libraries: $@\n";
print "Make sure they exist, permissions are set properly, and paths are set correctly.";
}

# ========================================================

eval { &main; }; # Trap any fatal errors so the program hopefully
if ($@) { &cgierr("fatal error: $@"); } # never produces that nasty 500 server error page.
exit; # There are only two exit calls in the script, here and in in &cgierr.

sub main {
# --------------------------------------------------------
my %in = &parse_form();
my ($goto, $id, $delim, $time);

$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!");
}

# This was changed to allow link to the detailed page
# Now let's send the user to the url..
$goto ?
print "Location: $build_detail_url/$id$build_extension\n\n" :
&error ("Record not found ($in{$db_key})");
}

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


Quote Reply
Re: (Hits: 0 Votes: 0 Rating: 0) In reply to
In Reply To:
Sory I dont have above line in my details.html (Iam using templates).
Insted of that I have these lines in my site_html_templates.pl
I didn't say details.html, I said detailed.html which is the name of the template you should have in your templates directory. Looking in sub site_html_detailed, site_html_templates.pl, you will see that detailed.html is what Links is looking for:
Code:
return &load_template ('detailed.html', {
total => $total,
grand_total => $grand_total,
title_unlinked => $title_unlinked,
title_linked => $title_linked,
linkurl => $linkurl,
%rec,
%globals
} );
If you are using details.html as the name of your template file, it will not work.
In Reply To:
But now Iam using new Info.cgi mod for my detail page
Here is my jump.cgi I think this have to be changed
because when I clicked this link http://www.lanka2000.com/jump.cgi?ID=12
It is not jumping to that link its try to find http://www.lank2000.com/jump.cgi?ID=12 this in that sever
and give me file not found error. I think this because jump cgi not re direct to http://www.lank2000.com this
Is jump.cgi in your web directory? That is where the URL is saying it is. I would think that it would be in something like:
Code:
http://www.lank2000.com/cgi-bin/links/jump.cgi?ID=12
How about posting the first 5 URLs and paths from your links.cfg file (don't post the whole links.cfg file) so that I can get a better idea as to how you have things setup?

- Bobsie
bobsie@orphanage.com
http://goodstuff.orphanage.com/
Quote Reply
Re: (Hits: 0 Votes: 0 Rating: 0) In reply to
Code:
# This was changed to allow link to the detailed page
# Now let's send the user to the url..
$goto ?
print "Location: $build_detail_url/$id$build_extension\n\n" :
&error ("Record not found ($in{$db_key})");
}
If you are using jump.cgi to link to my info.cgi mod, then you are using the variables there! The above codes will send you to static details pages, which you said you aren't using.

try
Code:
# This was changed to allow link to the detailed page
# Now let's send the user to the url..
$goto ?
print "Location: $db_cgi_url/info.cgi?ID=$id\n\n" :
&error ("Record not found ($in{$db_key})");
}
--Drew
Quote Reply
Re: (Hits: 0 Votes: 0 Rating: 0) In reply to
Thanks for all the infomation.
Now my hits counting But in detailed.htm (info.cgi)
(visit this link ) in that I dont have

http://www.lanka2000.com/cgi-bin/links/jump.cgi?ID=12

This type of link. I only have URL


I think my site html templates should have to chang
please check this one


sub site_html_detailed {
# --------------------------------------------------------
# This routine will build a single page per link. It's only
# really useful if you have a long review for each link --
# or more information then can be displayed in a summary.
#
my %rec = @_;
if ($rec{'isLinked'} eq 'Yes') {
$linkurl = qq|<a href="$rec{'URL'}" target="newwin">Visit this Link</a>|;
}

else {
$linkurl = qq|No Web Site|;
}
return &load_template ('detailed.html', {
total => $total,
grand_total => $grand_total,
title_unlinked => $title_unlinked,
title_linked => $title_linked,
linkurl => $linkurl,
%rec,
%globals
} );
}

Quote Reply
Re: (Hits: 0 Votes: 0 Rating: 0) In reply to
Please Give me a Solution for this .
Please.........
Thanks

Quote Reply
Re: (Hits: 0 Votes: 0 Rating: 0) In reply to
Please Give me solution for this

I have this line in my (sub site_html_detailed) and How can I get jump.cgi to this?

$linkurl = qq|<a href="$rec{'URL'}" target="newwin">Visit this Link</a>|;

Thanks for all