Gossamer Forum
Home : Products : Links 2.0 : Discussions :

Help - How can I reinstall Links 2.0?

Quote Reply
Help - How can I reinstall Links 2.0?
Hi,

I could not find help with my problem (nph-build does not build all cathegories, it stops by them beginning with "L"), so I think, the only way for me is, to reinstall it all.

But how can I do it without loosing data? Which files should I store on my hard disc and upload after all again? I don't like to loose the whole configuration...

PS. Elliot - do you remember the bug I'm talking about?
Quote Reply
Re: Help - How can I reinstall Links 2.0? In reply to
  
Quote:
PS. Elliot - do you remember the bug I'm talking about?

Nope....And if you see the number of Replies I've submitted since November 1998 (add 7,000 to my current stat with AnthroRules), you can see that it is virtually impossible for me to remember all cases.

Wink

Anyway, if you want to re-install LINKS, all you have to do is change the paths in the .cfg file.

Other than that...the script should work fine.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums


[This message has been edited by AnthroRules (edited March 06, 2000).]
Quote Reply
Re: Help - How can I reinstall Links 2.0? In reply to
And what about data & categories? Do you mean, if I download and upload the backup files and change the .cfg file, it will work and look as before?

But, I really wonder: how is it posslible that the script rebuilds only a half of categories and there is no error message? Look, one of the last added links were in the "New" first, but after it get no more "new", it disappered! It is there - I can find it with "search", but it isn't listed in its category (I've checked the categories - no error was found) :-(
Quote Reply
Re: Help - How can I reinstall Links 2.0? In reply to
If you restore from backup and change the paths in the links.cfg file, then you should be fine.

The reasons behind your directory being only half built and the build process stopping could be one of the following:

1) You have tons of categories, which is increasing your build time, and thus, your browser is timing out due to you overexceeding the allocated CPU rates given to you by your hosting company.

2) You have not completely installed Mods, like Non-English Mod, which is disrupting your build process.

3) There are problems with Categories that you have created and the build process hangs.

And I am trying to help you...getting frustrated with me is not a very smart thing to do.

Wink

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: Help - How can I reinstall Links 2.0? In reply to
Hi again,

I really don't have ton's of categories -maybe 16 or 18.

But, you've asked me about those "Mods" as I've asked you for help the first time (about a month ago). Maybe it is a stupid question, but what do you mean with "mod"? Well, my Links work in a no-English country, maybe I really do need a "mod", but what is it? I've installed Links in October, 1999 "as is", without any adds...

PS. I really believe, you will help me! So this time I'm making :-)
Quote Reply
Re: Help - How can I reinstall Links 2.0? In reply to
If you have Non-English characters in your database, then you need to install the NON-ENGLISH MODIFICATION, which is located in the Resource Center! Click on the Resource Center link at the top of the forum page, then click on LINKS, then click on Modifications...There you have it...MODS!

There are some MODS located in the forums, but there are official MODS located in the Resource Center.

DO you understand NOW????

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: Help - How can I reinstall Links 2.0? In reply to
NOW I understand, Eliot... Take it easy...

I found it in the mean time (Maybe I am stupid, but not as much as I seem to be Wink, I've downloaded it and I will try to replace the old files with the new from the great MOD. And then we'll see. I hope, I will not need to waste your time after this modification... :-)

Quote Reply
Re: Help - How can I reinstall Links 2.0? In reply to
Good...Glad you understand now.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: Help - How can I reinstall Links 2.0? In reply to
But I've got some bad news...

I've uploaded the non-english MOD and it did not help.

I've counted the categories: 18. There are no categories with non-english letters (those are only in descriptions).

I've checked the categories one more time: "no problems found".

Do you have any new idea?
Quote Reply
Re: Help - How can I reinstall Links 2.0? In reply to
Let us see your directory (provide a link to your directory) A N D SAVE the following files as t e x t files:

nph-build.cgi
site_html_templates.pl
links.def
category.def

Upload these TEXT files in a publicly accessible directory in your WEB SERVER, and then post the URL to these text files. I am in the dark without seeing what you have done with the files!

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: Help - How can I reinstall Links 2.0? In reply to
Eliot,

First of all - thanks for your patience!

All the files are waiting for you under:

http://insider.ceti.com.pl/eliot

There are two versions of nph-build.cgi: the one with "before" in its name was working until yesterday, as I have uploaded the non-english mod. The second one comes from this mod, of course.

