Piwigo.org

You are not logged in. (Register / Login)

Announcement

Post a reply

Write your message and submit

Click in the dark area of the image to send your post.

Go back

Topic review (newest first)

VDigital
2010-03-11 00:26:43

Case 4 - A new template called "Mine" as some .tpl (including menubar.tpl) files but in themeconf.inc.php
you have:
$themeconf['modeling'] = true;


Search will be
in the template/Mine/ directory.
if not found (missing files)
in the template/default directory.

So for menubar only one directory (template/Mine) will be searched
and maybe for profile.tpl it will be search in the first directory but if the file is missing it would be found in template/default.
This is the reason I recommend to have frequently used files in the template directory as today.

plg
2010-03-11 00:09:10

VDigital wrote:

$themeconf['modeling'] = false;

=> All *.tpl files are only searched in the related template directory (so they must be provided).

What if a theme is distributed with $themeconf['modeling'] = true; and you don't want the check of menubar.tpl in 2 directories?

VDigital
2010-03-10 23:57:49

$themeconf['modeling'] = false;

=> All *.tpl files are only searched in the related template directory (so they must be provided).

VDigital
2010-03-10 23:54:32

VDigital wrote:

On gallery side, the default template_dir is now an array.

If the template file exist as today in the template directory, no behaviour change.
But if the template file is missing...

The code checks in $themeconf['modeling'] the template model to use.

Case 1 - A new template called "newbe" as no .tpl files but in themeconf.inc.php
you have:
$themeconf['modeling'] = 'yoga';

=> all .tpl files (header.tpl, index.tpl, etc.) could be found in the yoga template.

Case 2 - A new template called "oldbe" as no .tpl files but in themeconf.inc.php
you DO NOT have:
$themeconf['modeling'] = 'yoga';

=> all .tpl files (header.tpl, index.tpl, etc.) could be found in the template-common/yoga/ directory.


Case 3 - A new template called "Advanced" as some .tpl files but in themeconf.inc.php
you have:
$themeconf['modeling'] = 'yoga';

=> .tpl files (header.tpl, index.tpl, etc.) could be found in the template/Advanced directory.
if not found (missing files)
=> .tpl files (header.tpl, index.tpl, etc.) could be found in the template/yoga directory.
if not
=> .tpl files (header.tpl, index.tpl, etc.) could be used if they are in the template-common/yoga/ directory.


New feature in trunk: [Subversion] r5071

In above text, template-common/yoga/ directory must be understood as template/default/ 
but the logic is similar.

plg
2010-03-10 23:26:31

Thank you VDigital :-)

VDigital
2010-03-10 23:23:34
VDigital
2010-03-10 22:48:02

May I say moving default to template-common? ;-D
Seriously? I will analyse the best way to fix it.

plg
2010-03-10 22:42:54

VDigital wrote:

= There is no theme currently within default !

Well, yes I also encounter issues. Can you fix this?

VDigital
2010-03-10 22:32:35

There is a problem on Controller popup page. (MultiView)

Warning: opendir(../../template/default/theme) [function.opendir]: failed to open dir: No such file or directory in C:\wamp\www\Piwigo.org\trunk\include\functions.inc.php on line 138

= There is no theme currently within default !

;-)

VDigital
2010-03-10 14:39:38

First, we already have a cache.
Next, rvelices implemented a check on realpath to detect any change.
More, a standard cache process exists in Smarty and detect any file change or directory change.
(If I read well on Smarty website).
Moreover, you really need 3/4 tpl files (most used) in your template to keep at level your performance.

Finally, I think we can code (a better way than my previous proposal):
$modeling = get_themeconf('modeling');
if (!defined('IN_ADMIN') and ($modeling !== false) )


So if $themeconf['modeling'] is not set or set with a model we will take advantages of modeling.
If $themeconf['modeling']===false we will keep advantage of old behavior/performance (but its constraint is to have of all .tpl files available in the template directory).

;-)

plg
2010-03-10 11:42:14

VDigital wrote:

if (!defined('IN_ADMIN') and ($conf['modeling']==true  or !isset($conf['modeling'])) )

Then your personal template must be exhaustive if your turn it false.

Is that solution suit you?

As far as I understand, the webmaster can't choose to activate template_modeling or not. It's a template property. If you use yoga, you already use template modeling.

Beyond rvelices (who has enough technical skills to compute a template), forcing the user to have its "personnal" template is not possible.

To solve the potential performance issue for low disk hosting, couldn't we have a "cache" of the location of each tpl file for a given template instead?

VDigital
2010-03-10 07:38:01

Yes, I already thought on that case.
I suggest a new option.

if (!defined('IN_ADMIN') and ($conf['modeling']==true  or !isset($conf['modeling'])) )

Then your personal template must be exhaustive if your turn it false.

Is that solution suit you?

rvelices
2010-03-10 06:20:24

VDigital,
I'm concerned a bit about performance.
My web site (as most of them) use a very slow disk (NAS like). I had some gained by putting $conf['template_compile_check'] = false; (by putting this line we don't check the file modification time of the original .tpl)
With your system I have the feeling (not sure) that you are going to check the existence of the tpl in several directories ... Can you take this issue into account please ?

Tks

VDigital
2010-03-10 00:09:53

You were so convinced you were right.

template-common and template-extension have been created by Chrisaga and at that time you didn't tell us any remark to move them in template.

Please consider now these basic questions. And do as you want.

plg
2010-03-09 22:05:48

I don't understand why you ask these questions once I did the move while you said 2 posts above : No problem on my side

Board footer

Powered by FluxBB

About this website · Donate · Contact Piwigo project © 2002-2013