[問題] phpBB 2.0.18 不再使用 subSilver.css 檔!

phpBB 2 Style Support
討論的範圍包含版面排列、樣式、配置;外掛問題,請到相關版面依發問格式發表!
(發表文章請按照公告格式發表,違者砍文)

版主: 版主管理群

主題已鎖定
頭像
brentsu
星球公民
星球公民
文章: 232
註冊時間: 2004-08-23 09:08
來自: BNW 時尚資訊網
聯繫:

[問題] phpBB 2.0.18 不再使用 subSilver.css 檔!

文章 brentsu »

因為 phpBB 某些預設的字實在是太小了,我想要修改 subSilver 字形大小,哪知道 subSilver.css 不管怎麼改通通沒用,檢視網頁的原始檔,竟然都是原廠預設值。

深入追查才知道原來 overall_header.tpl 雖然寫了:

代碼: 選擇全部

<!-- link rel="stylesheet" href="templates/subSilver/{T_HEAD_STYLESHEET}" type="text/css" -->
卻改成註解,根本不鳥 subSilver.css 檔,又自己把 subSilver.css 內容直接寫在後面,難怪就算我把 subSilver.css 檔案刪掉,phpBB 還是正常的很....

1. 請問怎麼會這樣呢???

overall_header.tpl 裡面用到的 T_FONTSIZE2 追查後發現是定義在 include/page_header.php,然而...

代碼: 選擇全部

'T_FONTSIZE2' => $theme['fontsize2'],
fontsize2 就查不到定義在哪裡了....

2. 請問我應該把 overall_header.tpl 自行定義的內容刪掉,讓 subSilver.css 揮副作用?還是乾脆這樣改,原本程式碼:

代碼: 選擇全部

color: {T_FONTCOLOR3}; font-size: {T_FONTSIZE2}px; font-weight : bold;
直接寫死成這樣:

代碼: 選擇全部

color: {T_FONTCOLOR3}; font-size: 14px; font-weight : bold;
先謝謝囉~~
最後由 brentsu 於 2005-11-26 10:02 編輯,總共編輯了 1 次。
※架設伺服器主機:Mac mini 1.5GHz, 1GB RAM x 三部
※架設主機作業系統:Mac OS X Server 10.6.6 Snow Leopard
※我的上網方式:固定制 ADSL 16M/8M、6 IP
※安裝的伺服器:Apache + php 5 + MySQL 5
※我的 phpBB2 版本:phpBB 3.0.x UTF-8 版
※BNW會議室網址: http://www.bnw.com.tw/conference/
Kill
竹貓忠實會員
竹貓忠實會員
文章: 874
註冊時間: 2003-07-31 12:40
來自: CKD Studio
聯繫:

文章 Kill »

喜歡...就是淡淡ㄉ愛... ...則是深深ㄉ喜歡...
圖檔
提供phpBB代架服務以及外掛安裝

有付費服務的問題請移駕至CKD Studio發問 ╮( ̄▽ ̄)╭
頭像
brentsu
星球公民
星球公民
文章: 232
註冊時間: 2004-08-23 09:08
來自: BNW 時尚資訊網
聯繫:

文章 brentsu »

啊哈~~原來老早就有人發現了.....

[美化] phpBB subSilver CSS Options

其實就是恢復 subSilver.css 作用.... 怪了,原廠幹嘛這樣寫呢??搞不懂啊~~~是怕駭客入侵、安全性問題???
※架設伺服器主機:Mac mini 1.5GHz, 1GB RAM x 三部
※架設主機作業系統:Mac OS X Server 10.6.6 Snow Leopard
※我的上網方式:固定制 ADSL 16M/8M、6 IP
※安裝的伺服器:Apache + php 5 + MySQL 5
※我的 phpBB2 版本:phpBB 3.0.x UTF-8 版
※BNW會議室網址: http://www.bnw.com.tw/conference/
chrislin2k
星球公民
星球公民
文章: 40
註冊時間: 2005-02-22 08:24
來自: vancouver
聯繫:

文章 chrislin2k »

