Location: PHPKode > projects > Bcom > bcom-1.99.1/bcom/listproducts.php
<?
require_once('lib/libmain.inc');
bcom_init();

require_once('lib/libui.inc');
require_once('lib/liblayout.inc');
require_once('lib/libsite.inc');
require_once('lib/libproducts.inc');
require_once('lib/libpages.inc');
require_once('lib/libgeneral.inc');

//did a groupid get passed?
if(!isset($groupid)) { swarn('no product group was specified'); exit; }

//make sure the group exists and is a product group.
if(group_getval($groupid,'g_type') != 'product') {
    swarn('product group does not exist');
    exit;
}

//find a suitable template or die trying.
if(group_igetval($groupid,'pl_template') != 0) {
    $template = group_igetval($groupid,'pl_template');
}
elseif(getoption('site','pl_template') != 0) {
    $template = getoption('site','pl_template');
}
else {
    swarn('No layout page set for product lists.');
    exit;
}

$replace = array();
$replace['GROUP'] = group_getval($groupid,'g_name');
if(group_igetval($groupid,'g_thumbnail') != 0) {
	$replace['THUMB'] = formatimage(group_igetval($groupid,'g_thumbnail'));
} else {
	$replace['THUMB'] = '';
}


/*again, do we want to calculate this every time?
if(['g_parent'] != 0) {
    $replace['PLIST'] = listproducts($grow['g_parent']);
}
*/
$replace['BODY'] = listproducts($groupid);

print getpage($template,$replace);

	debug_print('<BR>CPU Time: '.
		sprintf('%0.4f',getmicrotime() - $_BCOM['starttime']).' seconds ('.
		sprintf('%0.4f',1/(getmicrotime() - $_BCOM['starttime'])).')'
	);


set_return();
bcom_sendoutput();

?>
Return current item: Bcom