diff options
Diffstat (limited to 'inc')
-rw-r--r-- | inc/fulltext.php | 6 | ||||
-rw-r--r-- | inc/parser/metadata.php | 6 |
2 files changed, 9 insertions, 3 deletions
diff --git a/inc/fulltext.php b/inc/fulltext.php index 280ba0c89..94cc947e7 100644 --- a/inc/fulltext.php +++ b/inc/fulltext.php @@ -118,6 +118,8 @@ function ft_backlinks($id){ // check instructions for matching links foreach($docs as $match){ +/* + // orig code, examine each page's instruction list $instructions = p_cached_instructions(wikiFN($match),true); if(is_null($instructions)) continue; @@ -134,6 +136,10 @@ function ft_backlinks($id){ } } } +*/ +// now with metadata + $links = p_get_metadata($match,"relation references"); + if (isset($links[$id])) $result[] = $match; } if(!count($result)) return $result; diff --git a/inc/parser/metadata.php b/inc/parser/metadata.php index 076ddc271..fea2d48f2 100644 --- a/inc/parser/metadata.php +++ b/inc/parser/metadata.php @@ -272,10 +272,10 @@ class Doku_Renderer_metadata extends Doku_Renderer { // first resolve and clean up the $id resolve_pageid(getNS($ID), $id, $exists); - list($id, $hash) = split('#', $id, 2); + list($page, $hash) = split('#', $id, 2); // set metadata - $this->meta['relation']['references'][$id] = $exists; + $this->meta['relation']['references'][$page] = $exists; // $data = array('relation' => array('isreferencedby' => array($ID => true))); // p_set_metadata($id, $data); @@ -357,7 +357,7 @@ class Doku_Renderer_metadata extends Doku_Renderer { $nssep = '[:;]'; } $name = preg_replace('!.*'.$nssep.'!','',$name); - //if there is a hash we use the ancor name only + //if there is a hash we use the anchor name only $name = preg_replace('!.*#!','',$name); return $name; } |