Gossamer Forum
Home : Products : Links 2.0 : Customization :

Hit counter for detailed pages [please help!]

(Page 2 of 2)
> >
Quote Reply
Re: Hit counter for detailed pages [please help!] In reply to
Well...you can replace the following codes that Widgetz has recently provided:

Code:

$title_linked = &build_linked_title ("$rec{'Category'}/$rec{'Title'}");
&html_print_headers;
print &site_html_detailed (%rec);


WITH the following codes:

Code:

print "Location: $build_detail_url/$rec{'ID'}$build_extension\n\n"


This will record the HITS and then redirect to the DETAILED page! (non-cgi)

Regards,

Eliot Lee
Quote Reply
Re: Hit counter for detailed pages [please help!] In reply to
It is the actual code that may have the 500 error (premature end of script headers)

Can someone check the syntax of widgetz above code please?

It returns 500 errors no matter how I call it (btw - is there a way to check which line the error may be in?)

Quote Reply
Re: Hit counter for detailed pages [please help!] In reply to
In Reply To:
It returns 500 errors no matter how I call it (btw - is there a way to check which line the error may be in?)
Yes...if you have telnet access...

Use the following command lines:

1) Access directory where counter.cgi resides:

Code:

cd /cgi-bin/links/


2) Check the syntax of the file:

Code:

perl -c counter.cgi


3) Copy the error message in your clipboard (Notepad)

4) Then open the file:

Code:

vi counter.cgi


5) Go to the line where the error is:

Code:

:57


Replace 57 with the line number of the syntax error.

6) Copy the line and paste it into your clipboard (Notepad)

7) Then exit the file:

Code:

:q!


Couple suggestions:

1) Get a Text Editor that shows line numbers:

http://www.textpad.com
http://www.editplus.com

2) Learn some UNIX if you want to use telnet to view your files and target shoot your file problems.

Regards,

Eliot Lee
Quote Reply
Re: Hit counter for detailed pages [please help!] In reply to
Hmmm...the errors seemed odd

Here is the counter.cgi file in txt format:
http://www.wheelweb.com/downloads/counter.txt

The errors returned by the telnet commands are denoted by:
# error

It looks okay to me but...

also, the last error message said:
counter.cgi had compilation errors.

not sure what that means?

Quote Reply
Re: Hit counter for detailed pages [please help!] In reply to
Welp...my only other suggestion is that you use the default version of jump.cgi...rename it to something like counter.cgi.

Then replace the following codes:

Code:

print "Location: $goto\n\n" :


with the following codes:

Code:

print "Location: $build_detail_url/$id$buildextension\n\n" :


Then add the following codes in your link.html file:

Code:

<a href="<Û_cgi_url%>/counter.cgi?ID=<%ID%>">Detailed Page</a>


This is the last suggestion I have for you.

Good luck!

Regards,

Eliot Lee
Quote Reply
Re: Hit counter for detailed pages [please help!] In reply to
the last codes didn't seem to work - 4 whatever reason but...I think I have come up with a solution (for now until I find a bug)

but it is pretty lengthy and difficult to explain so...

thanks for everyones help

Quote Reply
Re: Hit counter for detailed pages [please help!] In reply to
Welp....glad you figured it out...

And if you want help with this particular code hack and others...explaining the errors you receive is a lot better than plainly stating "for whatever reason".

Best of luck with your Links projects!

Regards,

Eliot Lee
Quote Reply
Re: Hit counter for detailed pages [please help!] In reply to
i fixed the 500 error.. i forgot to finish a if else statement i started..

Jerry Su
email@jerrysu.com
http://www.jerrysu.com/
Quote Reply
Re: Hit counter for detailed pages [please help!] In reply to
I don't have much knowledge of Perl, where do I have to put this piece of code of jump.cgi into detailed.cgi ?? And where do I have to place it in detailed.cgi ??

Thankx a lot

Puffy Dog

> >