Consider my "invite" system. It's fully-phrased. It uses a plugin for the main PHP code. That's fine.
But it's all meaningless unless the invitation is
displayed, and that means changing a template.
I chose to change the
forumrules template. If the person is authenticated, then show the normal posting rules. If they are a guest, however, then in my opinion, posting rules are meaningless... so replace them entirely with the invitation.
Now, if I were to make this a released hack, I can document the template changes a user would need to make.
However, I think a better approach is to not change
forumrules at all, but to include a completely different template, call it
invite_forumrules, and use a plugin to enable it.
Something like this:
You must first be a
registered member to view any code.
So my questions are:
1. How do you cause vbulletin to use a different template than it normally would? I see calls to "fetch_template", so I imagine the plugin would need to use that mechanism.
2. Performance considerations: how would you make sure your template was properly cached?
Ok - some more specific information/questions:
vBulletin caches it's templates. So when there is a call for a template via the fetch_template() function, it fetches it from the cache. True? False?
Assume it's true - I see a
cache_templates hook. So I think it would be possible to author a plugin that runs at that hook, which will check to see if your product is enabled, and if so, "swap" the template... something like:
$this->templates['forumrules'] = "invite_forumrules";
Does that make sense, or am I totally confused?