Thanks for the hack

A couple comments.
You defined the "chiefpost" column as INT( 10 ) UNSIGNED, but it is being used a flag. Since a field that big is not needed, It should be tinyint, or char(1). Same for ttype.
why are you using "global $globaltemplates;" in your cache_templates plugin? It shouldn't be necessary
Other than that, your hack is very nicely coded

Thanks for sharing