Gossamer Forum
Home : Products : Links 2.0 : Customization :

Site of the moment?

Quote Reply
Site of the moment?
Hi...

Just wondering..has anybody implement a MOD that gives "Site of the Moment"? I mean everytime someone visit your LINKs web site, automatically the LINKS choose an URL (from its database) as a site of the moment.

If the MOD exists, anybody knows where to get from? I'm not a PERL programmer.

Thanks.
Almas
Quote Reply
Re: Site of the moment? In reply to
It's even a standard feature:

/goto.cgi?ID=random
Quote Reply
Re: Site of the moment? In reply to
I think he means to randomly post the title of a different site each time as a link on the home page.

------------------
Joker
Concepts 2000 Online
www.concepts2000.com
tech@concepts2000.com

Quote Reply
Re: Site of the moment? In reply to
Thanks Poker..

Yes that's what I meant. Sorry for my English that cause confusion.
English is not my first language.

Since chrishintz has mentioned about the Random Links, I suspect that to implement this mod is not hard (it may base on the algorithm to get the random links).

Or is it hard?

Thanks for your help guys.

Almas
Quote Reply
Re: Site of the moment? In reply to
Hey,

Please post it man!

------------------
Thanks,
ICQ 20415601
killa@i.am
Quote Reply
Re: Site of the moment? In reply to
Ditto Smile
Quote Reply
Re: Site of the moment? In reply to
I've written a little hack for a site of the moment (chooses a random link everytime you build your links). Is anyone interested? This is a VERY simple mod. If you are, let me know and I'll post it here.
Quote Reply
Re: Site of the moment? In reply to
Ok, now this currently doesn't support hit tracking or anything. It's just a very basic mod that's based on the Random link function in the jump.cgi file. (Don't know if it works with templates or not... haven't tried it)

In the nph-build.cgi file add this line to the sub build_home_page function:

Underneath the following code:
Code:
print "\tOpening page: $build_root_path/$build_index\n";

Place:

Code:
my ($rand, $find);

# Get the random line from the url lookup database.
srand;
$find = 0; $rand = int (rand ($grand_total + 0.5)); ($rand == $grand_total) and ($rand--);
open (URL, "<$db_links_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.");

@site_info = split(/\Q$db_delim\E/, $goto);

And underneath the following code:
Code:
open (HOME, ">$build_root_path/$build_index") or &cgierr ("unable to open home page: $build_root_path/$build_index. Reason: $!");
$category = &site_html_print_cat (@rootcat) if ($#rootcat >= 0);
$total = $grand_total;

Place:
Code:
$site = $site_info[1];
$url = $site_info[2];

Ok, now you have the option to use the $site and $url in the site_html.pl file under site_html_home.
Quote Reply
Re: Site of the moment? In reply to
can you modify it so the random link can be chosen only from the top rated sites