Yes, I suppose this is a bug. I'm wondering if it would be more efficient to simply add an optional basepage parameter to the pageshortcuts function, and use that within the pageshortcuts function when needed? Seems it might be handy to have this functionality within the pageshortcuts function down the road. Could you test this out for me:
function BOLTpageshortcuts($link, $basepage='') {
## VARIOUS SHORTCUTS THAT CAN BE USED IN MISC WAYS TO MODIFY LINKS (OR PAGES IN COMMANDS). USE LEADING .'S LIKE ..PAGE TO PRODUCE
P1.P2.PAGE. USE + TIMESTAMP, ^ ID, ~ LOGIN, @ GROUP, ! ACTION, .. -> . (FOR OOPS), SPACE -> _ , & ENDING # IS THREAD
if (function_exists(myBOLTpageshortcuts)) return myBOLTpageshortcuts($link);
global $pageLink, $pageArray, $BOLTvar, $BOLTid, $BOLTtime;
if ($basepage != '') {
$myPage = $basepage;
$myArray = explode('.', $basepage);
}
else {
$myPage = $pageLink;
$myArray = $pageArray;
}
$BOLTloginPages = BOLTconfig('BOLTloginPages', 'login');
$BOLTgroupPages = BOLTconfig('BOLTgroupPages', 'group');
if ($link == '') return $myPage;
$link = str_replace('&', '&', $link);
if (strpos($link, "/")) $link = str_replace("/", ".", $link);
$get = '';
if (strpos($link, '&') !== false) {
$get = substr($link, strpos($link, "&"));
$link = substr($link, 0, strpos($link, "&"));
}
if (substr($link, -1) == '#') {
$thread = true;
$link = substr($link, 0, -1);
}
if (strpos($link, '#') !== false) {
$anchor = '#' . BOLTutf2url(substr($link, strpos($link, "#") + 1));
$link = substr($link, 0, strpos($link, "#"));
}
$link = str_replace(' ', '_', $link);
if (BOLTconfig('BOLTutfpages', 'true') == 'true') $link = BOLTutf2url($link);
else $link = BOLTutf8_strip($link);
if (substr($link, 0, 1) == '=') $link = $myPage . '.' . substr($link, 1);
$link = strtolower(trim($link));
if (substr($link, 0, 1) == '.') {
$tempArray = $myArray;
$dots = strlen($link) - strlen(ltrim($link, '.'));
for ($i=0; $i<$dots; $i++) {
if (isset($tempArray[$i])) $temp .= $tempArray[$i] . '.';
}
$link = $temp . substr($link, $dots);
}
$rr1 = array('+','@','!','..',' ','^','~');
$rr2 = array($BOLTtime,"$BOLTgroupPages.",'action','.','_',$BOLTid,"$BOLTloginPages.");
$link = trim(str_replace($rr1, $rr2, $link), '.');
if ($thread) $link = $link . '.' . BOLTthread("$link.0");
return $link . $anchor . $get;
}
A couple problems I see would be the + and # shortcuts but probably no way around that...
Also looks like there was a glitch in the $rr1 and $rr2 arrays. Supposed to be ~~ goes to viewers login page--but it conflicts with some things so I just deleted that. And I added dots to the action, login and group shortcuts (!,~,@) so now you can just do [[!edit]], [[~id]], [[@admin]] rather than [[!.edit]] [[~.id]] [[@.admin]]. This would be a change from existing systems but seems a better way to go...
P.S. Let me know if this works. I've just put into the core and this code on page test.index seems to works: