PDA

View Full Version : article and category


meeky
10-24-2007, 09:24 PM
Hello,

I have a little problem with the phpLD Article version 1.o.o.
I would indicate the category on all article sides gladly.

If I use now {$CATEGORY_ID|escape|trim} in the article.tpl, then only the category ID is indicated unfortunately, but not the name of the category. :confused:

Does someone know remedy?

BG meeky

James
10-24-2007, 10:42 PM
Ok this is pretty much off the top of my head( untested)

in article.php around line 213 find:

$data['IPADRESS'] = $rdata['IPADRESS'];

AFTER it add:
$cdata = $db->GetRow("SELECT `TITLE` AS `CATEGORY_TITLE`, `CACHE_TITLE`, `CACHE_URL` FROM `{$tables['category']['name']}` WHERE `ID` = '{$rdata['CATEGORY_ID']}' LIMIT 1");
$data['CATEGORY_TITLE'] = $cdata['CATEGORY_TITLE'];
$data['CACHE_TITLE'] = $cdata['CACHE_TITLE'];
$site_url = (substr (SITE_URL, -1) != '/' ? SITE_URL.'/' : SITE_URL);
$data['CATEGORY_URL'] = $site_url;
$data['CATEGORY_URL'] .= (ENABLE_REWRITE == 1 ? trim ($cdata['CACHE_URL']) : 'index.php?c='.$data['CATEGORY_ID']);


then in the tpl you can use {$CATEGORY_TITLE} & {$CATEGORY_URL}

meeky
10-25-2007, 01:30 AM
thanks dawzz, now functions.:)