Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

New version: what features?

Quote Reply
New version: what features?
Hi,

I've been in dicussing CPU usage with my ISP with regard to doing a rebuild with around 12000+ categories, and wondered if the forthcoming upgrade will allow for building selected listings/categories in stages?

Obviously this would solve any potential problems by doing the build-up in shorter bursts, but I'd like to know before I start adding all the new categories.

All the best
Shaun

Quote Reply
Re: New version: what features? In reply to
I had and have similar problems. Alex completely turned down in his email answer saysing that he does not think it was necessary to change the code for that, or something similar.

The (different) ISPs yelled at the script the way it used the resources. Programmers saw the scripts for a possible change and unimously agreed that it was indeed ridiculous to design in that way in the first place, however the excellent design it may have been, and secondly too time consuming for it to change the code.

Regardless of if people have shared servers or not, I find it any day ridiculous to design a code that even for a new link one has to build all those thousands of links!!!

Having so many categories the scripts will never ever function on a shared server.

I am not even able to use the script of Links SQL after the purchase and A LOT OF HEADACHES afterwards.

Quote Reply
Re: New version: what features? In reply to
Hi,
I also had that problem with 2000 categories.
I modified nph-build.cgi to accept a parameter.

Cange:

use vars qw($USE_HTML $LINKDB $CATDB $EMAIL $HIERARCH $GRAND_TOTAL);

to:

use vars qw($USE_HTML $LINKDB $CATDB $EMAIL $HIERARCH $GRAND_TOTAL $DIRTY);

Insert after:
# Determine what type of build we are doing and do it.

my $in = new CGI;
$DIRTY = $in-> param('dt');
if ($DIRTY eq 'D'){ $DIRTY = 1} else {$DIRTY=0}

In the sub build category pages:

find the foreach statement :

foreach $category_r (@{$categories_r}) {

change it to:

inner: foreach $category_r (@{$categories_r}) {

some lines further find :

if ($subcat_info->rows()) {
$tmp = $subcat_info->fetchall_arrayref();
foreach my $cat (@{$tmp}) { $subcategory_r->{${$cat}[1]} = $CATDB->array_to_hash($cat) }
}

add :

# skip the procedure if cat doesnt have new links
if ($DIRTY == 1){
if ($category_r->{'Has_New_Links'} eq 'No') {next inner;}
}

Thats it. If the parameter dt=D is passed nph-build only builds the pages and the upward tree if the cat has new links. Add in Admin_html.pm in the sub html_navigation:

after :

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


insert:

<a href="nph-build.cgi?dt=D">Build New only</a>


I hope it will help. It cutted down my building time from 1h to 2 minutes

regards, alexander

Quote Reply
Re: New version: what features? In reply to
Alex,

I'll give that a try later - sounds like the perfect solution Smile

All the best
Shaun

Quote Reply
Re: New version: what features? In reply to
Caveat....

this will only look "right" if you are *NOT* listing the <%num_links%> or whatever that tag is, next to each category.

If you don't re-build the upper categories, you won't update those numbers.

<%GRAND_TOTAL%> should be updated properly, but any page not rebuilt won't be.

If you report the #of_links on each page, such as in a header, the header on the pages that is not rebuilt won't match the headers on the other pages....

But, not everyone links the number of links, and it's a small price to pay if it cuts your build time enough.

The next version of links *may* have a build-new or build-changed in it, since that's been so loudly requested.


http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/

Quote Reply
Re: New version: what features? In reply to
As i remember Alex has named this feature as one of the most important things for the upgrade.
PUGDOG - Do you know more about?

I am very confident with my 1.11.
All i need are the alternate cats for users without user-registry and the building of only the new pages.

And i really hope i have not spent six weeks on waiting for the new version without getting this.
I havenīt tested the code from Alex, but if it does what it should, there must be a way to count the number of links in a second sub instead inside the while or if-then -statement. And only counting shouldnīt be a big thing for the cpu?!

Robert