diff -urp -N similarterms5/README.txt similarterms/README.txt --- similarterms5/README.txt 2007-06-06 17:53:52.000000000 -0400 +++ similarterms/README.txt 2008-05-07 14:38:20.000000000 -0400 @@ -1,4 +1,4 @@ -$Id: README.txt,v 1.1.2.2 2007/06/06 21:53:52 jjeff Exp $ +$Id: README.txt,v 1.1.2.1 2007/06/06 21:43:25 jjeff Exp $ Similar By Terms (similarterms.module) by Jeff Robbins @@ -22,4 +22,4 @@ Now when you go to the page for a tagged up displaying other content in descending order of common tags (terms). We're using this on Lullabot.com, click on any of the articles at -http://www.lullabot.com/articles in order to see the "Similar" block. \ No newline at end of file +http://www.lullabot.com/articles in order to see the "Similar" block. diff -urp -N similarterms5/similarterms.info similarterms/similarterms.info --- similarterms5/similarterms.info 2007-09-07 20:06:46.000000000 -0400 +++ similarterms/similarterms.info 2008-05-07 18:50:40.000000000 -0400 @@ -1,9 +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 +version = "6.x-1.x-dev" ; Information added by drupal.org packaging script on 2007-09-08 -version = "5.x-1.x-dev" project = "similarterms" datestamp = "1189210006" diff -urp -N similarterms5/similarterms.module similarterms/similarterms.module --- similarterms5/similarterms.module 2007-09-07 17:40:10.000000000 -0400 +++ similarterms/similarterms.module 2008-05-07 18:52:59.000000000 -0400 @@ -9,6 +9,31 @@ */ /** +* 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(). */ function similarterms_block($op = 'list', $delta = 0, $edit = array()) { @@ -40,11 +65,11 @@ function similarterms_block($op = 'list' else if ($op == 'view') { if ($delta == 0) { $block['subject'] = t('Similar'); - $block['content'] = theme_similarterms(similarterms_list()); + $block['content'] = theme('similarterms', similarterms_list()); } else { $block['subject'] = t('Similar'); - $block['content'] = theme_similarterms(similarterms_list($delta)); + $block['content'] = theme('similarterms', similarterms_list($delta)); } return $block; } @@ -69,10 +94,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($nid, $vid))); + $terms = implode(',', array_keys(taxonomy_node_get_terms_by_vocabulary(node_load($nid), $vid))); } else { - $terms = implode(',', array_keys(taxonomy_node_get_terms($nid))); + $terms = implode(',', array_keys(taxonomy_node_get_terms(node_load($nid)))); } if (!empty($terms)) { //past events @@ -99,18 +124,13 @@ 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 theme_similarterms($nodes) { - if (!empty($nodes)) { - $output .= "