Gossamer Forum
Home : Products : Links 2.0 : Customization :

Corrected FINAL mod to stop "cool" "new & "rating" for good

Quote Reply
Corrected FINAL mod to stop "cool" "new & "rating" for good
Sly Some folks in here had me really confused with posts regarding the stop of the named 3 folders from being run down with every build and from being built as folders in the main dir!!!!

Bad info is worse then no info i'd say to those.

Delete the rate.pl file one suggested, delete rating and vote fields in links.def was suggested too, remove sub build_update_ratings in nph-build.cgi another, in site_html_template should also have been something.....

Balony it was, it just confused me.

So please note, in my previousely postet mod i also had the removal of some lines in links.def - because of all the balony postet in this forum, as mentioned above - they are of absolutely no consequences!

So, no need to edit anything anywhere ecxept for nph-build.cgi !

Now, i have worked out the mod in nph-build on my tester server backup of the Links2 script, a server that could no longer run the entire "build all" in one piece so i had to use "staggered auto". With this build option everything worked as i described, no problems, but when i installed the mod in my official nph-build file on the better server and ran the "build all" option it would still run down all the records of "What's New" "What's Popular" and so on, only the 3 folders where not built anymore in the main dir.

Not perfect, simply because there where 2 more sections to UNCOMMENT in the sub build_all

Here now the finalised COMPLETE -and in fact totally simple - mod:
color for the 2 sections in build_staggered to UNCOMMENT

color for the 2 sections in build_all to UNCOMMENT
sub build_staggered {
# --------------------------------------------------------
# Builds the directory in steps.
#
my %in = &parse_form;

$nph++;
&html_print_headers() if ($use_html);
my %steps = ( 1 => 'Updating New and Popular Records and rebuilding URL database',
2 => 'Rebuilding Category Pages',
3 => 'Building Detailed View Pages',
4 => 'Updating Home/New/Cool Pages'
);
my $step = $in{'step'} || 1;
my $limit = $in{'limit'} || 10;
my $offset = $in{'offset'} || 0;
my $auto = $in{'auto'} || 0;
my $start = time();
my $date = &get_date;
my $time = &get_time;

my $header = qq~
<html>
<head>
<title>Rebuilding Directory -- Phase $phase</title>
~;

my $sub_head = qq~
</head>

<body bgcolor=#FFFFFF>
<H2><TT>Building Pages</TT></H2>
<P><em>Step: $steps{$step}</em>
<PRE>
Pages built on $date at $time
--------------------------------------------------------

~;
CASE: {

($step == 1) and do {
print $header;
print qq~<meta http-equiv="Refresh" content="2; URL=nph-build.cgi?staggered=1&step=2&auto=$auto">~ if ($auto);
print $sub_head;

my $t1 = time();
print "Backing up database . . .\n";
&build_backup;
print "Done (", time - $t1, " s)\n\n";

$t1 = time();
print "Building URL Index . . .\n";
&build_url_index;
print "Done (", time - $t1, " s)\n\n";

# print "Updating New and Popular Records . . .\n";
# $t1 = time();
# &build_update_newpop;
# print "Done (", time - $t1, " s)\n\n";


# print "Updating ratings .. \n";
# $t1 = time();
# &build_update_ratings;
# print "Done (", time - $t1, " s)\n\n";


my $elapsed = time() - $start;
print "------------------------------------------------\n";
print "Step 1 took $elapsed seconds.\n\n";
print qq~</PRE><P><B><font face="Verdana" size=2><a href="nph-build.cgi?staggered=1&step=2&auto=$auto">On to Step 2</A></B></FONT></P>~;
last CASE;
};

($step == 2) and do {
my @category_list = &category_list; my $i;
print $header;
if ($auto) {
($offset > $#category_list) ?
(print qq~<meta http-equiv="Refresh" content="0; URL=nph-build.cgi?staggered=1&step=3&auto=$auto">~) :
(print qq~<meta http-equiv="Refresh" content="2; URL=nph-build.cgi?staggered=1&step=2&limit=$limit&offset=~, $offset + $limit, qq~&auto=$auto">~);
}
print $sub_head;

print "Rebuilding Categories $offset -> ", $offset + $limit - 1, ".\n\n";
for ($i = $offset; $i <= $offset + $limit -1; $i++) {
last unless ($category_list[$i] =~ /\w+/);
%category = ();
%subcategories = ();
@links = ();
@new_links = ();
@cool_links = ();
%stats = ();
$grand_total = 0;
my $t1 = time();

print "** Building Category: $category_list[$i] ... \n";
&build_single_category ($category_list[$i]);
print "** Done (", time - $t1, " s)!\n\n";
}
$offset = $offset + $limit;

my $elapsed = time() - $start;
print "------------------------------------------------\n";
print "This phase of step 2 took $elapsed seconds.\n\n";
($offset > $#categories) ?
print qq~</PRE><P><B><font face="Verdana" size=2><a href="nph-build.cgi?staggered=1&step=3">Go on to Step 3!</A></B></FONT></P>~ :
print qq~</PRE><P><B><font face="Verdana" size=2><a href="nph-build.cgi?staggered=1&step=2&limit=$limit&offset=$offset&auto=$auto">Next $limit Categories!</A></B></FONT></P>~;
last CASE;
};

($step == 3) and do {
print $header;
print qq~<meta http-equiv="Refresh" content="2; URL=nph-build.cgi?staggered=1&step=4&auto=$auto">~ if ($auto);
print $sub_head;

if ($build_detailed) {
my $t1 = time();
print "Generating detailed view pages . . . \n";
&build_detailed_view;
print "** Done (", time - $t1, " s)!\n";
}
else {
print "Detailed Building is not turned on -- Skipping!\n\n";
}
my $elapsed = time() - $start;

print "------------------------------------------------\n";
print "Step 3 took $elapsed seconds.\n\n";
print qq~</PRE><P><B><font face="Verdana" size=2><a href="nph-build.cgi?staggered=1&step=4&auto=1">Go on to Step 4!</A></B></FONT></P>~;
last CASE;
};

($step == 4) and do {
print $header, $sub_head;

my $t1 = time();
print "** Loading Category information . . .\n";
&build_category_information;
print "** Done (", time - $t1, " s)!\n\n";

$t1 = time();
print "** Loading Summary information . . .\n";
&build_stats (1);
print "** Done (", time - $t1, " s)!\n\n";

$t1 = time();
print "** Creating Home Page . . .\n";
&build_home_page;
print "** Done (", time - $t1, " s)!\n\n";

# $t1 = time();
# print "** Creating What's New Pages . . .\n";
# &build_new_page;
# print "** Done (", time - $t1, " s)!\n\n";


# $t1 = time();
# print "** Creating What's Cool Page. . .\n";
# &build_cool_page;
# print "** Done (", time - $t1, " s)!\n\n";


# $t1 = time();
# print "** Creating Top Rated Page. . .\n";
# &build_rate_page;
# print "** Done (", time - $t1, " s)!\n\n";

my $elapsed = time() - $start;
print "------------------------------------------------\n";
print qq~Step 4 took $elapsed seconds.\n\n<b><a href="$build_root_url" target="_top">Your site</a> is now up to date!</b>~;
last CASE;
};

&cgierr("Unkown step: $step.");
};
}

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 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 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 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);
}


