summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorchris <chris@jalakai.co.uk>2006-09-01 02:20:16 +0200
committerchris <chris@jalakai.co.uk>2006-09-01 02:20:16 +0200
commit3be6e3945ae175b4785e18f9aa9d18f557592dd7 (patch)
treed60fa7478464afd69b64b3c399cc954347f25e70 /inc
parent0e70946d23660c4814db46cd3f89cb8340e51336 (diff)
downloadrpg-3be6e3945ae175b4785e18f9aa9d18f557592dd7.tar.gz
rpg-3be6e3945ae175b4785e18f9aa9d18f557592dd7.tar.bz2
update backlink search to use metadata
darcs-hash:20060901002016-9b6ab-716518138edf541a869510d7c2934b9474547fc3.gz
Diffstat (limited to 'inc')
-rw-r--r--inc/fulltext.php6
-rw-r--r--inc/parser/metadata.php6
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;
}