Gossamer Forum
Home : Products : Links 2.0 : Customization :

New mod - Update Ratings & Hits Only

Quote Reply
New mod - Update Ratings & Hits Only
This mod will allow you to update your Ratings & Hits from the control panel without having to do a complete build.

1. Copy nph-build.cgi to the same folder and rename it to nph-build-update.cgi

2. Open nph-build-update.cgi

3. Find: sub build_all {

4. Replace

Code:


sub build_all {

# --------------------------------------------------------

# Rebuild the entire directory.



# Determine if we are printing to command line, or to browser.



$nph++;

&html_print_headers() if ($use_html);





my $start = time();

my $date = &get_date;

my $time = &get_time;





# Print HTML Header

$use_html ?

print qq|<html><head><tittle>Links Manager: Building Pages</title></head>

<BASE TARGET="_top">

<BODY BGCOLOR=#FFFFFF><H2><TT>Building Pages</TT></H2>

<PRE>| :

print qq|Building Pages\n|;

print "Pages built on " . $date . " at " . $time . "\n";

print "--------------------------------------------------------\n\n";



# Backup the database.

print "Backing up database . . .\n";

&build_backup;

print "Done.\n\n";



# Rebuild URL Index (This file is auto-generated, you will never need to touch it!

print "Building URL Index . . .\n";

&build_url_index;

print "Done.\n\n";



# Update New and Popular Records..

print "Updating New and Popular Records . . .\n";

&build_update_newpop;

print "Done.\n\n";



# Update voting information ..

print "Updating ratings .. \n";

&build_update_ratings;

print "Done.\n\n";



# Load Category Information

print "Loading Category Information . . .\n";

&build_category_information;

print "Done.\n\n";





# Generate some stats for future pages...

print "Gathering Category and Link information . . .\n";

&build_stats;

print "Done\n\n";



# Generate detailed view pages.

if ($build_detailed) {

print "Generating detailed view pages . . . \n";

&build_detailed_view;

print "Done\n\n";

}





# Create Home Page

$use_html ?

print qq|Building <A HREF="$build_root_url/$build_index">Home Pages</A> . . .\n| :

print qq|Building Home Page . . .\n|;

&build_home_page;

print "\tDone\n\n";



# Create What's Cool Page

$use_html ?

print "Building <A HREF=\"$build_cool_url/$build_index\">What's Cool</A> Page . . .\n" :

print "Building What's Cool Page . . .\n";

&build_cool_page;

print "Done\n\n";





# Create What's New Page

$use_html ?

print "Building <A HREF=\"$build_new_url/$build_index\">What's New</A> Page . . .\n" :

print "Building What's New Page . . .\n";

&build_new_page;

print "Done\n\n";



# Create Top Rated Page

$use_html ?

print "Building <A HREF=\"$build_ratings_url/$build_index\">Top Rated</A> Page . . .\n" :

print "Building Top Rated . . .\n";

&build_rate_page;

print "Done\n\n";





# Create Category Pages

print "Building Category Pages . . .\n";

&build_category_pages;

print "Done\n\n";





# We are finished!

print "Pages Built (", time() - $start, " s)!";

print "</PRE></BODY></HTML>" if ($use_html);

}




with

Code:


sub build_all {

# --------------------------------------------------------

# Rebuild the entire directory.



# Determine if we are printing to command line, or to browser.



$nph++;

&html_print_headers() if ($use_html);





my $start = time();

my $date = &get_date;

my $time = &get_time;





# Print HTML Header

$use_html ?

print qq|<html><head><tittle>Links Manager: Updating Ratings & Hits</title></head>

<BASE TARGET="_top">

<BODY BGCOLOR=#FFFFFF><H2><TT>Updating Ratings & Hits</TT></H2>

<PRE>| :

print qq|Building Pages\n|;

print "Pages built on " . $date . " at " . $time . "\n";

print "--------------------------------------------------------\n\n";



# Backup the database.

print "Backing up database . . .\n";

&build_backup;

print "Done.\n\n";



# Rebuild URL Index (This file is auto-generated, you will never need to touch it!

print "Building URL Index . . .\n";

&build_url_index;

print "Done.\n\n";



# Update New and Popular Records..

print "Updating New and Popular Records . . .\n";

&build_update_newpop;

print "Done.\n\n";



# Update voting information ..

print "Updating ratings .. \n";

&build_update_ratings;

print "Done.\n\n";



# Load Category Information

print "Loading Category Information . . .\n";

&build_category_information;

print "Done.\n\n";





# Generate some stats for future pages...

print "Gathering Category and Link information . . .\n";

&build_stats;

print "Done\n\n";



# Generate detailed view pages.

if ($build_detailed) {

print "Generating detailed view pages . . . \n";

&build_detailed_view;

print "Done\n\n";

}





# Create Home Page

# $use_html ?

# print qq|Building <A HREF="$build_root_url/$build_index">Home Pages</A> . . .\n| :

# print qq|Building Home Page . . .\n|;

# &build_home_page;

# print "\tDone\n\n";



# Create What's Cool Page

$use_html ?

print "Building <A HREF=\"$build_cool_url/$build_index\">What's Cool</A> Page . . .\n" :

print "Building What's Cool Page . . .\n";

&build_cool_page;

print "Done\n\n";





# Create What's New Page

# $use_html ?

# print "Building <A HREF=\"$build_new_url/$build_index\">What's New</A> Page . . .\n" :

# print "Building What's New Page . . .\n";

# &build_new_page;

# print "Done\n\n";



# Create Top Rated Page

$use_html ?

print "Building <A HREF=\"$build_ratings_url/$build_index\">Top Rated</A> Page . . .\n" :

print "Building Top Rated . . .\n";

&build_rate_page;

print "Done\n\n";





# Create Category Pages

# print "Building Category Pages . . .\n";

# &build_category_pages;

# print "Done\n\n";





# We are finished!

print "Pages Built (", time() - $start, " s)!";

print "</PRE></BODY></HTML>" if ($use_html);

}


5. Open admin_html.cgi

6. Find

Code:


<a href="nph-build.cgi">Build All</a><br>

<a href="nph-build.cgi?staggered=1">Staggered</a><br>

<a href="nph-build.cgi?staggered=1&auto=1">Staggered (Auto)</a><br>

<a href="$db_script_url?db=links&html_edit_template=1">Edit Templates</a><br>


and add

Code:


<a href="nph-build-update.cgi">Update Ratings & Hits</a><br>



7. Upload admin_html.cgi and nph-build-update.cgi

8. CHMOD nph-build-update.cgi to 755

9. Enter the control panel and select Update Ratings & Hits to run. That's it!



( Thanks to Andy & Stealth for their input. Wink )

Subject Author Views Date
ThreadSticky: New mod - Update Ratings & Hits Only MJB 17186 Sep 12, 2003, 1:19 PM
Thread Re: [MJB] New mod - Update Ratings & Hits Only
MJB 16755 Sep 12, 2003, 1:33 PM
Post Re: [MJB] New mod - Update Ratings & Hits Only
Andy 16665 Sep 12, 2003, 1:42 PM
Thread Re: [MJB] New mod - Update Ratings & Hits Only
bs7 16720 Sep 14, 2003, 5:06 PM
Thread Re: [MJB] New mod - Update Ratings & Hits Only
MJB 16658 Sep 15, 2003, 5:12 AM
Post Post deleted by jayman
jayman 14719 Feb 17, 2007, 5:35 AM
Thread Re: [MJB] New mod - Update Ratings & Hits Only
athair 16487 Nov 26, 2003, 6:12 AM
Thread Re: [athair] New mod - Update Ratings & Hits Only
megri 16217 Feb 15, 2004, 10:23 PM
Post Re: [megri] New mod - Update Ratings & Hits Only
LordStryfe 15750 Jul 21, 2004, 7:29 PM
Post Post deleted by jayman
jayman 14742 Feb 17, 2007, 5:34 AM