本文整理汇总了PHP中common_node::getRelatedTaxonomy方法的典型用法代码示例。如果您正苦于以下问题:PHP common_node::getRelatedTaxonomy方法的具体用法?PHP common_node::getRelatedTaxonomy怎么用?PHP common_node::getRelatedTaxonomy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common_node
的用法示例。
在下文中一共展示了common_node::getRelatedTaxonomy方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mainAction
/**
* main action
*/
public function mainAction()
{
//input data
if (is_numeric($this->GET['id'])) {
$node_id = $this->GET['id'];
} else {
return false;
}
//initialise
require_once 'models/common/common_node.php';
$Node = new common_node();
//get node detail
$node_data = $Node->nodeDetail($node_id);
//parent page is blog article container
$blog_node_id = $node_data['parent'];
$this->tpl->assign('BLOG_NODE_ID', $blog_node_id);
//show comments only when enabled
if ($node_data['component']['allow_comment'] == 1) {
$_Onxshop_Request = new Onxshop_Request("component/comment~node_id={$node_id}:allow_anonymouse_submit=1~");
$this->tpl->assign("COMMENT", $_Onxshop_Request->getContent());
$this->tpl->parse("content.comment");
}
/**
* empty author helper class
*/
if (trim($node_data['component']['author']) == '') {
$this->tpl->assign('AUTHOR_EMPTY', 'author_empty');
} else {
$this->tpl->assign('AUTHOR_EMPTY', '');
}
/**
* getRelatedTaxonomy
*/
$related_taxonomy = $Node->getRelatedTaxonomy($node_id);
$this->tpl->assign('TAXONOMY', $related_taxonomy);
//standard page actions
$this->processContainers();
$this->processPage();
return true;
}
示例2: getNodeRelatedTaxonomy
/**
* get taxonomy related to node
*/
public function getNodeRelatedTaxonomy($node_data)
{
if (!is_array($node_data)) {
return false;
}
require_once 'models/common/common_node.php';
$Node = new common_node();
$related_taxonomy = $Node->getRelatedTaxonomy($node_data['id']);
return $related_taxonomy;
}
示例3: mainAction
/**
* main action
*/
public function mainAction()
{
/**
* initialize
*/
require_once 'models/common/common_node.php';
require_once 'models/common/common_image.php';
$Node = new common_node();
$Image = new common_image();
/**
* find node id
*/
if (is_numeric($this->GET['id'])) {
$id = $this->GET['id'];
} else {
$id = $Node->conf['id_map-blog'];
}
/**
* set header
*/
header('Content-Type: text/xml; charset=UTF-8');
// flash in IE with SSL dont like Cache-Control: no-cache and Pragma: no-coche
header("Cache-Control: ");
header("Pragma: ");
/**
* Initialize pagination variables
*/
if (is_numeric($this->GET['limit_from'])) {
$from = $this->GET['limit_from'];
} else {
$from = 0;
}
if (is_numeric($this->GET['limit_per_page'])) {
$per_page = $this->GET['limit_per_page'];
} else {
$per_page = 25;
}
$limit = "{$from},{$per_page}";
/**
* latest date
*/
$rss_date = date('r', time());
$this->tpl->assign("RSS_DATE", $rss_date);
/**
* check
*/
if (!is_numeric($id)) {
msg('export rss: id is not numeric', 'error');
return false;
}
/**
* process
*/
$node_data = $Node->getDetail($id);
$channel_taxonomy_labels = array();
if ($node_data['publish'] == 1) {
$this->tpl->assign('NODE', $node_data);
$taxonomy_filter = '';
if (is_numeric($this->GET['taxonomy_tree_id']) && $this->GET['taxonomy_tree_id'] > 0) {
$taxonomy_filter = " AND id IN (SELECT node_id FROM common_node_taxonomy WHERE taxonomy_tree_id = {$this->GET['taxonomy_tree_id']})";
}
$children = $Node->listing("parent = {$id} AND publish = 1 AND node_group='page' {$taxonomy_filter}", "created DESC", $limit);
foreach ($children as $c) {
/**
* create public link
*/
$link = $Node->getSeoURL($c['id']);
$c['url'] = "http://{$_SERVER['HTTP_HOST']}{$link}";
/**
* format date
*/
$c['rss_date'] = date('r', strtotime($c['created']));
/**
* get categories
*/
$taxonomy_list = $Node->getRelatedTaxonomy($c['id']);
foreach ($taxonomy_list as $taxonomy) {
$this->tpl->assign('CATEGORY', $taxonomy);
$this->tpl->parse('content.item.category');
$channel_taxonomy_labels[$taxonomy['label']['title']] = true;
}
/**
* add image (not part of RSS spec)
*/
$c['image'] = $this->processImage($Image->getTeaserImageForNodeId($c['id']));
/**
* assign
*/
$this->tpl->assign('CHILD', $c);
if ($c['image']) {
$this->tpl->parse("content.item.image");
}
$this->tpl->parse("content.item");
}
}
// parse channel category list
$i = 0;
//.........这里部分代码省略.........