[pmwiki-users] Genealogy MarkUp problem

Lars Eighner surname at larseighner.com
Thu Jul 19 14:06:43 CDT 2012


Can anyone see what is wrong with this recipe?

Markup('hasher','fulltext','/\\(:hasher (.*):\\)/e',"inkky('$1')");

function inkky($namestring){
$namestring = trim($namestring);
$namestring = str_replace("\n",'',$namestring);
$namestring = str_replace(' ','',$namestring);
if( $namestring === ''){
return '';}
$out = '[[Living/' . hash('md5',$namestring,false) . '|Living]]';
return $out;
}

The function inkky works just fine.  The problem is that Markup seems to
pass only the first word of the argument.

So:

(:hasher Richard Roe:) gives exactly the same result as (:hasher Richard
Smith:)

with and without the /s modifier does not help.



it looks to me exactly like:

Markup('birthdax','fulltext','/\\(:birthdax (.*?):\\)/e',"birthday('$1')");

which captures the whole string after the space and before the :



function birthday($namestring){
$dareturn = dater($namestring);
if(! is_array($dareturn) ){
return $dareturn;
}

$myday = sprintf('%02d',$dareturn['day']);
blah, blah, blah ...

-- 
Lars Eighner
http://www.larseighner.com/index.html
8800 N IH35 APT 1191 AUSTIN TX 78753-5266




More information about the pmwiki-users mailing list