Gossamer Forum
Home : Products : Links 2.0 : Customization :

Build problem

Quote Reply
Build problem
I have just changed isp. I have changed the setup file. But now links is only building the top of the html. Is writes head, title correct, but after that, all code is removed.

Anybody have a clue???

Thanks,
Are
Quote Reply
Re: Build problem In reply to
How do you have your links.def set-up?

Is the web server the same type (UNIX, Linux, NT) as you had before or is it different?

What are the errors you receive when trying to use the build function?

Be more specific, please.

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: Build problem In reply to
Hi

I had Unix, have now Linux.

The program is building, and I recieve no errors.

But when i go to my pages, for example http://www.a4.no/Kultur/ , you see a blank page. In the source of it, you can see that is writes all down to (including) this <meta name="description" content="Kultursider">

Then there is no more at all...

My links.def looks like this:
# -------------
# Links
# -------------
# Links Manager
#
# File: links.def
# Description: Contains the database definition for links.
# Author: Alex Krohn
# Email: alex@gossamer-threads.com
# Web: http://www.gossamer-threads.com/
# Version: 2.0
#
# (c) 1998 Gossamer Threads Inc.
#
# This script is not freeware! Please read the README for full details
# on registration and terms of use.
# =====================================================================

# Database Definition: LINKS
# --------------------------------------------------------
# Definition of your database file.
%db_def = (
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', -1, 75, 0, '', ''],
'Contact Email' => [7, 'alpha', -1, 75, 0, '', '.+@.+\..+'],
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']
);

# Database file to use -- defined in links.cfg.
$db_file_name = $db_links_name;
# Counter file to use -- defined in links.cfg.
$db_id_file_name = $db_links_id_file_name;
# The column name for the database key.
$db_key = 'ID';
# Database delimeter.
$db_delim = '|';
# Title used in admin output.
$html_title = 'Links Database';
$html_object = 'Link';

# Field Number of some important fields. The number is from %db_def above
# where the first field equals 0.
$db_category = 4; $db_modified = 3; $db_url = 2;
$db_hits = 8; $db_isnew = 9; $db_ispop = 10;
$db_contact_name = 6; $db_contact_email = 7; $db_title = 1;
$db_votes = 12; $db_rating = 11; $db_mail = 13;

# Field number to sort links by:
$db_sort_links = 1;

# Field names you want to allow visitors to search on:
@search_fields = (1,2,5);

# System defaults. When adding new links or modifying links, these fields
# can not be overwritten by a user.
%add_system_fields = (
isNew => 'No',
isPopular => 'No',
Hits => '0',
Rating => 0,
Votes => 0,
ReceiveMail => 'Yes'
);

# Hash of column names to possible options. If you want to use a select form
# field, you can use &build_select_field in your HTML page. This routine will
# make a <SELECT> input tag using the following values:
%db_select_fields = (
isNew => 'Yes,No',
isPopular => 'Yes,No',
ReceiveMail => 'Yes,No'
);

# Hash of column names to radio values. If you use &build_radio_field, it will
# make a <INPUT TYPE="RADIO"> tag for you using the options specified in the hash.
%db_radio_fields = ( );

# Maximum number of hits returned in a search. Can be overridden in the search
# options.
$db_max_hits = 10;

# Use the built in key tracker.
$db_key_track = 1;

# ===========================================================================
# Build up some variables from your definitions. Internal use only.
@db_cols = ();
foreach (sort { $db_def{$a}[0] <=> $db_def{$b}[0] } keys %db_def) {
push (@db_cols, $_);
$db_sort{$_} = $db_def{$_}[1];
$db_form_len{$_} = $db_def{$_}[2];
$db_lengths{$_} = $db_def{$_}[3];
$db_not_null{$_} = $db_def{$_}[4];
$db_defaults{$_} = $db_def{$_}[5];
$db_valid_types{$_} = $db_def{$_}[6];
($_ eq $db_key) and $db_key_pos = $db_def{$_}[0];
}

