Hej Dan, everyone
I was trying to get some functionality on an old site to work, and I
realised I was having a problem with backlinks that's pretty easilly solved.
There is a discrepancy in the way the search function handles links (they
are passed to BOLTpageshortcuts) and the way the indexing function handles
them (they are not).
I got much better, more intuitive, results with some minor changes. I've
included my code below, in case you are interested. I would class this as a
bug fix, but I don't know if you would class the issue as a bug in the
first place.
I tried to use your coding style as much as possible :/
The following is a change to BOLTindex:
---------------------------------------------------
// index links
preg_match_all('/\[\[([^{}:&#|@\/\]]+)(\&|\#|\||\])/', $content,
$links);
// filter and tidy links
$linksArray = array_unique($links[1]);
BOLTsetPageLink($p, $store);
$linksArray = array_map('BOLTpageshortcuts', $linksArray);
BOLTrevertPageLink($store);
$linksArray = array_unique($linksArray); // refilter after
pageshortcuts
// done
$mylinks = implode("<>", $linksArray);
$mylinks = BOLTutf2url(str_replace('~', "$loginPages.", $mylinks));
----------------------------
Where I use the following helper functions to set the "current page":
--------------------------------
function BOLTsetPageLink($page, &$store) {
global $pageLink, $pageArray;
$store = array($pageLink, $pageArray);
$pageLink = $page;
$pageArray = explode('.', $page);
}
function BOLTrevertPageLink($store) {
global $pageLink, $pageArray;
$pageLink = $store[0];
$pageArray = $store[1];
}
--------------------------------
It was nice to play around with some BW again. Good luck with 4.x!
--
You received this message because you are subscribed to the Google Groups
"BoltWire" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/boltwire/-/_blHH11U_KoJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/boltwire?hl=en.