1 頁 (共 1 頁)

[討論]整個"風格"搬家的方法

發表於 : 2003-11-09 02:27
design
本來胸有成竹覺得可以成功@@"

\n這個方法可以讓主機只讀php和mysql

其他的檔案"全部外包" ;-)

約可以簡少60~80%流量轉嫁至別的空間.
並大幅減少主機httpd server的工作量 :-D

結果遇到一個困難點:

functions.php
找到\r

代碼: 選擇全部

$template_path = 'templates/';  
$template_name = $row['template_name'] ;

$template = new Template($phpbb_root_path . $template_path . $template_name);
我將 $phpbb_root_path 拿掉,並將改 $template_path = 'http://網址/templates/;

找到\r

代碼: 選擇全部

@include($phpbb_root_path . $template_path . $template_name . '/' . $template_name . '.cfg');
並將 $phpbb_root_path 拿掉.

本來拿到kimo和pchome測,如果網址錯則出現錯誤,網址對則出現空白,本來以為是pchome和kimo不支援tpl副檔.以為成功了,高興的想和大家分享.

後來

拿到isp及自己的主機測,卻出現

代碼: 選擇全部

Template->make_filename(): Error - file does not exist
的錯誤

index.php

代碼: 選擇全部

$template->set_filenames(array(
		'body' => 'index_body.tpl')
	);
cfg檔有讀到了,但就是上面這邊沒辦法解析到index.body.tpl

大家有辦法嗎?我研究一整晚還是槓龜阿..
如果能把整個風格都搬家,那真是phpbb玩家的福音~~

發表於 : 2003-11-09 02:38
嗯嗯!正!正在想要去改風格圖片控制的*.cfg @@||
把它全部挪移到Hinet!讚!

發表於 : 2003-11-09 02:43
design
@@" 改cfg @@"
改cfg不錯,但只能搬圖~

我不是改那邊,總之我整理完就會發表.

發表於 : 2003-11-09 02:44
ㄜ@@ 你的意思是連TPL都要搬過去?太猛了吧XD

發表於 : 2003-11-09 03:35
design
>"< 本來太興奮在phpbb.com看到類似好像可以改的方法
檔案讀的到卻發生,似乎只能在主機目錄內隨意搬動風格目錄而無法使用網址
變沒辦法找到tpl@@"
再試看看^^"希望能成功,大家就有福了^^"

發表於 : 2003-11-09 04:29
design
唉唉,先去睡,醒來再搞^^"

發表於 : 2003-11-09 06:05
大大...你要記得發表喔@@|| 能移的盡量移XD

發表於 : 2003-11-26 03:12
這位大大@@ 能講一下怎麼移圖片嗎?
因為我看有很多圖片好像都不只是由*.CFG來控制的耶

發表於 : 2003-11-27 02:40
design
文 寫:這位大大@@ 能講一下怎麼移圖片嗎?
因為我看有很多圖片好像都不只是由*.CFG來控制的耶
這個方法我說抱歉,TPL檔只能用在本機絕對路徑裡..我為了省頻寬花了將近兩天..還是沒辦法..

不過如果有2個以上的PHPBB,要共用風格..也就是改我說的地方..

functions.php
找到\r

代碼: 選擇全部

$template_path = 'templates/';  
$template_name = $row['template_name'] ;

$template = new Template($phpbb_root_path . $template_path . $template_name);
在\r

代碼: 選擇全部

'templates/';
前面加../

變成

代碼: 選擇全部

'../templates/';
然後把functions.php分別複製到不同的phpbb

接下來把templates搬到根目錄..

這樣所有的phpbb就共用風格了~

很抱歉沒研究出搬家方法,不過也提些我的經驗~

發表於 : 2003-11-27 03:35
謝謝^^y