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
Quote Reply
Re: [gossy] Corrected FINAL mod to stop "cool" "new & "rating" for good In reply to
Gossy, as you found, programming takes time and patience...you can't expect an answer straight away...its a game of trial and error, which in your case, finally worked! BTW: I tested my mod, and it worked fine Wink

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Corrected FINAL mod to stop "cool" "new & "rating" for good In reply to
In Reply To:
Gossy, as you found, programming takes time and patience...you can't expect an answer straight away...its a game of trial and error, which in your case, finally worked! BTW: I tested my mod, and it worked fine Wink


Yeah, trial and error it is in any case and therefore a lot of work too.

How about the next bigger step with that backup, any new ideas in sight from anywhere/anyone???
Quote Reply
Re: [gossy] Corrected FINAL mod to stop "cool" "new & "rating" for good In reply to
What exactly are you trying to do? Just overwrite keep one backup file? That should just be a case of hacking nph-build.cgi...very easy Wink

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [gossy] Corrected FINAL mod to stop "cool" "new & "rating" for good In reply to
useroo,

I have posted the thread that contains the codes that DO WORK and what you need. I'd recommend you tone down your attitude since it is offensive.

Do you really expect people to help you when you yell and bitch in your posts??? Huh?
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Andy] Corrected FINAL mod to stop "cool" "new & "rating" for good In reply to
In Reply To:
What exactly are you trying to do? Just overwrite keep one backup file? That should just be a case of hacking nph-build.cgi...very easy Wink

Last edited by:

gossy: Sep 28, 2002, 5:06 PM
Quote Reply
Re: [Andy] Corrected FINAL mod to stop "cool" "new & "rating" for good In reply to
Let's try this one last time more, it returned only the quote but without my text using IE twice!!!

What i really really want is that there is NEVER more then 1 set of
.category
.email
.links
backup in the cgi-bin folder "backup" and of course it should always be the latest and the latest only.

This is my christmas wish from Links2, hehe (a lot earlier would be better though)
Quote Reply
Re: [Stealth] Corrected FINAL mod to stop "cool" "new & "rating" for good In reply to
yes Stealth, let's go for a compromise then - if you like.

I don't bitch, you try it a bit more forwarding???

Here is how;
You say you postet a mod that solves the buildup of backup?
I am almost certain i read it - but equaly certain it was the one too high for me to put into working.
Would you mind to kindly drop me the hyperlink to your working post again, just to save me a bit of my short time so i could give it some more study?
(i also have asked Alex and the support team for some solutions i can work out as it seems important to me to get it done).
Quote Reply
Re: [gossy] Corrected FINAL mod to stop "cool" "new & "rating" for good In reply to
I really shouldn't have to re-post the link since I already posted it once in your previous thread:

http://www.gossamer-threads.com/...;;page=unread#unread

Look in that thread and go to the link I posted.

This is the last and final time I will respond to your posts.

Best of luck.
========================================
Buh Bye!

Cheers,
Me