請問一下第七步驟要刪除的代碼在哪一個檔案?
templates/subSilver/simple_header.tpl裡面找不到\r

另外就是\r
templates/subSilver/admin/page_header.tpl
裡面要尋找和替換的語法我也無法找到
bestlong
星球普通子民
星球普通子民
文章: 3
註冊時間: 2006-03-13 10:46
聯繫:

文章 bestlong »

我在 2.0.19 研究了一下, 結果是被整合到風格管理(Styles Admin)->管理(Management)該範本(以subSilver來說明)的屬性(Theme Element)清單中

舉例來說
1. 就 CSS 表的設定來說, 屬性中有一個可以修改的地方:
英>> CSS Stylesheet: Filename for CSS stylesheet to use for this theme.
中>> CSS 樣式表: 這個風格的 CSS 樣式表檔名
不過因為在 overall_header.tpl 範本檔中, 已將相關的程式碼設為註解
<!-- link rel="stylesheet" href="templates/subSilver/{T_HEAD_STYLESHEET}" type="text/css" -->

所以需要使用的話就要去修改成
<link rel="stylesheet" href="templates/subSilver/{T_HEAD_STYLESHEET}" type="text/css" >
這樣才會套用 CSS 所設定的格式.

2. 再來是字型大小, 同樣在屬性中有三個可以做調整
英:
>> Font Size 1:
>> Font Size 2:
>> Font Size 3:
中:
>> 字型大小一
>> 字型大小二
>> 字型大小三
以上就是對應到範本中的三個標籤
{T_FONTSIZE1}
{T_FONTSIZE2}
{T_FONTSIZE3}
所以可以修改此三個屬性來影響字型的大小.
streen003
星球普通子民
星球普通子民
文章: 5
註冊時間: 2006-02-17 22:13
來自: 中国.北京
聯繫:

文章 streen003 »

在后台的控制面板中就能改过来.
-------------
如法:
控制面板->风格管理->管理选项 ->
风格 模板 编辑 删除

subSilver subSilver 编辑 删除
->编辑->字体大小一:将参数有10改成12.->储存设置.
再回到论坛首页看看.
字体变大了
<?php
echo ' *****请原谅我的无知***** ';
?>
streen003
星球普通子民
星球普通子民
文章: 5
註冊時間: 2006-02-17 22:13
來自: 中国.北京
聯繫:

文章 streen003 »

别改subSilver.css 里的代码,
改了也不管事,
------------------------------
subSilver.css 只是一个缓存性的文件,
原理是.从数据库读出那个STYLE的参数设置和overall_header.tpl文件里的.
<STYLE>xxxxxxx</STYLE>.相结合.生成的数据写入subSilver.css 中的.
其过程在控制面板对STYLE参数修改时,执行一次.
subSilver.css 文件存在,
使得程序不用反复地执行从数据库中读取STYLE参数.而是直接调用subSilver.css
一步到位.这样程序的效率将大大增强.(猜想的,不一定正确,以待考证)
------------------------------------
后来实践证明我说的这个原理是错误的. :cry:
真正的运行原理在下楼.
最後由 streen003 於 2006-03-29 21:35 編輯,總共編輯了 1 次。
<?php
echo ' *****请原谅我的无知***** ';
?>
streen003
星球普通子民
星球普通子民
文章: 5
註冊時間: 2006-02-17 22:13
來自: 中国.北京
聯繫:

文章 streen003 »

在调试中我发现,一些PHPBB2.0的模板的overall_header.tpl代码和默认的不一样.(PS:废话嘛,地球人都知道不一样,一样那还是默认风格呀).
不一样不是在于<BODY></BODY>间的地方不一样,而在于.
文件头大不一样.默认风格的overall_header.tpl其文件头有

代碼: 選擇全部

<style type="text/css">
<!--
/*
  The original subSilver Theme for phpBB version 2+
  Created by subBlue design
  http://www.subBlue.com

  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.
*/

