[pmwiki-users] interMap question

Radu radu at monicsoft.net
Sun May 22 09:07:28 CDT 2005


Well, in the templates we can use variables like $IMP_Rel, but not 
$IMap['Rel:'].

For example, if I want an image in the template to be pulled from a 
specific location, depending on an imap value, thus field-specific without 
having to have different versions of the template for each field, right now 
I have to create the variable in skin.php. I was suggesting a modification 
to the imap code in pmwiki.php, something like the last line in:

foreach((array)$InterMapFiles as $f) {
   if (@!($mapfd=fopen($f,"r"))) continue;
   while ($mapline=fgets($mapfd,1024)) {
     if (preg_match('/^\\s*(#|$)/',$mapline)) continue;
     list($imap,$url) = preg_split('/\\s+/',$mapline);
     if (strpos($url,'$1')===false) $url.='$1';
     $LinkFunctions["$imap:"] = 'LinkIMap';
     $IMap["$imap:"] = FmtPageName($url, $pagename);
     eval("\$IMP_$imap=$url;");
   }
}

Maybe what I need is feasible in a different way, as I know people here 
don't like eval much.

At 10:12 AM 5/19/2005, Patrick R. Michaud wrote:
>On Thu, May 19, 2005 at 09:41:41AM -0400, Radu wrote:
> > I forgot to mention a question I had some time ago.
> >
> > Is there already an implementation, or would it be easy to add a way to
> > have intermap strings available in php for templating and recipe purposes?
> >
> > Something like $IMP_Rel (or even interMapPath('Rel') that would handle
> > graciously cases in which 'Rel' is not defined in the array)?
>
>I'm afraid I'm totally not understanding the question.  Could you
>give a more specific example of what you're wanting to achieve?
>
>Pm

Cheers,
Radu
(www.monicsoft.net) 




More information about the pmwiki-users mailing list