Gossamer Forum
Home : Products : Gossamer Links : Discussions :

cat_id numbers

Quote Reply
cat_id numbers
Hi,
I'd like to use category numbers in category template.
Could someone please help me out?

I am going to use cat_id number to show targeted zone banneres, like zone_<%cat_id%>.cgi.

In Links 2, I did as follows;

In nph-build.cgi, sub build_category_pages.

Added
local ($cat_id);

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

Next added
$cat_id = @{$category{$cat}}[$db_key];

After
$title_linked = &build_linked_title ($cat);
$title = &build_unlinked_title ($cat);
$total = ($#{$links{$cat}} + 1) / ($#db_cols + 1);
$category_name = $cat;
$category_name_escaped = &urlencode ($cat);
$category_clean = &build_clean ($cat);

And in site_html_templates_pl, sub site_html_category

Added
cat_id => $cat_id,

Best regards,
Moto

Quote Reply
Re: cat_id numbers In reply to
I'm not on the right machine, but the category ID should be available in the templates. If not, you can do this as a global variable, most likely. If no one else answers, I'll check exactly when I get to my other machine.

PUGDOGŪ Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Forum:http://LinkSQL.com/forum
Quote Reply
Re: cat_id numbers In reply to
Hmm, you are in the wrong forum, this is for the SQL version. =)

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: cat_id numbers In reply to
Hi pugdog and Alex,

Thanks for the replys.

I must be dummy... but I know i am in SQL version of Links :)

I would like to know how I can use categroy numnbers in category template with LinksSQL V2.0.1.

Any help would be very much appreciated.
Regards,
moto

Quote Reply
Re: cat_id numbers In reply to
Is it too late to change the name to Links SQL NG version 2.0?

PUGDOGŪ Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Forum:http://LinkSQL.com/forum
Quote Reply
Re: cat_id numbers In reply to
Hi,

I will apologize you if I made any mistakes or mislead you.
Sometimes, it takes hours to finish posting in English.

Could you lead me right direction ?

Thanks
moto




Quote Reply
Re: cat_id numbers In reply to
Hi,

Yes I am dummy!!!

I had tested only <%id%> tag in category template and have got >>Unknown Tag: 'id'<< .

It made me post the first thread in this forum.

Then I just checked <%ID%> tag, it printed out category number!

I really feel sorry for taking your time to replay my post.
I should have tested more before asking any help.

Any way thaks and regards,

moto