/* General page style. The scroll bar colours only visible in IE5.5+ */
body { 
	background-color: {T_BODY_BGCOLOR};
	scrollbar-face-color: {T_TR_COLOR2};
	scrollbar-highlight-color: {T_TD_COLOR2};
	scrollbar-shadow-color: {T_TR_COLOR2};
	scrollbar-3dlight-color: {T_TR_COLOR3};
	scrollbar-arrow-color:  {T_BODY_LINK};
	scrollbar-track-color: {T_TR_COLOR1};
	scrollbar-darkshadow-color: {T_TH_COLOR1};
}

/* General font families for common tags */
font,th,td,p { font-family: {T_FONTFACE1} }
a:link,a:active,a:visited { color : {T_BODY_LINK}; }
a:hover		{ text-decoration: underline; color : {T_BODY_HLINK}; }
hr	{ height: 0px; border: solid {T_TR_COLOR3} 0px; border-top-width: 1px;}

/* This is the border line & background colour round the entire page */
.bodyline	{ background-color: {T_TD_COLOR2}; border: 1px {T_TH_COLOR1} solid; }

/* This is the outline round the main forum tables */
.forumline	{ background-color: {T_TD_COLOR2}; border: 2px {T_TH_COLOR2} solid; }

/* Main table cell colours and backgrounds */
td.row1	{ background-color: {T_TR_COLOR1}; }
td.row2	{ background-color: {T_TR_COLOR2}; }
td.row3	{ background-color: {T_TR_COLOR3}; }

/*
  This is for the table cell above the Topics, Post & Last posts on the index.php page
  By default this is the fading out gradiated silver background.
  However, you could replace this with a bitmap specific for each forum
*/
td.rowpic {
		background-color: {T_TD_COLOR2};
		background-image: url(templates/subSilver/images/{T_TH_CLASS3});
		background-repeat: repeat-y;
}

/* Header cells - the blue and silver gradient backgrounds */
th	{
	color: {T_FONTCOLOR3}; font-size: {T_FONTSIZE2}px; font-weight : bold; 
	background-color: {T_BODY_LINK}; height: 25px;
	background-image: url(templates/subSilver/images/{T_TH_CLASS2});
}

td.cat,td.catHead,td.catSides,td.catLeft,td.catRight,td.catBottom {
			background-image: url(templates/subSilver/images/{T_TH_CLASS1});
			background-color:{T_TR_COLOR3}; border: {T_TH_COLOR3}; border-style: solid; height: 28px;
}

/*
  Setting additional nice inner borders for the main table cells.
  The names indicate which sides the border will be on.
  Don't worry if you don't understand this, just ignore it :-)
*/
td.cat,td.catHead,td.catBottom {
	height: 29px;
	border-width: 0px 0px 0px 0px;
}
th.thHead,th.thSides,th.thTop,th.thLeft,th.thRight,th.thBottom,th.thCornerL,th.thCornerR {
	font-weight: bold; border: {T_TD_COLOR2}; border-style: solid; height: 28px;
}
td.row3Right,td.spaceRow {
	background-color: {T_TR_COLOR3}; border: {T_TH_COLOR3}; border-style: solid;
}

th.thHead,td.catHead { font-size: {T_FONTSIZE3}px; border-width: 1px 1px 0px 1px; }
th.thSides,td.catSides,td.spaceRow	 { border-width: 0px 1px 0px 1px; }
th.thRight,td.catRight,td.row3Right	 { border-width: 0px 1px 0px 0px; }
th.thLeft,td.catLeft	  { border-width: 0px 0px 0px 1px; }
th.thBottom,td.catBottom  { border-width: 0px 1px 1px 1px; }
th.thTop	 { border-width: 1px 0px 0px 0px; }
th.thCornerL { border-width: 1px 0px 0px 1px; }
th.thCornerR { border-width: 1px 1px 0px 0px; }

/* The largest text used in the index page title and toptic title etc. */
.maintitle	{
	font-weight: bold; font-size: 22px; font-family: "{T_FONTFACE2}",{T_FONTFACE1};
	text-decoration: none; line-height : 120%; color : {T_BODY_TEXT};
}

