The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
![]()
Where is the code that determines where the template will be used if a particular styleset does not have a template associated with it? I would like it so that the logic worked like this, i have 2 style sets.
If using style set A if template - use it if not template (ie not a custom one in styleset A) then use the default template that comes with VB. If using style set B if template use it if no template, then use the template in style set A. If no template in styleset A then use default template. See what i mean? This means that for template sets which only have a different header, footer and something else, i do not have to keep up to date every other single template from my default one. any ideas? |
#2
|
||||
|
||||
![]()
Correct me if I'm wrong, but do you mean you wanna implement multi-level inheritence?
|
#3
|
||||
|
||||
![]()
yes that is exactly what i want.
|
#4
|
||||
|
||||
![]()
Could be implemented, but probably will add alot of mysql-queries.
The problem is you can't predict which templates you have to select from the database on forehand. Mysql doesn't support recursive queries so you'd have to get a workaround on it which will add more queries. |
#5
|
||||
|
||||
![]()
how does it do it now? if there is no template in a specific style? does it then go off and get the template from another style?
i thought an if elseif routine would just add 1 extra query per page which i can cope with but perhaps it is more than that. annoying. |
#6
|
||||
|
||||
![]()
right now 2 template-sets are selected on forehand: The default template set (with default I mean the one you can't edit, the one with id -1) and the users template-set.
If a template from the users-set doesn't exists he gets the one from the default set. |
#7
|
||||
|
||||
![]()
For my purpose the system would always be
Default -> A -> B/C/D/E/F as A is my "default" set. So i guess my options are: i) using phpmyadmin (or i think there is a variable that allows you to override deleting the real default set, there was with the beta anyway) and over ride the actual default set with my set A templates. Problem is of course upgrading when template changes are made. ii) somehow load 3 template sets instead of 2 and then change the bit that goes if x, use x elseif use x from template -1. any idea where these bits of code are? i assume global.php - of to look. |
#8
|
||||
|
||||
![]()
With your solution you'll limit it to a certain level. The best solution would be to have no limit at all, so you can inherit many levels deep. I thought about it and I think it can be implemented without adding extra queries, but I haven't really figured out how.
The particular code is the cachetemplates function in admin/functions.php |
#9
|
||||
|
||||
![]()
i think this is the section:
PHP Code:
(templatesetid=-1 OR templatesetid='$templatesetid')) does that mean, find a specific template where templatesetid=x as well as where templatesetid=-1? so both are returned. By ordering by templatesetid, the ones with a real template setid come up first? any ideas what would happen if i just did (templatesetid=-1 OR templatesetid='$templatesetid' OR tempatesetid='10')) ? if i ensure that all my other template sets have a higher number than 10? (or perhaps a lower number if that is what is needed)? |
#10
|
||||
|
||||
![]()
That probably would work, only you have to change it to:
(templatesetid=-1 OR tempatesetid='10' OR templatesetid='$templatesetid')) In that particular order, in order to let the inheritance happen in the right order (lot of orders) but I'm not 100% sure. There is another disadvantage: The result of the query can be far more bigger now, resulting in a slight(?) slowdown... |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|