| 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 |
| 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), |
| 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); |
| 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); |
| 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 |
} |
} |