/* General text */
.gen { font-size : {T_FONTSIZE3}px; }
.genmed { font-size : {T_FONTSIZE2}px; }
.gensmall { font-size : {T_FONTSIZE1}px; }
.gen,.genmed,.gensmall { color : {T_BODY_TEXT}; }
a.gen,a.genmed,a.gensmall { color: {T_BODY_LINK}; text-decoration: none; }
a.gen:hover,a.genmed:hover,a.gensmall:hover	{ color: {T_BODY_HLINK}; text-decoration: underline; }

/* The register, login, search etc links at the top of the page */
.mainmenu		{ font-size : {T_FONTSIZE2}px; color : {T_BODY_TEXT} }
a.mainmenu		{ text-decoration: none; color : {T_BODY_LINK};  }
a.mainmenu:hover{ text-decoration: underline; color : {T_BODY_HLINK}; }

/* Forum category titles */
.cattitle		{ font-weight: bold; font-size: {T_FONTSIZE3}px ; letter-spacing: 1px; color : {T_BODY_LINK}}
a.cattitle		{ text-decoration: none; color : {T_BODY_LINK}; }
a.cattitle:hover{ text-decoration: underline; }

/* Forum title: Text and link to the forums used in: index.php */
.forumlink		{ font-weight: bold; font-size: {T_FONTSIZE3}px; color : {T_BODY_LINK}; }
a.forumlink 	{ text-decoration: none; color : {T_BODY_LINK}; }
a.forumlink:hover{ text-decoration: underline; color : {T_BODY_HLINK}; }

/* Used for the navigation text, (Page 1,2,3 etc) and the navigation bar when in a forum */
.nav			{ font-weight: bold; font-size: {T_FONTSIZE2}px; color : {T_BODY_TEXT};}
a.nav			{ text-decoration: none; color : {T_BODY_LINK}; }
a.nav:hover		{ text-decoration: underline; }

/* titles for the topics: could specify viewed link colour too */
.topictitle,h1,h2	{ font-weight: bold; font-size: {T_FONTSIZE2}px; color : {T_BODY_TEXT}; }
a.topictitle:link   { text-decoration: none; color : {T_BODY_LINK}; }
a.topictitle:visited { text-decoration: none; color : {T_BODY_VLINK}; }
a.topictitle:hover	{ text-decoration: underline; color : {T_BODY_HLINK}; }

/* Name of poster in viewmsg.php and viewtopic.php and other places */
.name			{ font-size : {T_FONTSIZE2}px; color : {T_BODY_TEXT};}

/* Location, number of posts, post date etc */
.postdetails		{ font-size : {T_FONTSIZE1}px; color : {T_BODY_TEXT}; }

/* The content of the posts (body of text) */
.postbody { font-size : {T_FONTSIZE3}px; line-height: 18px}
a.postlink:link	{ text-decoration: none; color : {T_BODY_LINK} }
a.postlink:visited { text-decoration: none; color : {T_BODY_VLINK}; }
a.postlink:hover { text-decoration: underline; color : {T_BODY_HLINK}}

/* Quote & Code blocks */
.code { 
	font-family: {T_FONTFACE3}; font-size: {T_FONTSIZE2}px; color: {T_FONTCOLOR2};
	background-color: {T_TD_COLOR1}; border: {T_TR_COLOR3}; border-style: solid;
	border-left-width: 1px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px
}

.quote {
	font-family: {T_FONTFACE1}; font-size: {T_FONTSIZE2}px; color: {T_FONTCOLOR1}; line-height: 125%;
	background-color: {T_TD_COLOR1}; border: {T_TR_COLOR3}; border-style: solid;
	border-left-width: 1px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px
}

/* Copyright and bottom info */
.copyright		{ font-size: {T_FONTSIZE1}px; font-family: {T_FONTFACE1}; color: {T_FONTCOLOR1}; letter-spacing: -1px;}
a.copyright		{ color: {T_FONTCOLOR1}; text-decoration: none;}
a.copyright:hover { color: {T_BODY_TEXT}; text-decoration: underline;}