If you want to see the directory, come to:

http://insider.ceti.com.pl/links/pages

I am ready to let you into the administration panel - no problem, but of course I cannot give you the password in this forum. If you mail me, I would show you the admin panel - how it (no) works...

See you...

Quote Reply
Re: Help - How can I reinstall Links 2.0? In reply to
One problem I see off the bat is that you are building pages in your /cgi-welt/ directory. Pages should be built OUTSIDE of the cgi-bin directory. Your pages need to be built at:

http://insider.ceti.com.pl/links/pages/

NOT

http://insider.ceti.com.pl/cgi-welt/links/pages/index.html

And it looks like all your categories are being built...I see a Z category and categories after L.

One suggestion...Make sure that you use the same valid expressions as you have in your category.def for Name field for the Category field in the links.def file, like the following:

Code:
Category => [4, 'alpha', 0, 150, 1, '', '^[\w\d/_-]+$'],

In your sub build_category_pages, delete the following codes:

Code:
local ($description, $related, $meta_name, $meta_keywords, $header, $footer, $next, $prev);

Other than that, I don't see any other red flags.

Regards,



------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: Help - How can I reinstall Links 2.0? In reply to
I will delete what you've told me to delete. With the valid expressions or what they may be called - I am stupid again... (I understand nothing from Perl and/or my English is not good enough)

Well, the cgi-welt directory: this server lets the user put their cgi-scripts anywhere, but not into cgi-bin (it understands it as its own, main, root etc.) OK, I can try with outside of cgi-bin.

But: in the mean time, I've builded a second version of links - links2. All was working, till I've uploaded the three files from backup: links.db, categories.db and email.db.

Maybe there is something wrong with them? Could they harm the whole "Links"?

What else? Oh, of course you could see "V" and "Z", but they was made before the bug "was there". Till this time, it was all working great...

Quote Reply
Re: Help - How can I reinstall Links 2.0? In reply to
Hi again,

I don't know if it will be sightable over here, but there is no "Category" in my "links.def". Take a look:



ID => [0, 'numer', 5, 8, 1, '', ''],
Title => [1, 'alpha', 40, 75, 1, '', ''],
URL => [2, 'alpha', 40, 75, 1, 'http://', '^http|news|mailto|ftp'],
Date => [3, 'date', 15, 15, 1, \&get_date, ''],
Category => [4, 'alpha', 0, 150, 1, '', ''],
Description => [5, 'alpha', '40x3', 500, 0, '', ''],
'Contact Name' => [6, 'alpha', 40, 75, 1, '', ''],
'Contact Email' => [7, 'alpha', 40, 75, 1, '', '.+@.+\..+'],
Hits => [8, 'numer', 10, 10, 1, '0', '\d+'],
isNew => [9, 'alpha', 0, 5, 0, 'No', ''],
isPopular => [10, 'alpha', 0, 5, 0, 'No', ''],
Rating => [11, 'numer', 10, 10, 1, 0, '^[\d\.]+$'],
Votes => [12, 'numer', 10, 10, 1, 0, '^\d+$'],
ReceiveMail => [13, 'alpha', 10, 10, 1, 'Yes', 'No|Yes']
);

I've made all you said - including build pages outside of cgi-welt: no changes, the last builded category begins with "M" and the script says "ready"... =:-o
Quote Reply
Re: Help - How can I reinstall Links 2.0? In reply to
S...t happened - I've posted the wrong file, but now you can compare both of them - here is the second one, "category.def":

# %db_def = (
# ID => [0, 'numer', 5, 8, 1, '', ''],
# Name => [1, 'alpha', 40, 75, 1, '', '^[\w\d/_-]+$'],
# Description => [2, 'alpha', '40x3', 500, 0, '', ''],
# Related => [3, 'alpha', 0, 255, 0, '', ''],
# 'Meta Description' => [4, 'alpha', 40, 75, 0, '', ''],
# 'Meta Keywords' => [5, 'alpha', 40, 75, 0, '', ''],
# Header => [6, 'alpha', 40, 75, 0, '', ''],
# Footer => [7, 'alpha', 40, 75, 0, '', '']
# );
%db_def = (
ID => [0, 'numer', 5, 8, 1, '', ''],
Name => [1, 'alpha', 40, 75, 1, '', '^[\w\d/_-]+$'],
Description => [2, 'alpha', '40x3', 500, 0, '', ''],
Related => [3, 'alpha', 0, 255, 0, '', ''],
'Meta Description' => [4, 'alpha', 40, 75, 0, '', ''],
'Meta Keywords' => [5, 'alpha', 40, 75, 0, '', ''],
Header => [6, 'alpha', 40, 75, 0, '', ''],
Footer => [7, 'alpha', 40, 75, 0, '', ''],
Nonenglish => [8, 'alpha', 40, 75, 0, '', '']
);
# ***************************************** nonenglish modification - end ******************
Quote Reply
Re: Help - How can I reinstall Links 2.0? In reply to
OK, now I am quite sure what is wrong: categories are corrupt.

