Saving bandwidth by deleting code in overall_header

The 2.0.x discussion forum has been locked; this will remain read-only. The 3.0.x discussion forum has been renamed phpBB Discussion.
Locked
User avatar
mlsbraves
Registered User
Posts: 71
Joined: Mon Oct 29, 2001 12:50 am
Location: Gulfport, MS
Contact:

Saving bandwidth by deleting code in overall_header

Post by mlsbraves »

In overall_header
NOTE: These CSS definitions are stored within the main page body so that you can use the phpBB2
theme administration centre. When you have finalised your style you could cut the final CSS code
and place it in an external file, deleting this section to save bandwidth.


So what excactly can I delete in overall_header that is not needed.

Most of the code under this can be altered in the admin pannel, but not all of it, so some of it needs to stay, right :?
ngomong
Registered User
Posts: 44
Joined: Sun Apr 28, 2002 7:23 am

Post by ngomong »

They're talking about the code for the style sheet. The final version should live at:

/home/your/forums/templates/subSilver/subSilver.css

In overall_header, change this line:

Code: Select all

<!-- link rel="stylesheet" href="templates/subSilver/subSilver.css" type="text/css" -->
... and uncomment it like this:

Code: Select all

<link rel="stylesheet" href="templates/subSilver/subSilver.css" type="text/css" >
Then, you can delete everything from here:

Code: Select all

 <style type="text/css">
<!--

/*
  The original subSilver Theme for phpBB version 2+
  Created by subBlue design
  http://www.subBlue.com
...
...
...
</style>
... to there.

But, if you've made changes to the colors and whatnot, cut that part, and save it to the subSilver.css file. Take a look at the current version of subSilver.css to see exactly where it starts and ends.
Bear
Registered User
Posts: 2586
Joined: Mon Dec 31, 2001 7:50 pm
Location: 127.0.0.1
Contact:

Post by Bear »

Recommend that you keep any image references in overall_header.tpl instead of the .css file. Netscape has a problem with references in CSS - if the CSS file doesn't exist in the same directory as the presentation file. Or, you could drop a copy of the CSS file in the root folder of phpBB.
Bear
Got a thing for fashion? So do we at the Fashion Spot.
Let us give you the Royal Treatment at Les Tribunes Royales.
Verteron
Registered User
Posts: 228
Joined: Fri Apr 19, 2002 6:37 pm

Post by Verteron »

Also remember to do the same for simple_header.tpl
xshredx
Registered User
Posts: 51
Joined: Fri Nov 09, 2001 3:05 pm

Post by xshredx »

do it this way

Code: Select all

<link rel="stylesheet" href="templates/templatename/{T_HEAD_STYLESHEET}" type="text/css">
<style type="text/css">
<!--
/* Specifiy background images for selected styles, specially here for NS4.
   This can't be done within the external style sheet as NS4 sees image paths relative to
   the page which called the style sheet 
   whereas all other browsers see image paths relative to the style sheet.
*/
TH			{ background-image: url(templates/templatename/images/cellpic3.gif) }
TD.cat		{ background-image: url(templates/templatename/images/cellpic1.gif) }
TD.rowpic	{ background-image: url(templates/templatename/images/cellpic2.jpg); background-repeat: repeat-y }
TD.catHead,TD.catSides,TD.catLeft,TD.catRight,TD.catBottom { background-image: url(templates/templatename/images/cellpic1.gif) }

-->
</style>
doing it this way will make your site cross-browser: the image-references are in your page so it works ok too for netscape 4.x, and all the rest is in the external stylesheet and will be cached by your visitors browser.

so: all the rest of the css code can live in the external stylesheet
Fenn
Registered User
Posts: 86
Joined: Wed May 15, 2002 3:42 pm
Location: Manchester
Contact:

Post by Fenn »

Bear wrote: Recommend that you keep any image references in overall_header.tpl instead of the .css file. Netscape has a problem with references in CSS - if the CSS file doesn't exist in the same directory as the presentation file. Or, you could drop a copy of the CSS file in the root folder of phpBB.


Netscape 6 doesn't do that. 4 does however. 4 is the biggest pile of poop I've ever had the misfortune to use, and I've long since given up testing HTML on it.
Image
User avatar
criley
Registered User
Posts: 6
Joined: Fri Oct 19, 2001 10:14 pm
Name: Christopher Riley

Netscape and images....

Post by criley »

You can indeed put images in your CSS file but you must put the "Full HTTP Path to that image. (I.E. http://www.myforums.com/templates/subSi ... er_new.gif) so that Netscape grabs it correctly.
Bear
Registered User
Posts: 2586
Joined: Mon Dec 31, 2001 7:50 pm
Location: 127.0.0.1
Contact:

Post by Bear »

The other option you can try is the <base /> tag. This tag defines a base URL for all the links in a page.
Bear
Got a thing for fashion? So do we at the Fashion Spot.
Let us give you the Royal Treatment at Les Tribunes Royales.
Moonbase
Registered User
Posts: 9
Joined: Wed May 29, 2002 1:14 am
Location: Augsburg, Germany
Contact:

Check CSS before removing from overall_header!

Post by Moonbase »

Hi ppl,

I was looking for a CSS bug the other day (default P and TD undefined), and found that what's included in oberall_header DIFFERS from what's in the style sheet!

If you make the change (which I would recommend since it speeds things up a little and makes everything a little more standards-compliant), BE SURE to manually verify whatever is in overall_header and simple_header against whatever turns out to be in your .css file... can save you some hours time...

Regards,
Matthias
Find C.O.L.T., all my MODs & preview images at www.phpbb.kicks-ass.net!
The site may be offline at times.
menyak
Registered User
Posts: 53
Joined: Mon Feb 04, 2002 9:55 pm

Post by menyak »

Bear, are you sure using the base-tag will work?

Because if you specify a base that's netscape-friendly, won't ie be rather unhappy about it? :?
Locked

Return to “2.0.x Discussion”