/* Form elements */
input,textarea, select {
	color : {T_BODY_TEXT};
	font: normal {T_FONTSIZE2}px {T_FONTFACE1};
	border-color : {T_BODY_TEXT};
}

/* The text input fields background colour */
input.post, textarea.post, select {
	background-color : {T_TD_COLOR2};
}

input { text-indent : 2px; }

/* The buttons used for bbCode styling in message post */
input.button {
	background-color : {T_TR_COLOR1};
	color : {T_BODY_TEXT};
	font-size: {T_FONTSIZE2}px; font-family: {T_FONTFACE1};
}

/* The main submit button option */
input.mainoption {
	background-color : {T_TD_COLOR1};
	font-weight : bold;
}

/* None-bold submit button */
input.liteoption {
	background-color : {T_TD_COLOR1};
	font-weight : normal;
}

/* This is the line in the posting page which shows the rollover
  help line. This is actually a text box, but if set to be the same
  colour as the background no one will know ;)
*/
.helpline { background-color: {T_TR_COLOR2}; border-style: none; }

/* Import the fancy styles for IE only (NS4.x doesn't use the @import function) */
@import url("templates/subSilver/formIE.css"); 
-->
</style>
这些代码.而一些模板为了省事
则为

代碼: 選擇全部

<link rel="stylesheet" href="templates/MSSimplicity/{T_HEAD_STYLESHEET}" type="text/css">
这样,一来.我才发现,为什么在默认格改CSS文件没有用途.
默认的没有调用到.CSS文件.而一些模板的则调用到了那个CSS文件.
所以,调用到CSS文件的则改CSS文件上面的参数就达到自己的目的,改了.用控制面板改的则无济于事.
所以.改满足自己的要求.还应看overall_header.tpl代码的具体情况要么改从控制面板中改,要么从CSS文件中改.有的改CSS文件效果生效,有的改则不会生效.
那需要改的则是数据库中的STYLE参数.要从控制面板中改.
在一番的实践之后,原理才恍然大悟.
<?php
echo ' *****请原谅我的无知***** ';
?>
Artemas
竹貓忠實會員
竹貓忠實會員
文章: 489
註冊時間: 2003-08-23 03:18
來自: NorthBlue
聯繫:

文章 Artemas »

原本這篇我已經有修正與補充了
請參考 http://phpbb-tw.net/phpbb/viewtopic.php?p=246823#246823
:mrgreen:
最後由 Artemas 於 2006-10-05 22:19 編輯,總共編輯了 2 次。
圖檔
Os: Windows 2003
Constitute: IIS.6 + php4 + MySql 4 + ODBC + phpMyAdmin2.6.0 + phpBB 2.0.23
url: http://oops.cafepark.com
頭像
kkt
竹貓忠實會員
竹貓忠實會員
文章: 625
註冊時間: 2005-06-15 01:37
來自: H.K.
聯繫:

文章 kkt »

Artemas, 這篇給你鼓掌..對于剛接觸修改風格很有幫助.
以前我就是霧煞煞的, 拐了個大圈.

本站上都有討論串, 但比較零零碎碎的, 你的說明比較完整.


推薦本文給要修改版面風格的新手參考.




.
舊站台經已結朿了, 學生們可到遊戲站玩玩 Flash Game (不必註冊) 免費 Flash Game
在此學到很多架站知識, 永遠多謝:
心靈捕手老師, ~倉木麻衣~, 依夢兒 及 神川小羽各位大大相助
Artemas
竹貓忠實會員
竹貓忠實會員
文章: 489
註冊時間: 2003-08-23 03:18
來自: NorthBlue
聯繫:

文章 Artemas »

:mrgreen: :mrgreen: :mrgreen: 感謝抬愛
圖檔
Os: Windows 2003
Constitute: IIS.6 + php4 + MySql 4 + ODBC + phpMyAdmin2.6.0 + phpBB 2.0.23
url: http://oops.cafepark.com
主題已鎖定

回到「風格問題討論」