Gossamer Forum
Home : Products : Links 2.0 : Customization :

Top 5 Most visited (Called with SSI)

Quote Reply
Top 5 Most visited (Called with SSI)
I tried everything but i need a MOD so i can get links2 to build an extra html that has the Top5 Most Visited sites
and its nothing like the top 10 that the script has
i want it to be in html because then i can call it with SSI on my main. Eliot tried to help me but hmm it didnt help at all searching for Top Ten Mod wasnt a good idea =(

Quote Reply
Re: Top 5 Most visited (Called with SSI) In reply to
Really??

Did you read the posts in the following Thread?

http://www.gossamer-threads.com/...=&vc=1#Post39594

SSI codes have been provided in various posts in this Thread.

I used the same keywords I provided you "Top Ten Mod" in the
Links 2.0 Customization Forum, using And search
option, and in the past year for the Date Range field.

And please in the future...add replies to your original Threads
rather than adding duplicate Threads in the forum.

Thank you.

Regards,

Eliot Lee
Quote Reply
Re: Top 5 Most visited (Called with SSI) In reply to
Sorry for posting twice well i found this code and installed it but its giving me a 500 error i tried changing the path and everything and i read the forum i found it on till the end i just think its for an older ver of links or something


CODE:

#!/usr/local/bin/perl
# Script for putting Top Ten Sites in other LINKS associated pages.
# Change the permission of this script to 755.
# Change the path to the links.cfg file if you need to.
# Use it in the following manner:
# in SSI capable
# pages.
###########################################################
# 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";
$build_use_templates ?
require "$db_lib_path/site_html_templates.pl" :
require "$db_lib_path/site_html.pl";
};
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.";
exit;
}
#========================================================
open (NAME,"<$db_file_name") or &cgierr("error in numlinks. unable to open database:$db_links_name.\nReason: $!");
LINE: while(<NAME> ){
next LINE if (/^#/);
next LINE if (/^\s*$/);
@data=split (/\|/);
$tophits{$data[0]} = $data[9];
$name{$data[0]} = $data[1];
$url{$data[0]} = $data[2];
}
close (NAME);
my $count=1;
foreach $field (sort { $tophits{$b} <=> $tophits{$a} } keys %tophits) {
if ($count <= 10) {
$output .= "$count. <a href=\"$url{$field}\">$name{$field}</a>\n";
}
$count++;
}
return $output;

Quote Reply
Re: Top 5 Most visited (Called with SSI) In reply to
There is a latter post in that Thread that indicates that you need to change the following codes:

Code:

return $output;


to the following codes:

Code:

print $output;


print will print the output in the web page where you use the SSI call. If it is a sub call not using SSI, then you can use return.

Regards,

Eliot Lee