ok Here is what I have.... I am wanting to add a description that I can place in my templates that I can edit in admin..
I first edited.. my categories.def from
Code:
# Definition of your database file.
%db_def = (
ID => [0, 'numer', 5, 10, 1, '', ''],
Name => [1, 'alpha', 40, 75, 1, '', '^[\w\d/_-]+$'],
Description => [2, 'alpha', '40x3', 900, 0, '', ''],
Related => [3, 'alpha', 0, 8900, 0, '', ''],
'Meta Description' => [4, 'alpha', 40, 700, 0, '', ''],
'Meta Keywords' => [5, 'alpha', 40, 700, 0, '', ''],
Header => [6, 'alpha', 40, 75, 0, '', ''],
Footer => [7, 'alpha', 40, 75, 0, '', '']
);
to
Code:
# Definition of your database file.
%db_def = (
ID => [0, 'numer', 5, 10, 1, '', ''],
Name => [1, 'alpha', 40, 75, 1, '', '^[\w\d/_-]+$'],
Description => [2, 'alpha', '40x3', 900, 0, '', ''],
Related => [3, 'alpha', 0, 8900, 0, '', ''],
'Meta Description' => [4, 'alpha', 40, 700, 0, '', ''],
'Meta Keywords' => [5, 'alpha', 40, 700, 0, '', ''],
Header => [6, 'alpha', 40, 75, 0, '', ''],
Footer => [7, 'alpha', 40, 75, 0, '', '']
CatDescription => [8, 'alpha', '40x3', 900, 0, '', ''],
);
Next I copied the modify script from http://www.gossamer-threads.com/scripts/forum/resources/Forum3/HTML/001090.html
but I was not sure what to save it as do I saved it as david.cgi -- Not sure if that was correct...? I also changed the values to point to categories instead of links..
links.def => category.def
links.db => categories.db
links2.db => categories2.db
and I was not sure which directory to place it in so I placed it in my admin folder.. the same folder that has db_utils.pl and
category.def in it...
I chomd the data directory to 777
I chomd david.cgi to 775
Here is david.cgi modified from your forum..
Code:
#!/usr/local/bin/perl
# -------------------------------------------
#You must EDIT YOUR category.def script BEFORE entering these variable and running this script!
$field_default = ""; #Put the default value of the new field here. Leave Blank for no default.
$new_field = "8"; #Put the new field number here.
$total_fields = "9"; #Put the last field number here.
#Change these value to match your settings
require "db_utils.pl";
require "category.def";
#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, "<categories.db") or print "Unable to open links database 'categories.db'. Reason: $!" and exit;
print "\tOpening output file . . .\n";
open (DBOUT, ">categories2.db") or print "Unable to open output database. Make sure data dir is chmod 777 temporarily. Reason: $!" and exit;
print "\n\n\tProcessing records\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 ID, Title, URL, Date and Category
for $i (0 .. $nfm1) {
$rec_out[$i] = $rec_in[$i];
}
# Add New Field
$rec_out[$new_field] = "$field_default";
# Copy the rest of old categories.db to new categories2.db
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 "Database saved it as categories2.db.\n";
print "Change permissions back to 755 on the data directory.\n\n";
print "You must rename 'categories2.db' to 'categories.db before using with Links v2.\n";
print "It is recommend you save the original 'categories.db' before renaming.\n\n";
I got an error 500 ... I am sure I am missing very little but don't really know what yet.. can you help did I miss something?
[This message has been edited by thefreebiesite (edited May 03, 2000).]