1;

----------------------------------------END--

Thanks,

Are

Quote Reply
Re: Build problem In reply to
Me again...

Now i tryed to build pages withOUT templates. It worked very well, all pages built, and visible on the web. But when i push a link that goes of my web pages to another website (the one with link-id number), this screen pops up, instead of the website:

#!/usr/bin/perl
# -------------
# Links
# -------------
# Links Manager
#
# File: jump.cgi
# Description: Increments the number of hits for the specified link,
# and sends the user off to the appropriate page.
# Author: Alex Krohn
# Email: alex@gossamer-threads.com
# Web: http://www.gossamer-threads.com/
# Version: 2.0
#
# (c) 1998 Gossamer Threads Inc.
#
# This script is not freeware! Please read the README for full details
# on registration and terms of use.
# =====================================================================
#
# Form Input:
# '$db_key' = key number # Send as form input the key name and key value
# # of the link you want to go to.
#
# Setup:
# Make sure the require statement below points to the config file.

# Required Librariers
# --------------------------------------------------------
eval {
($0 =~ m,(.*)/[^/]+,) && unshift (@INC, "$1"); # Get the script location: UNIX /
($0 =~ m,(.*)\\[^\\]+,) && unshift (@INC, "$1"); # Get the script location: Windows \

require "admin/links.cfg"; # Change this to full path to links.cfg if you have problems.
require "$db_lib_path/db_utils.pl";
require "$db_lib_path/links.def";
};
if ($@) {
print "Content-type: text/plain\n\n";
print "Error including libraries: $@\n";
print "Make sure they exist, permissions are set properly, and paths are set correctly.";
}

# ========================================================

eval { &main; }; # Trap any fatal errors so the program hopefully
if ($@) { &cgierr("fatal error: $@"); } # never produces that nasty 500 server error page.
exit; # There are only two exit calls in the script, here and in in &cgierr.

sub main {
# --------------------------------------------------------
my %in = &parse_form();
my ($goto, $id, $delim, $time);

$id = $in{$db_key};
$delim = quotemeta($db_delim);
$time = time();

if ($id eq "random") {
my ($count, $rand, $find);

# Pull out the total number of links.
open (COUNT, "<$db_hits_path/index.count") or &error ("unable to open index count file: $db_hits_path/index.count. Reason: $!");
$count = int <COUNT>;
close COUNT;

# Get the random line from the url lookup database.
srand;
$find = 0; $rand = int (rand ($count + 0.5)); ($rand == $count) and ($rand--);
open (URL, "<$db_url_name") or &error ("unable to open url database: $db_url_name. Reason: $!");
while (<URL> ) {
$find++ == $rand or next;
/\d+$delim(.+)/o or next;
$goto = $1;
last;
}
close URL;
$goto or &error ("Can't find random line: $rand.");
}
elsif (exists $in{$db_key}) {
# Make sure this is a valid looking id.
($id =~ /^\d+$/) or &error ("Invalid id: $id");

# Let's get the URL.
open (URL, "<$db_url_name") or &error ("unable to open url database: $db_url_name. Reason: $!");
while (<URL> ) {
(/^$id$delim(.+)/o) or next;
chomp ($goto = $1);
last;
}
close URL;
$goto or &error ("Can't find link id: $id");

# Bump the counter one.
if (open (HIT, "<$db_hits_path/$id")) {
my ($count, $old_time, @IP, $ip, $visited);
chomp ($count = <HIT> );
chomp ($old_time = <HIT> );
chomp (@IP = <HIT> );
(($time - $old_time) > 21600) and (@IP = ());
foreach $ip (@IP) {
$ip eq $ENV{'REMOTE_ADDR'} and ($visited++ and last);
}
if (!$visited) {
push (@IP, $ENV{'REMOTE_ADDR'});
$count = $count + 1;
open (HIT, ">$db_hits_path/$id") or &error ("Can't open for output counter file. Reason: $!");
if ($db_use_flock) { flock (HIT, 2) or &error ("Can't get file lock. Reason: $!"); }
local $" = "\n";
print HIT "$count\n$time\n@IP";
close HIT;
}
}
else {
open (HIT, ">$db_hits_path/$id") or &error ("Can't increment counter file. Reason: $!");
print HIT "1\n$time\n$ENV{'REMOTE_ADDR'}";
close HIT;
}
}
else {
&error ("No link specified!");
}

# Now let's send the user to the url..
$goto ?
print "Location: $goto\n\n" :
&error ("Record not found ($in{$db_key})");
}

