<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Verdana; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Verdana; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Verdana; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Verdana; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="font-size: medium;">hi</span></span></span></span></span></div><div><br></div><div><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Verdana; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Verdana; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Verdana; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Verdana; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="font-size: medium;">so here&nbsp;some&nbsp;of&nbsp;my&nbsp;personal&nbsp;conclusions from everyone's wonderful emails.</span></span></span></span></span></div><div><br></div><div>* InterMap</div><div><br></div><div>i couldn't figure out how to make InterMap work for my situation. if i'm correct, it seems InterMap is looking for something like - AnotherSite:OneOfItsPages - and i'm looking for something that replaces text that has no idea that one day it will be a link. i.e. so that John Doe becomes [[<a href="http://johndoe.com">http://johndoe.com</a>|John Doe]] without any forethought or link markup written.</div><div><br></div><div>but perhaps i'm misunderstanding how the InterMap could be implemented. the thing that is so nice about the InterMap setup is that you can maintain your list on a wiki page, instead of in config.php. do let me know if i'm missing something here...</div><div><br></div><div><br></div><div>* Markup</div><div><br></div><div>i&nbsp;mangled&nbsp;PM's&nbsp;code (similar to Peter's - thanks!) a bit and got the following case-insenstive version to work deliciously. it also includes Eemeli's great idea of having a back-tick escape figure so that:</div><div><div><span class="Apple-tab-span" style="white-space: pre; ">        </span>john doe<span class="Apple-tab-span" style="white-space:pre">                </span>turns into<span class="Apple-tab-span" style="white-space:pre">                </span>[[<a href="http://johndoe.com">http://johndoe.com</a>|john doe]]</div><div></div></div><div></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>John Doe<span class="Apple-tab-span" style="white-space:pre">                </span>turns into<span class="Apple-tab-span" style="white-space:pre">                </span>[[<a href="http://johndoe.com">http://johndoe.com</a>|John Doe]]</div><div><div><div><div><span class="Apple-tab-span" style="white-space: pre; ">        </span>`John Doe<span class="Apple-tab-span" style="white-space:pre">                </span>remains<span class="Apple-tab-span" style="white-space:pre">                </span>John Doe</div><div><div></div></div></div></div><div><div><br></div><div><br></div><div># all keys must be completely lowercase in order for this to work</div><div>$NameToLinkArray = array(</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>'john doe' =&gt; '<a href="http://www.johndoe.com">http://www.johndoe.com</a>',&nbsp;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>'sally struthers' =&gt; '<a href="http://www.def.com">http://www.def.com</a>'</div><div>);</div><div><br></div><div><div>Markup('names', 'inline',</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>'/(`?)\b(' . join('|', array_keys($NameToLinkArray)) . ')\b/ei',</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>'AutoNameToLinkFunc("$2","$1")'</div><div>);</div><div><br></div><div>function AutoNameToLinkFunc($name, $escape) {</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>global $NameToLinkArray;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>if ($escape) return $name;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>$link = '%newwin%[['.$NameToLinkArray[strtolower($name)].'|'.Keep($name).']]';</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>return $link;</div><div>}</div><div><br></div></div></div></div><div><span class="Apple-style-span" style="font-size: 11px; "><span class="Apple-style-span" style="font-size: medium;"><div>* i had to substitute the AutoNameToLinkFunc because i couldn't figure out how to get pmwiki to find $NameToLinkArray - i got errors, and had to resort to calling it as a global in a function. perhaps someone knows how to finagle this without having to declare a separate function, as PM did in his recent example?</div><div><br></div><div>question/next step:&nbsp;</div><div>is there a way to set up my list of names on a wiki page (like Site.NamesToLinks), like InterMap is setup?</div><div><br></div><div>i like this a lot - superuseful!</div><div>i've added a page for this latter recipe: <a href="http://www.pmwiki.org/wiki/Cookbook/AutoLink">http://www.pmwiki.org/wiki/Cookbook/AutoLink</a></div><div>(suggestions for a better name? this was the first that came to mind)</div><div><br></div></span></span></div><div>thanks for the help!</div><div>adam</div><div><br></div><div><br></div><br><div><div>On 26 Aug 2009, at 7:47 AM, Patrick R. Michaud wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">On Wed, Aug 26, 2009 at 02:51:02AM +0200, Melodye Bowers wrote:</div> <blockquote type="cite"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">$foo = array('John' =&gt; '<a href="http://www.abc.com">http://www.abc.com</a>', 'Sally' =&gt; '<a href="http://www.def.com">http://www.def.com</a>');</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">foreach ($foo as $name =&gt; $site) {</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">&nbsp;&nbsp; </span>Markup('/\b'.$name.'\b/', '%newwin%'.$site.'%%', ...);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">}</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Does that work? <span class="Apple-converted-space">&nbsp;</span></div> </blockquote><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">It "works", but only for very small numbers of names.<span class="Apple-converted-space">&nbsp; </span>After adding</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">100 or so such rules the speed of markup processing will degrade<span class="Apple-converted-space">&nbsp;</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">noticeably.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Better would be to combine all of the names into a single markup rule</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">(code below is untested, for illustration only):</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">&nbsp; &nbsp; </span>$foo = array('John' =&gt; '<a href="http://www.abc.com">http://www.abc.com</a>',<span class="Apple-converted-space">&nbsp;</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span>'Sally' =&gt; '<a href="http://www.def.com">http://www.def.com</a>');</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">&nbsp; &nbsp; </span>Markup('names', 'inline',</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">&nbsp; &nbsp; &nbsp; </span>'/\b(' . join('|', array_keys($foo)) . ')\b/e',</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">&nbsp; &nbsp; &nbsp; </span>"'[['.\$foo[$1].'|'.Keep('$1').']]'");</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">It's also possible that one could make use of the $IMap array</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">for this in config.php (also untested):</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">&nbsp; &nbsp; </span>$IMap['John'] = '<a href="http://www.abc.com/'">http://www.abc.com/'</a>;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">&nbsp; &nbsp; </span>$IMap['Sally'] = '<a href="http://www.def.com/'">http://www.def.com/'</a>;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Pm</div> </blockquote></div><br></body></html>