Never mind. As usual, the answer hit me minutes after I clicked send!  :)

I forgot to return the results for the templatemarkup function.  It should be

function BOLTtemplatemarkup($content, $page, $zone='', $rules='',
$replace=true) {
         return BOLTdomarkup($content, $page, $zone, $rules, $replace);
         }

Cheers,
Dan

P.S. Got this working. My plan now is to find ways to control the
rules in a configurable variable so you can set which markups get run
in specific zones/pages, etc. Something like:

$BOLTrules['some.page']['zone'] = 'whatever...';

I'm envisioning, making it possible to disable certain markup orders
in certain sections of a site or under certain circumstances. Could be
very powerful. But the syntax is not so easy. For example, you might
want to do for a template display. But how would you do that--define
orders for every possible page output?  Some kind of hierarchical
notation (won't work using traditional functions, unless we set rules
in a site.auth.rules page or something. hmmm...) But then what about
zones?  Should they be separate effects? Cumulative?

And then again, what about adding finer tooth control over specific
rules within orders. But merging the two makes this all much easier.



On Thu, Dec 4, 2008 at 1:49 PM, The Editor <[EMAIL PROTECTED]> wrote:
> One of the items on my todo list is to merge the domarkup and
> templatemarkup functions for various reasons. 1) shorter code. 2) more
> features.  However I find myself a bit stumped.
>
> This is the code I have working on my machine right now. All seems well...
>
> function BOLTdomarkup($content, $page, $zone='', $rules='', $replace=true) {
>        global $MarkUpTable, $Token, $BOLTvar, $pageLink;
>        if ($page == '') $page = $pageLink;
>        $content = preg_replace('/\{\*\:([-_a-zA-Z0-9]+)\}/',
> '{'.$page.'*:$1}', $content); // base pages
>        if ($replace == true) {
>                $content = preg_replace('/\{\+([-_a-zA-Z0-9]+)\}/',
> '{'.$page.':$1}', $content); // template replacements
>                $content = preg_replace('/\{\+:?([-_a-zA-Z0-9\:]+)\}/',
> '{'.$page.':$1}', $content);
>                }
>        $myMarkUpTable = $MarkUpTable;
>        foreach($myMarkUpTable as $i => $order) {
>                if ($rules != '' && strpos($rules, $i) === false) continue;
>                foreach ($order as $ii => $rule) {
>                        $content = preg_replace($rule['pattern'], 
> $rule['replace'], $content);
>                        }
>                }
>        $content = preg_replace('/\~\~([0-9]+)\~\~/e', '$Token[$1]', $content);
>        return BOLTstripslashes($content);
>        }
>
> function BOLTtemplatemarkup($content, $page, $zone='', $rules='',
> $replace=true) {
>        global $MarkUpTable, $Token, $BOLTvar, $pageLink;
>        if ($page == '') $page = $pageLink;
>        $content = preg_replace('/\{\*\:([-_a-zA-Z0-9]+)\}/',
> '{'.$page.'*:$1}', $content); // base pages
>        if ($replace == true) {
>                $content = preg_replace('/\{\+([-_a-zA-Z0-9]+)\}/',
> '{'.$page.':$1}', $content); // template replacements
>                $content = preg_replace('/\{\+:?([-_a-zA-Z0-9\:]+)\}/',
> '{'.$page.':$1}', $content);
>                }
>        $myMarkUpTable = $MarkUpTable;
>        foreach($myMarkUpTable as $i => $order) {
>                if ($rules != '' && strpos($rules, $i) === false) continue;
>                foreach ($order as $ii => $rule) {
>                        $content = preg_replace($rule['pattern'], 
> $rule['replace'], $content);
>                        }
>                }
>        $content = preg_replace('/\~\~([0-9]+)\~\~/e', '$Token[$1]', $content);
>        return BOLTstripslashes($content);
>        }
>
> /*
> function BOLTtemplatemarkup($content, $page, $zone='', $rules='',
> $replace=true) {
>        BOLTdomarkup($content, $page, $zone, $rules, $replace);
>        }
> */
>
> As you can see the two functions are exact 100% duplicates. However,
> when I uncomment the second template function and comment the one out
> first instead, it fails to display properly. Maybe the solution will
> come to me eventually, but I thought I'd ask if anyone sees whatever
> it is I'm missing, or has a suggestion. It's quite peculiar...
>
> Cheers,
> Dan
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"BoltWire" group.
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to