After adding the non-english-MOD, there is another field in every category (admin panel) called "Nonenglish". I look at some related categories now, and what do I in this field?

Record 1: Nonenglish: 15 [what does it mean "15"?]

Record 2: Footer: 39
Nonenglish: [Name of a related category]

Record 3: Header: 50
Footer: [Name of a related category]
Nonenglish: Description (!!!)

How is it possible?

Quote Reply
Re: Help - How can I reinstall Links 2.0? In reply to
When you added the Non-English field in your category.def file, did you add a delimiter to the end of your existing categories.db file???

Anytime you add a new field to any of your .def files, you need to add a delimiter at the end of your records for this new field!

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: Help - How can I reinstall Links 2.0? In reply to
I am really sorry, but there is no "readme" in the package of the non-english-mode, so I've just uploaded the files! How should I know, I should add anything... :-(

I've checked in the main "Readme" - nothing about "delimiters"...

***Could you please show me, how does it look like?***

And: was the non-english-mod tested under ISO-8859-2 yet? The author of this addon is German - maybe this addon does work with ISO-8859-1 only? I would like to be sure, this is a good thing...
Quote Reply
Re: Help - How can I reinstall Links 2.0? In reply to
It simply adds the following delimiter to the end of your categories.db file, like the following example:

Original Categories Database:

Code:
1|Name|Related|Description|Meta Description|Meta Keywords|Header|Footer

New Database file with Non-English Field

Code:
1|Name|Related|Description|Meta Description|Meta Keywords|Header|Footer|Non English

See the difference...there is a delimiter after the Footer field in the second example.

This, I believe is your problem. To add the delimiter to your database, use the script located in the FAQ for adding links to links.db....Same script, but you will have to configure the script to run with the categories.db file.

Do you understand?

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: Help - How can I reinstall Links 2.0? In reply to
Now you will scream...

I am doing my best, but I cannot found this script "located in the FAQ for adding links to links.db"

And I don't understand what is that nonenglish for or what should be written in the nonenglish field if all is configured correctly...
Quote Reply
Re: Help - How can I reinstall Links 2.0? In reply to
I've found some scripts... My God, is this difficult!
Quote Reply
Re: Help - How can I reinstall Links 2.0? In reply to
The Non-English Field is where you put the non-english name of the category you are adding...Read the README file of the Mod more carefully!

In terms of adding the delimiter to your categories.db, do the following:

1) Upload an old copy of your categories.db file that you were using prior to installing the Non-English Mod.

2) Then use the following script to add the delimiter to your categories.db file.

Code:
#!/usr/local/bin/perl
#Upgrade Database

#Put the default value of the new field here. Leave Blank for no default.
$field_default = "";

#Put the new field number here.
$new_field = "8";

#Put the last field number here.
$total_fields = "9";

# Database path...same as in db.cgi file

$db_script_path = '/path/to/cgi-bin/links/admin';

#Change these value to match your settings
#You may have to use the absolute path to your .cfg and .cgi file

require "/path/to/category.def";

#Rename database file
#You may have to use the absolute path to your second database file

$db_file_name2 = "/path/to/categories2.db";

#############################################
#You shouldn't have to edit below this line
#------------------------------------------

