/** * hook before parsing */ public function parseContentTagsBeforeHook() { parent::parseContentTagsBeforeHook(); /** * pass GET.recipe_id into template */ $Node = new common_node(); $node_data = $Node->nodeDetail($this->GET['id']); $this->GET['recipe_id'] = $node_data['content']; /** * pass GET.taxonomy_ids into template */ $Recipe_Taxonomy = new ecommerce_recipe_taxonomy(); $taxonomy_ids = (array) $Recipe_Taxonomy->getRelationsToRecipe($this->GET['recipe_id']); $this->GET['taxonomy_tree_id'] = implode(",", $taxonomy_ids); /** * rating & reviews */ require_once 'models/ecommerce/ecommerce_recipe_review.php'; $Review = new ecommerce_recipe_review(); $review_data = $Review->getRating($this->GET['recipe_id']); if ($review_data['count'] > 0) { $rating = round($review_data['rating']); $_Onxshop_Request = new Onxshop_Request("component/rating_stars~rating={$rating}~"); $this->tpl->assign('RATING_STARS', $_Onxshop_Request->getContent()); if ($review_data['count'] == 1) { $this->tpl->assign('REVIEWS', 'Review'); } else { $this->tpl->assign('REVIEWS', 'Reviews'); } $this->tpl->assign('REVIEW', $review_data); $this->tpl->parse('content.reviews'); } }
/** * main action */ public function mainAction() { parent::mainAction(); $node_id = (int) $this->GET['id']; // display Dublin district menu when in Dublin county if (is_numeric($node_id) && $node_id > 0) { $Node = new common_node(); $node = $Node->detail($node_id); if ($node_id == 1536 || $node['parent'] == 1536) { $this->tpl->parse("content.dublin_menu"); } } return true; }