大家好!
一個經常被問到的問題是, 如何在 phpBB3 中新增廣告. 簡短的答案都是非常簡單的: 開啟您最愛的文字編輯器, 以及打開正確的 .html 樣板檔案. 但是, 究竟是該打開哪個樣板檔案呢? 在此, 將做一個較詳細的回答...
首先, 開啟您最愛的文字編輯器, 然後...
在頁頂新增廣告
假如您要在頁頂新增廣告, 那麼打開 styles/prosilver/template/overall_header.html
以及增加您的代碼在這個檔案的尾端.
在頁尾新增廣告
假如您要在頁尾新增廣告, 那麼打開 styles/prosilver/template/overall_footer.html
#
#-----[ FIND ]-----
#
代碼: 選擇全部
<!-- IF U_ACP --><br /><strong><a href="{U_ACP}">{L_ACP}</a></strong><!-- ENDIF -->
重要的備註: 在您放置廣告代碼在頁頂或頁尾之前, 請核對您的廣告提供者的要求. 有些提供者 (像是 Google AdSense) 只允許廣告放在有真實內容的頁面, 像是瀏覽文章或版面者.
在瀏覽版面的頁面新增廣告
假如您要在瀏覽 (所有主題列表) 版面的頁面新增廣告, 那麼打開 styles/prosilver/template/viewforum_body.html
以及增加您的代碼在這行之後:
#
#-----[ FIND ]-----
#
代碼: 選擇全部
<!-- INCLUDE overall_header.html -->
假如您要在主題的第一篇文章之前或之後新增廣告, 那麼打開 styles/prosilver/template/viewtopic_body.html
若要將廣告新增在第一篇文章之前, 則找到此行以及增加您的代碼在這行之後.
#
#-----[ FIND ]-----
#
代碼: 選擇全部
<!-- BEGIN postrow -->
#
#-----[ FIND ]-----
#
代碼: 選擇全部
<!-- END postrow -->
代碼: 選擇全部
<!-- IF postrow.S_FIRST_ROW -->
<div class="post bg2">
<div class="inner"><span class="corners-top"><span></span></span>
<div class="postbody">
<h3>{postrow.POST_SUBJECT}</h3>
<p class="author"><strong>Sponsor</strong></p>
<div class="content" style="text-align: center;">
Insert your ad code here
</div>
</div>
<dl class="postprofile" id="profile0000">
<dt>
<strong>Sponsor</strong>
</dt>
<dd> </dd>
</dl>
<div class="back2top"><a href="#wrap" class="top" title="{L_BACK_TO_TOP}">{L_BACK_TO_TOP}</a></div>
<span class="corners-bottom"><span></span></span></div>
</div>
<hr class="divider" />
<!-- ENDIF -->
調和廣告與 proSilver 風格
假如您想要調和廣告與 proSilver 風格, 讓它有一個好的藍色背景和圓角圖片 (注意: 如果您是遵循上頭的介紹, 在主題的第一篇文章之前或之後新增廣告, 那麼不必做此調整), 然後使用底下的代碼, 在任何一個您要新增廣告的樣板檔案中:
代碼: 選擇全部
<div class="panel">
<div class="inner"><span class="corners-top"><span></span></span>
<div class="content">
<p style="text-align: center;">
Insert your ad code here
</p>
</div>
<span class="corners-bottom"><span></span></span></div>
</div>
假如您有任何的建議或發現這篇文章的 bugs, 那麼請傳送給我一個私訊.
與您分享!
--
資料來源:
http://www.phpbb.com/kb/article/adverti ... in-phpbb3/