phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

Hard coded template selection


 
Search this topic... | Search phpBB2 Discussion... | Search Box
Register or Login to Post    Index » phpBB2 Discussion  Previous TopicPrint TopicNext Topic
Author Message
Holger
Board Member



Joined: 19 Jan 2009

Posts: 509
Location: Hanover


flag
PostPosted: Fri Oct 08, 2010 8:34 am 
Post subject: Hard coded template selection

Hi,

I have noticed that there is always a
SELECT * FROM phpbb_themes WHERE themes_id = 1
(of course)
How can I remove this? Is it possible to have ONE template as default, without "asking the DB"?

/Holger

_________________
Love your data! Back it up!
Back to top
dogs and things
Board Member



Joined: 18 Nov 2008

Posts: 621
Location: Spain


flag
PostPosted: Fri Oct 08, 2010 12:08 pm 
Post subject: Re: Hard coded template selection

I believe this is as easy as finding in includes/functions.php
Code:
    $template_path = 'templates/' ;
    $template_name = $row['template_name'] ;

and changing
Code:
$template_name = $row['template_name'] ;
into
Code:
$template_name = 'here_your_template_name';


here_your_template_name is replaced with the name of the folder for the template you are using, like f.i. subSilver in between the ''.

I don´t know what will happen to the users that have chosen another template.

Why don´t you simply use the Override user style in the ACP?

_________________
phpBB2 will never die, I hope!
Back to top
Holger
Board Member



Joined: 19 Jan 2009

Posts: 509
Location: Hanover


flag
PostPosted: Fri Oct 08, 2010 12:13 pm 
Post subject: Re: Hard coded template selection

I HAVE override, but on every page I have the said SELECT
SELECT * FROM phpbb_themes WHERE themes_id = 1
I want to get rid of that and save one query. Why query when there is nothing to query about ...
But if I follow your instructions I dont save that query ... do I?

_________________
Love your data! Back it up!
Back to top
Salvatos
Board Member



Joined: 19 Feb 2009

Posts: 415
Location: Québec


flag
PostPosted: Fri Oct 08, 2010 3:22 pm 
Post subject: Re: Hard coded template selection

Looking it up I guess you can remove everything between
global $db, $board_config, $template, $images, $phpbb_root_path;
and
$template_path = 'templates/' ;
and make doegs and things' change above to $template_name.

Watch out for whatever calls setup_style($style), though. The function returns $row, so I'm expecting that some place needs the template info from those queries... Huh, I didn't remember you could edit templates from the ACP.
Back to top
Dog Cow
Board Member



Joined: 18 Nov 2008

Posts: 378


flag
PostPosted: Sat Oct 09, 2010 7:01 pm 
Post subject: Re: Hard coded template selection

I made similar changes over 2 years ago to remove all database dependencies from the template system.

It involved changes to template.php and functions.php. setup_style() was removed, as were the two .cfg files in the template directory. I also removed the template sub-directory, since there is no point in having it if there is only one style. Instead of the style being in templates/style_name/ it is now in templates/

It's hard to remember all of the exact details, but I can take a closer look if anyone is interested.

_________________
Moof!
Lincoln's Tomb, Oak Ridge Cemetery, Springfield ILMac 512K BlogMac GUI
Back to top
Holger
Board Member



Joined: 19 Jan 2009

Posts: 509
Location: Hanover


flag
PostPosted: Sat Oct 09, 2010 8:05 pm 
Post subject: Re: Hard coded template selection

Oh, I did not suppose it is that complicated!
I AM interested, but only if you find the time! icon_redface.gif

_________________
Love your data! Back it up!
Back to top
Display posts from previous:   
Register or Login to Post    Index » phpBB2 Discussion  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0101 seconds using 15 queries. (SQL 0.0022 Parse 0.0005 Other 0.0074)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo