diff -upN modules\similarterms\similarterms.info sites\all\modules\similarterms\similarterms.info --- modules\similarterms\similarterms.info Thu Apr 17 21:02:45 2008 +++ sites\all\modules\similarterms\similarterms.info Fri Sep 07 20:06:46 2007 @@ -1,10 +1,9 @@ ; $Id: similarterms.info,v 1.1.2.1 2007/06/06 21:43:25 jjeff Exp $ name = Similar By Terms description = "Display a block of other content that is similar by keywords (taxonomy terms)." -core = 6.x ; Information added by drupal.org packaging script on 2007-09-08 -version = "6.x-1.x-dev" +version = "5.x-1.x-dev" project = "similarterms" datestamp = "1189210006" diff -upN modules\similarterms\similarterms.module sites\all\modules\similarterms\similarterms.module --- modules\similarterms\similarterms.module Thu Apr 17 21:02:25 2008 +++ sites\all\modules\similarterms\similarterms.module Fri Sep 07 17:40:10 2007 @@ -7,30 +7,6 @@ * Similar By Terms module displays a block with similar content * based on taxonomy terms. */ - - /** -* Display help and module information -* @param path which path of the site we're displaying help -* @param arg array that holds the current path as would be returned from arg() function -* @return help text for the path -*/ -function similarterms_help($path, $arg) { - $output = ''; - switch ($path) { - case "admin/help#similarterms": - $output = '

'. t("Displays a block with similar content based on taxonomy terms.") .'

'; - break; - } - return $output; -} // function similarterms_help - -/** -* Valid permissions for this module -* @return array An array of valid permissions for the onthisdate module -*/ -function similarterms_perm() { - return array('access similarterms content', 'administer similarterms content'); -} // function similarterms_perm() /** * Implementation of hook_block(). @@ -93,10 +69,10 @@ function similarterms_list($vid = NULL, $nodes = array(); if (!is_null($nid)) { if (!is_null($vid)) { - $terms = implode(',', array_keys(taxonomy_node_get_terms_by_vocabulary(node_load($nid), $vid))); + $terms = implode(',', array_keys(taxonomy_node_get_terms_by_vocabulary($nid, $vid))); } else { - $terms = implode(',', array_keys(taxonomy_node_get_terms(node_load($nid)))); + $terms = implode(',', array_keys(taxonomy_node_get_terms($nid))); } if (!empty($terms)) { //past events @@ -123,13 +99,18 @@ function similarterms_list($vid = NULL, /** * Theme function for similar block + * note that $nodes is a list of node parts from the 'node' data + * these are not complete node_load() objects * + * @param array $nodes */ -function similarterms_theme() { - return array( - 'similarterms' => array( - 'template' => 'similarterms', - 'arguments' => array('items' => NULL), - ), - ); +function theme_similarterms($nodes) { + if (!empty($nodes)) { + $output .= "\n"; + } + return $output; } diff -upN modules\similarterms\similarterms.tpl.php sites\all\modules\similarterms\similarterms.tpl.php --- modules\similarterms\similarterms.tpl.php Thu Apr 17 20:43:49 2008 +++ sites\all\modules\similarterms\similarterms.tpl.php Wed Dec 31 19:00:00 1969 @@ -1,22 +0,0 @@ - - - \ No newline at end of file