/[drupal]/contributions/modules/nodewords/nodewords.module
ViewVC logotype

Diff of /contributions/modules/nodewords/nodewords.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.57.2.251 by kiam, Wed Nov 25 09:51:49 2009 UTC revision 1.57.2.252 by kiam, Thu Nov 26 18:01:22 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: nodewords.module,v 1.57.2.250 2009/11/24 15:58:57 kiam Exp $  // $Id: nodewords.module,v 1.57.2.251 2009/11/25 09:51:49 kiam Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 408  function nodewords_nodeapi(&$node, $op, Line 408  function nodewords_nodeapi(&$node, $op,
408        );        );
409    
410      case 'update index':      case 'update index':
411        $tags = array();        $output_tags = array();
412        $tag_options = array(        $tag_options = array(
413          'type' => NODEWORDS_TYPE_NODE,          'type' => NODEWORDS_TYPE_NODE,
414          'ids' => array($node->nid),          'ids' => array($node->nid),
# Line 433  function nodewords_nodeapi(&$node, $op, Line 433  function nodewords_nodeapi(&$node, $op,
433            }            }
434          }          }
435    
436          $output = nodewords_output_tags($tags, 'update index');          $output = nodewords_output_tags($output_tags, 'update index');
437          $tag_options['output'] = 'update index';          $tag_options['output'] = 'update index';
438    
439          drupal_alter('nodewords_tags_output', $output, $tag_options);          drupal_alter('nodewords_tags_output', $output, $tag_options);
# Line 455  function nodewords_perm() { Line 455  function nodewords_perm() {
455   * Implementation of hook_preprocess_page().   * Implementation of hook_preprocess_page().
456   */   */
457  function nodewords_preprocess_page(&$variables) {  function nodewords_preprocess_page(&$variables) {
458    list($type, $ids) = _nodewords_detect_type_and_ids();    $parameters = array();
459    $tags = nodewords_get_tags($type, $ids);    $result = _nodewords_detect_type_and_ids();
460      $tags = nodewords_get_tags($result[0], $result[1]);
461    
462    $output = nodewords_output_tags($tags);    $output = nodewords_output_tags($tags);
463    $parameters['type'] = $type;    $parameters['type'] = $result[0];
464    $parameters['ids'] = $ids;    $parameters['ids'] = $result[1];
465    $parameters['output'] = 'head';    $parameters['output'] = 'head';
466    
467    drupal_alter('nodewords_tags_output', $output, $parameters);    drupal_alter('nodewords_tags_output', $output, $parameters);
# Line 1211  function _nodewords_detect_type_and_ids( Line 1212  function _nodewords_detect_type_and_ids(
1212    }    }
1213    
1214    foreach (_nodewords_get_pages_data() as $page) {    foreach (_nodewords_get_pages_data() as $page) {
1215        $alias = drupal_get_path_alias($_GET['q']);
1216      $path = $page->path;      $path = $page->path;
1217    
1218      if (drupal_match_path($_GET['q'], $path)) {      if ($alias != $_GET['q'] && drupal_match_path($alias, $path)) {
1219        return array(NODEWORDS_TYPE_PAGE, $path);        return array(NODEWORDS_TYPE_PAGE, $path);
1220      }      }
1221    
1222      $alias = drupal_get_path_alias($_GET['q']);      if (drupal_match_path($_GET['q'], $path)) {
     $bool = (  
       $alias != $_GET['q'] &&  
       drupal_match_path($alias, $path)  
     );  
   
     if ($bool) {  
1223        return array(NODEWORDS_TYPE_PAGE, $path);        return array(NODEWORDS_TYPE_PAGE, $path);
1224      }      }
1225    }    }

Legend:
Removed from v.1.57.2.251  
changed lines
  Added in v.1.57.2.252

  ViewVC Help
Powered by ViewVC 1.1.3