Index: similarterms.module =================================================================== --- similarterms.module (Revision 3168) +++ similarterms.module (Arbeitskopie) @@ -132,13 +132,14 @@ function similarterms_list($vocid = 0, $ $nid = arg(1); } if ($nid != NULL) { + $node_obj = node_load($nid); if ($vocid == 0) { // $terms = implode(',', array_keys(taxonomy_node_get_terms(node_load($nid)))); - $terms = array_keys(taxonomy_node_get_terms(node_load($nid))); + $terms = array_keys(taxonomy_node_get_terms($node_obj)); } else { // $terms = implode(',', array_keys(taxonomy_node_get_terms_by_vocabulary(node_load($nid), $vocid))); - $terms = array_keys(taxonomy_node_get_terms_by_vocabulary(node_load($nid), $vocid)); + $terms = array_keys(taxonomy_node_get_terms_by_vocabulary($node_obj, $vocid)); } // Filter out some terms $terms_filter = variable_get('simterms_ignoreterms_'. $vocid, array()); @@ -156,7 +157,6 @@ function similarterms_list($vocid = 0, $ $types = variable_get('simterms_sametype_'. $vocid, false); if (($types !== false) && is_array($types) && count($types) > 0 && ($types['0'] == NULL) ) { if ($types[1]) { - $node_obj = node_load($nid); $types[1] = $node_obj->type; } $str_types = "'". implode("','", $types) ."'"; // couldnt find a solutin for IN %s problem and \' substi @@ -169,10 +169,11 @@ function similarterms_list($vocid = 0, $ 'AND n.nid != %d '. 'AND n.status = 1 '. 'AND n.moderate = 0 '. + "AND (n.language = '' OR n.language = '%s') ". 'GROUP BY n.nid, n.title, n.created '. 'ORDER BY ncount DESC, n.created DESC '. 'LIMIT %d', - $terms, $nid, $count); + $terms, $nid, $node_obj->language, $count); } else { $sql = sprintf( @@ -183,10 +184,11 @@ function similarterms_list($vocid = 0, $ 'AND n.nid != %d '. 'AND n.status = 1 '. 'AND n.moderate = 0 '. + "AND (n.language = '' OR n.language = '%s') ". 'GROUP BY n.nid, n.title, n.created '. 'ORDER BY ncount DESC, n.created DESC '. 'LIMIT %d', - $terms, $nid, $count); + $terms, $nid, $node_obj->language, $count); } $sql = db_rewrite_sql($sql); $result = db_query($sql);