按分类术语与当前节点相关的节点
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了按分类术语与当前节点相关的节点相关的知识,希望对你有一定的参考价值。
Here is a simpler list format without the Term name, sorted by date, filtered for published and images, and is rendered correctly by the theme.
<?php $nid = (int)arg(1); $terms = taxonomy_node_get_terms($nid); $output = "<ul>"; foreach($terms as $term){ $sql = "SELECT DISTINCT n.title, n.nid FROM {node} n INNER JOIN {term_node} tn ON n.nid = tn.nid WHERE n.status = 1 AND tn.tid = $term->tid AND n.nid != $nid AND n.type <> 'image' ORDER BY n.created DESC LIMIT 6"; $result = db_query(db_rewrite_sql($sql)); if (db_num_rows($result)) { while ($anode = db_fetch_object($result)) { $output = node_title_list($result); } } } return $output; } ?>
以上是关于按分类术语与当前节点相关的节点的主要内容,如果未能解决你的问题,请参考以下文章