Page 1 of 1

How to get rid of duplicate inline css?

Posted: Wed Jan 29, 2003 3:50 am
by htmanning
I have read all the threads in here about getting rid of the inline css but can't get it to work. As soon as I take the code out of the overall_header.tpl file, I get errors. I have changed:

<!-- link rel="stylesheet" href="templates/subSilver/{T_HEAD_STYLESHEET}" type="text/css" -->

and made it:

<link rel="stylesheet" href="templates/subSilver/{T_HEAD_STYLESHEET}" type="text/css" />

Then I took out everything between
<style type="text/css"></style>

I even edited the simple_header.tpl in the same way. I've read all the topics on this board about this problem and for some reason I get a parse error when I run it with the link to a stylesheet. My paths are correct and are the default. I'm using the subSilver but I'm just trying to cut down on bandwidth.

I've read the following threads and tried what they said and it doesn't work.

http://www.phpbb.com/phpBB/viewtopic.ph ... link+admin


http://www.phpbb.com/phpBB/viewtopic.ph ... omment+css

Can someone give me step by step instructions? What files other than over_header.tpl needs to be edited?

Any ideas?

Thanks.

Tom

Posted: Wed Jan 29, 2003 11:16 pm
by Balint
Hi!

Could you post the exact parsing error or post the URL that I can look it over for myself? The way you chose is right, I didi it hte same way and it worked...

Regards,
Bálint

Posted: Thu Jan 30, 2003 1:09 am
by htmanning
Here's the error code I get.

Parse error: parse error, unexpected '}' in /usr/www/users/cmp10/forums/includes/template.php(127) : eval()'d code on line 11

I don't get it. It just doesn't work no matter what I try.

Thanks.

Posted: Thu Jan 30, 2003 3:35 am
by Light Speed
Did you go to your admin/styles management page and confirm the default css in the css field?

Posted: Thu Jan 30, 2003 4:52 am
by htmanning
Light Speed wrote: Did you go to your admin/styles management page and confirm the default css in the css field?


Yes. The admin is left at the default for subSilver which is subSilver.css.

Assuming I install the default board and make no changes...

1. How many files do I have to edit to get rid of the duplicate inline style sheet and use the subSilver.css file instead?

2. Which files do I edit?

3. Do I just simply make this change to the overall_header.tpl?

<link rel="stylesheet" href="templates/subSilver/{T_HEAD_STYLESHEET}" type="text/css" />

Take out...
<style type="text/css"></style>

Just to test, I installed another theme and that works fine but I'm still loading the inline style sheet with that one too. I need to get rid of that.

Thanks.

Tom

Posted: Thu Jan 30, 2003 6:18 am
by Light Speed
In the overall_header.tpl file remove <style type="text/css"> </style> and all the css inbetween these tags, it's a lot.

Remove the comments on the link

Code: Select all

<link rel="stylesheet" href="templates/subSilver/{T_HEAD_STYLESHEET}" type="text/css">
That should do it.

Posted: Thu Jan 30, 2003 7:39 am
by htmanning
Light Speed wrote: In the overall_header.tpl file remove <style type="text/css"> </style> and all the css inbetween these tags, it's a lot.

Remove the comments on the link

Code: Select all

<link rel="stylesheet" href="templates/subSilver/{T_HEAD_STYLESHEET}" type="text/css">
That should do it.


I did ALL that. That's the problem. It seems so simple, but it doesn't work. I've read all the threads in here about this and it just doesn't work. I've removed the comments, I've taken out the inline style sheet and I get nada. Very frustrating.

Posted: Thu Jan 30, 2003 7:43 am
by Light Speed
That sux :(

Sorry I can't help. I actually don't use the phpbb style/css. I tied the whole phpbb into my sites main css file so all my css is in one place.

Posted: Thu Jan 30, 2003 10:06 am
by Balint
Hi!

I post the part you have to look over (includes/templates.php):
/**
* Load the file for the handle, compile the file,
* and run the compiled code. This will print out
* the results of executing the template.
*/
function pparse($handle)
{
if (!$this->loadfile($handle))
{
die("Template->pparse(): Couldn't load template file for handle $handle");
}

// actually compile the template now.
if (!isset($this->compiled_code[$handle]) || empty($this->compiled_code[$handle]))
{
// Actually compile the code now.
$this->compiled_code[$handle] = $this->compile($this->uncompiled_code[$handle]);
}

// Run the compiled code.
eval($this->compiled_code[$handle]);
return true;
}

/**
* Inserts the uncompiled code for $handle as the
* value of $varname in the root-level. This can be used
* to effectively include a template in the middle of another
* template.
* Note that all desired assignments to the variables in $handle should be done
* BEFORE calling this function.
*/


Is it the same on your page?

Regards,
Bálint

Posted: Thu Jan 30, 2003 6:40 pm
by htmanning
Yep, here's mine...



-------------------------------------
/**
* Load the file for the handle, compile the file,
* and run the compiled code. This will print out
* the results of executing the template.
*/
function pparse($handle)
{
if (!$this->loadfile($handle))
{
die("Template->pparse(): Couldn't load template file for handle $handle");
}

// actually compile the template now.
if (!isset($this->compiled_code[$handle]) || empty($this->compiled_code[$handle]))
{
// Actually compile the code now.
$this->compiled_code[$handle] = $this->compile($this->uncompiled_code[$handle]);
}

// Run the compiled code.
eval($this->compiled_code[$handle]);
return true;
}

/**
* Inserts the uncompiled code for $handle as the
* value of $varname in the root-level. This can be used
* to effectively include a template in the middle of another
* template.
* Note that all desired assignments to the variables in $handle should be done
* BEFORE calling this function.
*/
-------------------------------------

I tell you, something else is going on. All I did was edit the overall_header.tpl file. I didn't edit any other file. Do I need to do something in the admin first??

Tom

Posted: Sat Feb 01, 2003 9:47 pm
by htmanning
I figured out the answer. You MUST remove this line in the overall_header.tpl file:

<!-- END switch_enable_pm_popup -->

After uncommenting the link to the subSilver.css line, and removing the inline stylesheet my board was still choking. After removing the above line it works.