$nfm1 = $new_field - 1;
$ENV{'REQUEST_METHOD'} and (print "Content-type: text/plain\n\n");
open (DB, "<$db_script_path/$db_file_name") or print "Unable to open links database '$db_script_path/$db_file_name'. Reason: $!" and exit;
print "\tOpening output file . . .\n\n";
open (DBOUT, ">$db_script_path/$db_file_name2") or print "Unable to open $db_script_path/$db_file_name2. Make sure data dir is chmod 777 temporarily. Reason: $!" and exit;
print "\n\n\tProcessing records...\n\n";
while (<DB> ) {
(/^#/) and next LINE; # Skip comment Lines.
(/^\s*$/) and next LINE; # Skip blank lines.
chomp; # Remove trailing new line.
@rec_in = &split_decode($_);


# Copy fields into second database.

for $i (0 .. $nfm1) {
$rec_out[$i] = $rec_in[$i];
}

# Add New Field

$rec_out[$new_field] = "$field_default";

# Copy the rest of old database file to new database file

for $i ($new_field .. $total_fields) {
$rec_out[$i + 1] = $rec_in[$i];
}
print DBOUT &join_encode(&array_to_hash(0, @rec_out));
}
print "\tDone...\n\n";

close DB;
close DBOUT;

print "\n\n";
print "Database saved it as $db_file_name2.\n";
print "Change permissions back to 755 on the data directory.\n\n";
print "You must rename '$db_file_name' to '$db_file_name2' to '$db_file_name' before using with DBMAN.\n";
print "It is recommend you save the original '$db_file_name' before renaming.\n\n";
print "Make sure that your new database is changed to 666.\n\n";

sub join_encode {
# --------------------------------------------------------
# Takes a hash (ususally from the form input) and builds one
# line to output into the database. It changes all occurrences
# of the database delimeter to '~~' and all newline chars to '``'.

my %hash = @_;
my ($tmp, $col, $output);

foreach $col (@db_cols) {
$tmp = $hash{$col};
$tmp =~ s/^\s+//g; # Trim leading blanks...
$tmp =~ s/\s+$//g; # Trim trailing blanks...
$tmp =~ s/\Q$db_delim\E/~~/og; # Change delimeter to ~~ symbol.
$tmp =~ s/\n/``/g; # Change newline to `` symbol.
$tmp =~ s/\r//g; # Remove Windows linefeed character.
$output .= $tmp . $db_delim; # Build Output.
}
chop $output; # remove extra delimeter.
$output .= "\n"; # add linefeed char.
return $output;
}

sub split_decode {
# --------------------------------------------------------
# Takes one line of the database as input and returns an
# array of all the values. It replaces special mark up that
# join_encode makes such as replacing the '``' symbol with a
# newline and the '~~' symbol with a database delimeter.

my ($input) = shift;
my (@array) = split (/\Q$db_delim\E/o, $input, $#db_cols+1);
foreach (@array) {
s/~~/$db_delim/g; # Retrieve Delimiter..
s/``/\n/g; # Change '' back to newlines..
}
return @array;
}

sub array_to_hash {
# --------------------------------------------------------
# Converts an array to a hash using db_cols as the field names.
#
my ($hit, @array) = @_;
my ($i);
return map { $db_cols[$i] => $array[$hit * ($#db_cols+1) + $i++] } @_;
}

You will have to change /path/to/ to the absolute path in your server where the category.def and where your database files are located to create the categories2.db file.

3) Then replace the categories.db with categories2.db file.

4) Then go ahead and make the changes in your Non-English fields in your category records by modifying them via the LINKS MANAGER.

5) Then re-build your database.

I REALLY HOPE this helps!

Regards,


------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: Help - How can I reinstall Links 2.0? In reply to
Thank you, Eliot...

I've had some troubles, but at the end the script worked. Now I understand: one and the same category should have an English and a non-English name. But what is is good for, if there are no non-english letters/signs in the original category names? Why should I give to "KOMPUTER" additionally "computer" as a main name?

I'm testing it on my second version of Links. After I changed some categories to double-named, I've checked out the links.db: no change.

Of course, I will follow to your vice, but at the moment I really don't believe it will change anything. The script is not rebuilding the corrected, "multilanguage categories".

And, as I said, in the package of the non-english MOD is no Readme! :-)
Quote Reply
Re: Help - How can I reinstall Links 2.0? In reply to
Thanks for the lack of confidence. Wink

Of course, after you make the changes to the categories.db file, you will have to make changes in the links.db file.

At this point, I would suggest contacting one of the LINKS Installers to help you. I do not have any more suggestions to help you and to tell you the truth, I am losing patience.

Sorry... Wink

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: Help - How can I reinstall Links 2.0? In reply to
I had same problems with building, "Staggered build stops at Categories with "L"
- solution : I only use "Staggered (Auto)"
-this builds all categories up to "Z".
(and I have more than 40 of them)

try it, Coe