[wp-hackers] Re: Introduce some type of no-parse tag ?

Viper007Bond viper at viper007bond.com
Wed Sep 5 22:59:10 GMT 2007


Heh, that's actually what I ended up doing later:


$hash = sha1( $match[1] );
$this->encodedtemplates[$hash] = $match[1];
$content = str_replace( $match[0], $template_opener . '[templatediaencoded]'
. $hash . '[/templatediaencoded]' . $template_closer, $content );


$content = str_replace( $match[0], $template_opener .
$this->encodedtemplates[$match[1]] . $template_closer, $content );


Works well and now that I'm thinking about it, I probably could probably
even just use like uniqid() or even an auto-incrementing value (1, 2, 3,
etc.) to reduce the overhead further.

On 9/5/07, Otto <otto at ottodestruct.com> wrote:
>
> Yikes. I can see where that works, but why go to that much trouble?
> Just pull the relevant text out of the post content entirely, stick it
> in a global array, and put a placeholder in it's place. Then at the
> higher level, find the placeholder, replace it with the text in the
> global array. Less overhead of encoding and decoding and such.
>
> This is similar to how the plugin I posted before works:
> http://ottodestruct.com/wpstuff/scriptenabler.zip
>
>
> On 9/4/07, Viper007Bond <viper at viper007bond.com> wrote:
> > I ended up doing a base64_encode() on the users input, {{this part
> here}},
> > and then decoding it at a high filter level. Not the prettiest thing in
> the
> > world, but it works perfectly.
> >
> > --
> > Viper007Bond | http://www.viper007bond.com/
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> >
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>



-- 
Viper007Bond | http://www.viper007bond.com/


More information about the wp-hackers mailing list