sub error {
# ------------------------------------------
#
print "Content-type: text/plain\n\n";
print "Error: $_[0]\n";
exit;
}



But when I changed links to use templates again (wich i want it to!), I now get this error as soon as i push Build ALL:

CGI ERROR
==========================================
Error Message : unable to open url index: . Reason: No such file or directory
Script Location : /home/f1000052/domains/a4.no/cgi-bin/links/admin/nph-build.cgi
Perl Version : 5.00502

Form Variables
-------------------------------------------

Environment Variables
-------------------------------------------
AUTH_TYPE : Basic
COOKIES :
DOCUMENT_NAME : nph-build.cgi
DOCUMENT_ROOT : /home/f1000052/domains/a4.no/
DOCUMENT_URI : /cgi-bin/links/admin/nph-build.cgi
GATEWAY_INTERFACE : CGI/1.1
HTTP_ACCEPT : image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/msword, application/vnd.ms-powerpoint, */*
HTTP_ACCEPT_ENCODING: gzip, deflate
HTTP_ACCEPT_LANGUAGE: no
HTTP_CONNECTION : Keep-Alive
HTTP_HOST : www.a4.no
HTTP_REFERER : http://www.a4.no/cgi-bin/links/admin/admin.cgi?display=navigation
HTTP_USER_AGENT : Mozilla/4.0 (compatible; MSIE 5.0; Windows 95; DigExt)
LAST_MODIFIED : Mon, 06 Sep 1999 18:40:43 GMT
REMOTE_PORT : 1624
REQUEST_METHOD : GET
SCRIPT_FILENAME : NONE/links/admin/nph-build.cgi
SCRIPT_NAME : /cgi-bin/links/admin/nph-build.cgi
SERVER_NAME : www.a4.no
SERVER_PORT : 80
SERVER_PROTOCOL : HTTP/1.0
SERVER_SOFTWARE : Roxen Challenger/1.3.111
Quote Reply
Re: Build problem In reply to
 
Quote:
CGI ERROR
==========================================
Error Message : unable to open url index: . Reason: No such file or directory
Script Location : /home/f1000052/domains/a4.no/cgi-bin/links/admin/nph-build.cgi
Perl Version : 5.00502

First of all, this problem should be posted in the Links Installation - UNIX Forum as it has nothing to do with a Links mod per se. It is an installation problem.

Be that as it may, the problem you are probably having is that your data directory is not chmod 777 so Links cannot create the url.db file. Also make sure that all files in the data directory are chmod 666.

I hope this helps.
Quote Reply
Re: Build problem In reply to
Hi

I have now solved that problem. Some files because of earlier modification must have been corupted. I gave temporary permission 777 to all files, so I think that wasnīt a problem.

I got another problem, but in a way I have solved it. The problem was now that only part of the page was built. When I removed the keyword/description-tag in template, the whole page were built (no keyword/descrtiption)



I donīt think its a very serious matter if a post gets to modification, that should have gone to installation. After all, there have been modifications that have resulted in the problem, and that it needen modifications to run again, but OK.

Its very good support here. No complaining. But itīs a bit strict... :-)


Thanks.


[This message has been edited by areh (edited September 25, 1999).]