How to get rid of duplicate inline css?

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Locked
htmanning
Registered User
Posts: 81
Joined: Sun Jan 26, 2003 2:51 am

How to get rid of duplicate inline css?

Post by htmanning » Wed Jan 29, 2003 3:50 am

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

User avatar
Balint
Registered User
Posts: 952
Joined: Tue Aug 06, 2002 2:19 pm
Location: Germany
Contact:

Post by Balint » Wed Jan 29, 2003 11:16 pm

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

htmanning
Registered User
Posts: 81
Joined: Sun Jan 26, 2003 2:51 am

Post by htmanning » Thu Jan 30, 2003 1:09 am

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.

Light Speed
Registered User
Posts: 76
Joined: Wed Nov 20, 2002 9:41 am
Location: Portland

Post by Light Speed » Thu Jan 30, 2003 3:35 am

Did you go to your admin/styles management page and confirm the default css in the css field?

htmanning
Registered User
Posts: 81
Joined: Sun Jan 26, 2003 2:51 am

Post by htmanning » Thu Jan 30, 2003 4:52 am

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

Light Speed
Registered User
Posts: 76
Joined: Wed Nov 20, 2002 9:41 am
Location: Portland

Post by Light Speed » Thu Jan 30, 2003 6:18 am

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.

htmanning
Registered User
Posts: 81
Joined: Sun Jan 26, 2003 2:51 am

Post by htmanning » Thu Jan 30, 2003 7:39 am

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.

Light Speed
Registered User
Posts: 76
Joined: Wed Nov 20, 2002 9:41 am
Location: Portland

Post by Light Speed » Thu Jan 30, 2003 7:43 am

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.

User avatar
Balint
Registered User
Posts: 952
Joined: Tue Aug 06, 2002 2:19 pm
Location: Germany
Contact:

Post by Balint » Thu Jan 30, 2003 10:06 am

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

htmanning
Registered User
Posts: 81
Joined: Sun Jan 26, 2003 2:51 am

Post by htmanning » Thu Jan 30, 2003 6:40 pm

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

htmanning
Registered User
Posts: 81
Joined: Sun Jan 26, 2003 2:51 am

Post by htmanning » Sat Feb 01, 2003 9:47 pm

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.

Locked

Return to “2.0.x Support Forum”