Gossamer Forum
Home : Products : Links 2.0 : Customization :

category fields | not recognized

Quote Reply
category fields | not recognized
I've added new category fields in addition to the original fields, for demonstration purposes, I'll call them A, B, C, D, E, F

The DB file comes up with the correct data: A|B|C|D|E|F

But when I build the category pages my results return values:
A, B, C, D, E|F

It isn't recognizing the pipe seperation. I've tried adding more fields as a test and the results, no matter how many field I add are: A, B, C, D, E|F|G|H

Is there a field limit I'm missing? Any help would be greatly appreciated.

Here's my 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, '', ''],
onehotitemid => [8, 'alpha', 20, 75, 0, '', ''],
onehotimg => [9, 'alpha', 40, 75, 0, '', ''],
twohotitemid => [10, 'alpha', 20, 75, 0, '', ''],
twohotimg => [11, 'alpha', 40, 75, 0, '', ''],
threehotitemid => [12, 'alpha', 20, 75, 0, '', ''],
threehotimg => [13, 'alpha', 40, 75, 0, '', ''],
fourhotitemid => [14, 'alpha', 20, 75, 0, '', ''],
fourhotimg => [15, 'alpha', 40, 75, 0, '', '']

);





Quote Reply
Re: category fields | not recognized In reply to
There is around 150 field limit for flat files with typical virtual accounts. If you are on a dedicated server, you can exceed this amount without much degradation of data processing/memory and CPU usage.

You are not even close to that limit.

The problem is that you have not UPDATED your existing categories.db after you added the custom fields. You need to apply the same logic of adding fields to links.def and links.db files as discussed in quite a few Threads in this forum.

Regards,

Eliot Lee
Quote Reply
Re: category fields | not recognized In reply to
Yes the category.db file has been updated and all the data I entered in the add category form appears correctly seperated in the category.db file. I stated this in the original thread: "The DB file comes up with the correct data: A|B|C|D|E|F"

Quote Reply
Re: category fields | not recognized In reply to
Well, if you are adding links to multiple categories, the links.db file format should look like the following:

Code:

ID|Title|Category1~~Category2~~Category3|


If tildas are not separating categories, then the categories you've added in the NAME field in the categories.db may not be in the correct format.

One thing to check would be the Check Cat option via admin.cgi to see if there are any problems with your CATEGORIES database.

Regards,

Eliot Lee
Quote Reply
Re: category fields | not recognized In reply to
Results from Check Cat:
Check Categories
There were no problems found!

I'm not adding links to multiple categories. Let me try to explain better:

I have a category called Beauty which contains the standard category field info (ID, Name, Description, Related, Meta Description, Meta Keywords, Header, Footer). In addition to these standard field I've added some of my own (onehotitmeid, onehotimg, twohotitemid, twohotimg, threehotitemid, threehotimg, fourhotitemid, fourhotimg).

Now all my changes and new fields work correctly, and the catergories.db file contains the correct info, but when I call these variable in a template I get correct info up until threehotitemid. Let say:

onehotitemid = 1
onehotimg = 1
twohotitemid = 2
twohotimg = 2
threehotitemid = 3
threehotimg = 3
fourhotitemid = 4
fourhotimg = 4

my results when I call them via:
<%onehotitemid%>
<%onehotimg%>
<%twohotitemid%>
<%twohotimg%>
<%threehotitemid%>
<%threehotimg%>
<%fourhotitemid%>
<%fourhotimg%>

I get these results:
1
1
2
2
3|3|4|4

Clear as mud, right?



Quote Reply
Re: category fields | not recognized In reply to
There is definately a field limiter for categories somewhere. I removed 2 of the standard fields and 2 of the new fields I added started working. Any solutions or is this unsolvable?

Quote Reply
Re: category fields | not recognized In reply to
The following thread might help. Look down about 4/5 of the way under my user name - DogTags.

http://www.gossamer-threads.com/...mp;part=all&vc=1

I found that I had to add a line to sub site_html_print_cat in site_html_templates.pl and then the extra fields worked.

Hope this helps Smile

DT


