PHP Bulletin Board Home
News About Home
Features of phpBB Test drive phpBB Downloads Support for phpBB The phpBB Community Styles for customising phpBB 3rd party modifications to phpBB

Support Home | Knowledge Base Home | Submit Article | Search Articles | Browse Articles
 Could not open theme/get template config 
Description: How to fix errors where the template config file cannot be found.
Author: R45
Date: Tue Oct 29, 2002 4:13 pm
Type: Fix
Keywords: error, could, not, load, open, get, failed, subsilver, config, file, theme_id, subSilver.cfg, template, style, theme
Category: Styles
Problems

Quote:
phpBB : Critical Error

Couldn't open template_name theme template config file

This problems is caused when phpBB cannot open the template config file (with an extension of .cfg) for an installed template.

Probable Causes

    Renamed config file - Most systems are case sensative, therefore, if the filename should be subSilver.cfg however you renamed it (or some FTP clients upload files in lower case) to subsilver.cfg, this error will be produced. It will also generate an error if the config file was renamed totally. You can solve this problem without using the Fix at the end of this Tutorial by checking over the naming of the file.

    Missing config file - If the config file (commonly .cfg) is missing, this error will be generated. To fix this without using the Fix at the end of this Tutorial, check if the .cfg file exists and if it doesn't, try re-uploading the template.


Quote:
phpBB : Critical Error

Could not get theme data for themes_id [xx]


Probable Cause

    You either modified or deleted the theme table in your database. The best Fix for this is below

Fixes

You can fix either of these problems in two main ways, using an automated script or doing manual queries to your database. Automated fixes here are for MySQL only at this time.

Note for Both Automated Fixes below: Only if you receive a FAILED should you be alarmed.

Automated Fix A

-Recommended- This Fix will create a new theme based on your subSilver files. It will set the new theme as your default theme and override any user's styles. For this script to work properly, you should ensure that your subSilver files are in good order (i.e. The reason you got an error wasn't because you were editing subSilver files). If modifying the subSilver files caused the problem, upload the entire subSilver directory onto your server in /templates/ overwriting all existing files.

Download the Fix here. Extract the file to your phpBB root directory and run once. Delete the file from your server immediately after running the file.

Automated Fix B

This fix will set a theme id of your choice as the default style and set user style override to on. This should only be used if you are sure that either the original subSilver theme works or you know the ID number of another working style.

Download the Fix here. Extract the file to your phpBB root directory. To set the ID you want to update in the database, run the script like http://www.yourhost.com/phpBB2/fix_2.php?theme_id=ID_NUMER_HERE (e.g. http://www.yourhost.com/phpBB2/fix_2.php?theme_id=5). If you don't add any arguments to the URL, the theme ID "1" will be used (Which is what subSilver originally installs under). Delete the file from your server immediately after running.

Manual Fix A

Note for both Fixes: Substitute phpbb_ with the prefix you set during installation if it differs.

This fix will basically do what Automated Fix A does. You will need access to your database to run this query, either via shell Access or a database management tool, like phpMyAdmin (http://www.phpmyadmin.net).

You'll need to first run this query.
    Code:
    INSERT INTO phpbb_themes (themes_id, template_name, style_name, head_stylesheet, body_background, body_bgcolor, body_text, body_link, body_vlink, body_alink, body_hlink, tr_color1, tr_color2, tr_color3, tr_class1, tr_class2, tr_class3, th_color1, th_color2, th_color3, th_class1, th_class2, th_class3, td_color1, td_color2, td_color3, td_class1, td_class2, td_class3, fontface1, fontface2, fontface3, fontsize1, fontsize2, fontsize3, fontcolor1, fontcolor2, fontcolor3, span_class1, span_class2, span_class3) VALUES (NULL, 'subSilver', 'subSilver', 'subSilver.css', '', 'E5E5E5', '000000', '006699', '5493B4', '', 'DD6900', 'EFEFEF', 'DEE3E7', 'D1D7DC', '', '', '', '98AAB1', '006699', 'FFFFFF', 'cellpic1.gif', 'cellpic3.gif', 'cellpic2.jpg', 'FAFAFA', 'FFFFFF', '', 'row1', 'row2', '', 'Verdana, Arial, Helvetica, sans-serif', 'Trebuchet MS', 'Courier, \'Courier New\', sans-serif', 10, 11, 12, '444444', '006600', 'FFA34F', '', '', '');

After you execute this query, use the ID number the query return and run these:
    Code:
    INSERT INTO phpbb_themes_name (themes_id, tr_color1_name, tr_color2_name, tr_color3_name, tr_class1_name, tr_class2_name, tr_class3_name, th_color1_name, th_color2_name, th_color3_name, th_class1_name, th_class2_name, th_class3_name, td_color1_name, td_color2_name, td_color3_name, td_class1_name, td_class2_name, td_class3_name, fontface1_name, fontface2_name, fontface3_name, fontsize1_name, fontsize2_name, fontsize3_name, fontcolor1_name, fontcolor2_name, fontcolor3_name, span_class1_name, span_class2_name, span_class3_name) VALUES ('ID_NUMBER_HERE', 'The lightest row colour', 'The medium row color', 'The darkest row colour', '', '', '', 'Border round the whole page', 'Outer table border', 'Inner table border', 'Silver gradient picture', 'Blue gradient picture', 'Fade-out gradient on index', 'Background for quote boxes', 'All white areas', '', 'Background for topic posts', '2nd background for topic posts', '', 'Main fonts', 'Additional topic title font', 'Form fonts', 'Smallest font size', 'Medium font size', 'Normal font size (post body etc)', 'Quote & copyright text', 'Code text colour', 'Main table header text colour', '', '', '');

    UPDATE phpbb_config SET config_value = 'ID_NUMBER_HERE' WHERE config_name = 'default_style';

    UPDATE phpbb_config SET config_value = '1' WHERE config_name = 'override_user_style';

Note where ID_NUMBER_HERE is. Replace the previous ID number generated where that text is in the first two queries.

Manual Fix B

This query will also do just what Automated Fix B did. You can set a specific theme ID as the default theme and also set the override style on. Replace ID_NUMBER_HERE with the relevant ID.

    Code:
    UPDATE phpbb_config SET config_value = 'ID_NUMBER_HERE' WHERE config_name = 'default_style';

    UPDATE phpbb_config SET config_value = '1' WHERE config_name = 'override_user_style';


All Done!

Any comments/problems/suggestion for the above solutions can be posted here.

Username: Password:
News | Features | Demo | Downloads | Support | Community | Styles | Mods | Links | Merchandise | About | Home
 © Copyright 2002 The phpBB Group.