Really, couldn't be simpler, nothing like the "you have to hack..." and "it's complicated" stuff that was postet here.

Now, maybe one of the good guys really has something new about the backup system (i am trying to change into the newest one saved only kept) that's as easy as this please p-l-e-a-s-e
Subject Author Views Date
Thread Corrected FINAL mod to stop "cool" "new & "rating" for good gossy 4548 Sep 28, 2002, 3:13 AM
Thread Re: [gossy] Corrected FINAL mod to stop "cool" "new & "rating" for good
Andy 4095 Sep 28, 2002, 3:17 AM
Thread Re: [Andy] Corrected FINAL mod to stop "cool" "new & "rating" for good
gossy 4083 Sep 28, 2002, 3:35 AM
Thread Re: [gossy] Corrected FINAL mod to stop "cool" "new & "rating" for good
Andy 4060 Sep 28, 2002, 8:41 AM
Post Re: [Andy] Corrected FINAL mod to stop "cool" "new & "rating" for good
gossy 4047 Sep 28, 2002, 4:57 PM
Post Re: [Andy] Corrected FINAL mod to stop "cool" "new & "rating" for good
gossy 4054 Sep 28, 2002, 5:11 PM
Thread Re: [gossy] Corrected FINAL mod to stop "cool" "new & "rating" for good
Stealth 4058 Sep 28, 2002, 10:10 AM
Thread Re: [Stealth] Corrected FINAL mod to stop "cool" "new & "rating" for good
gossy 4024 Sep 28, 2002, 5:18 PM
Post Re: [gossy] Corrected FINAL mod to stop "cool" "new & "rating" for good
Stealth 4034 Sep 28, 2002, 5:28 PM