Log in

View Full Version : Template Changes via Products


evenmonkeys
04-05-2006, 11:45 PM
How would I do this? If I want to make a product that overwrites an entire template, would I just run a query that overwrites the original template? Or is there another way to do this? As many people have several templates, I am not sure how to properly do this.

Help me out. =D

Or or or... would I make a new row in the template group with -1 as the styleid?

Paul M
04-05-2006, 11:51 PM
In the cache_templates hook add a line to cache your template ;

$globaltemplates[] = 'new_template';

Then in the global_start hook, add a line like this;

$vbulletin->templatecache['current_template'] = $vbulletin->templatecache['new_template'];

evenmonkeys
04-06-2006, 12:13 AM
I'm still lost. I think I'm even more lost than I was before. Do I run an insert query? Do update a template? Do I not run any queries at all? I think I understand what you were saying, but I need to know what to do before I even get to that point. >_<; Don't hate me.

I see you, Xenon!!!! Help me!!!

Xenon
04-06-2006, 12:18 AM
actually: nope
you should not change a template with a product, because what would happen, if two products changes the same template?

exactly: a problem...

for template changes there should still be a install file, like the traditional one :)
(that may change with new versions of vb)

there is just one possibility you might have: manipulating the output of the print_output function, but as said, you shouldn't really do so, because if someone has a custom style, it won't work...

evenmonkeys
04-06-2006, 12:32 AM
Oh my god. I love you both. <3!