Gossamer Forum
Home : Products : Links 2.0 : Customization :

Links 2.0 as a CMS

Quote Reply
Links 2.0 as a CMS
I am trying to use Links2.0 as a Content Management System or build a website of 100īs of pages in an easier manner. For that reason there is no need of several fields and have changed links.def to:

Database Definition: LINKS
# --------------------------------------------------------
# Definition of your database file.
%db_def = (
ID => [0, 'numer', 5, 20, 1, '', ''],
Title => [1, 'alpha', 40, 75, 1, '', ''],
Date => [2, 'date', 15, 15, 1, \&get_date, ''],
Category => [3, 'alpha', 0, 150, 1, '', ''],
Description => [4, 'alpha', '80x3', 50000, 0, '', ''],
'Contact Name' => [5, 'alpha', 40, 75, 1, '', ''],
);

and

# where the first field equals 0.
$db_category = 3; $db_modified = 2; $db_number = 0;
$db_title = 1;

So far Links2.0 has met my needs but when I build pages, it automatically eliminates ID number and inserts a "yes" instead. Any idea on what needs to be changed to avoid this will be of great help.
Quote Reply
Re: [vic] Links 2.0 as a CMS In reply to
This line is not required:

$db_number = 0;



If after removing that, you still have problems, there is a post in here somewhere about a tiny change to make that fixed a similar problen for me...

Don't remember where it was. I looked through my files and my code to see if I could find it (I was sure I put a comment in the code...), but no luck. Let me know if you fix the problem, if not I will look a bit harder for the fix. Took me four hours of searching/reading posts to find it.Unsure


Leonard
aka PerlFlunkie
Quote Reply
Re: [vic] Links 2.0 as a CMS In reply to
This is happening because there is still code in the program that references the $db_isnew variable, which is set to 0 (instead of 9) because you haven't defined it (as you're not using it).

This means that the first field (0) is being set instead of field 9 (which you don't have anyway now).

The same thing may happen with $db_ispop and others.

You will need to go through nph-build.cgi at the very least, and comment out sections of the code to fix this.

The $db_number variable was also likely causing problems, as mentioned by PerlFlunkie.
Quote Reply
Re: [vic] Links 2.0 as a CMS In reply to
I would use Links SQL to do this....Unsure

Cheers

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [wysardry] Links 2.0 as a CMS In reply to
Thanks PerlFlunkie for your time. Unfortunatelly eliminating $db_number=0 was not enough.
And thanks wysardry, commenting following lines in nph-build.cgi did the trick an fixed it.Wink


# 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";

Quote Reply
Re: [vic] Links 2.0 as a CMS In reply to
Glad ya got it workin'!!Smile



Just so ya know, that code or real similar is in there twice; once for build-all, and once for build-staggered.


Leonard
aka PerlFlunkie