Quote Reply
Re: category fields | not recognized In reply to
aaaaaahhhhhhhhhhrrrrrrrgggg, son of a bi#%!, I hate this stupid fu#@!ng program!!! The damn thing don't work! Impossible to add more than 12 categories fields! After that it just runs the remaining fields together. I must have added a mod before that is f-ing this up for me, but I compared the original code to the new and I can't find any major differences except for the span pages mod. This SUCKS! My only comforting thoughts now hoping my server will get a virus and put me out of my misery!

Quote Reply
Re: category fields | not recognized In reply to
OK, I've got this problem narrowed down to where SOMEBODY should be able to find what I'm doing wrong.

Starting with a fresh install of the links2.0, no mods or changes of any kind. Here are the changes I've made to add 9 new category fields:

_________________
1. Added 9 field definitions to category.def:

# Definition of your database file.
%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, '', ''],
onehotid => [8, 'alpha', 20, 75, 0, '', ''],
onehotimg => [9, 'alpha', 40, 75, 0, '', ''],
onehotdesc => [10, 'alpha', 40, 75, 0, '', ''],
twohotid => [11, 'alpha', 20, 75, 0, '', ''],
twohotimg => [12, 'alpha', 40, 75, 0, '', ''],
twohotdesc => [13, 'alpha', 40, 75, 0, '', ''],
threehotid => [14, 'alpha', 20, 75, 0, '', ''],
threehotimg => [15, 'alpha', 40, 75, 0, '', ''],
threehotdesc => [16, 'alpha', 40, 75, 0, '', '']
);



_________________
2. Added 9 fields definitions to sub site_html_category:

sub site_html_category {
# --------------------------------------------------------
# This rountine will build a page based for the current category.

return &load_template ( 'category.html', {
date => $date,
time => $time,
category => $category,
links => $links,
title_linked => $title_linked,
title => $title,
total => $total,
grand_total => $grand_total,
category_name => $category_name,
category_name_escaped => $category_name_escaped,
category_clean => $category_clean,
description => $description,
meta_name => $meta_name,
meta_keywords => $meta_keywords,
header => $header,
footer => $footer,
prev => $prev,
next => $next,
related => $related,
build_links_per_page => $build_links_per_page,
onehotid => $onehotid,
onehotimg => $onehotimg,
onehotdesc => $onehotdesc,
twohotid => $twohotid,
twohotimg => $twohotimg,
twohotdesc => $twohotdesc,
threehotid => $threehotid,
threehotimg => $threehotimg,
threehotdesc => $threehotdesc,
%globals
} );
}


_________________
3. Added 9 field definitions to local variables in sub build_category_pages:

local ($description, $related, $meta_name, $meta_keywords, $header, $footer, $next, $prev, $onehotid, $onehotimg, $onehotdesc, $twohotid, $twohotimg, $twohotdesc, $threehotid, $threehotimg, $threehotdesc);


_________________
4. Added 9 field definitions and changed range of category array setup in sub build_category_pages

# We set up all the variables people can use in &site_html.pl.
($description, $related, $meta_name, $meta_keywords, $header, $footer, $onehotid, $onehotimg, $onehotdesc, $twohotid, $twohotimg, $twohotdesc, $threehotid, $threehotimg, $threehotdesc) = @{$category{$cat}}[2..16];

_________________
5. In admin I setup a category, a link for that category, and did a rebuild. I defined the new variables as follows:
onehotid=1
onehotimg=1
onehotdesc=1
twohotid=2
twohotimg=2
twohotdesc=2
threehotid=3
threehotimg=3
threehotdesc=3


_________________
6. Here's my results when calling these 9 new field definitions:

1
1
1
2
2
2|3|3|3

_________________
7. What gives?




Quote Reply
Re: category fields | not recognized In reply to
GOT IT!!!!!!!!!!!! Oh my god what a pain in the ass!!!!


If you want to add more that 7 fields to category.db follow the instructions listed on the website below and then make this VERY IMPORTANT MODIFICATION or you will drive yourself crazy(going on 18 hours straight myself): in nph_build find sub build_category_information:

change:
@values = &split_decode($_);

to:
@values = split(/\|/,$_);

http://www.webmasters-resources.com/links/category_title_mod.html