新增廣告區塊的方法

與 phpBB 3.0.x 相關主題。

版主: 版主管理群

回覆文章
頭像
心靈捕手
默默耕耘的老師
默默耕耘的老師
文章: 8510
註冊時間: 2004-04-30 01:54
來自: Taiwan

新增廣告區塊的方法

文章 心靈捕手 »

前言:
一般而言, 將廣告區塊放在頂端或底端, 才是最為方便且有效益的做法.
參考連結:
http://phpbb-tw.net/phpbb/viewtopic.php?f=176&t=50274

如果您是要 '在中間版面區塊的左邊或右邊放置廣告', 那麼您可以試試以下的做法.

利用框架頁 1
index.jpg
(2.56 KiB) 已下載 904 次
在您的網站根目錄底下, 編輯一個首頁 index.html 如下:

代碼: 選擇全部

<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>(自訂)</title>
</head>


<frameset cols="1*" rows="10%, 70%, 20%" border="0">
    <frame name="header" scrolling="no" src="header.html">
    <frameset cols="15%, 70%, 15%">
        <frame id="left" name="left" scrolling="auto" src="left.html">
        <frame id="phpbb" name="phpbb" scrolling="yes" src="phpBB3/index.php">
        <frame id="right" name="right" scrolling="auto" src="right.html">
    </frameset>
    <frame name="footer" scrolling="no" src="footer.html" marginheight="20">
    <noframes>
    <body>
    <p>若要正確檢視此頁面,您必須使用支援頁框的 Web 瀏覽器。</p>
    </body>
    </noframes>
</frameset>

</html>
P.S.
請注意相關路徑是否正確?
rows: 指定框架高度.
cols: 指定框架寬度.

在網站根目錄底下, 另外新增 footer.html, header.html, left.html, right.html, (如下).
footer.html

代碼: 選擇全部

<html>
<head>
<title>底端頁面</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>

<body bgcolor="#008000">
<center>
<!-- AdSense for Content -->
<script type="text/javascript"><!--
google_ad_client = "pub-1592746555586040";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
//2007-06-16: 休閒旅遊, 電腦, 運動, 兒童, 婦女
google_ad_channel = "6749034978+3554684606+8593628529+1469812233+8401531727";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "0000FF";
google_color_text = "000000";
google_color_url = "008000";
//-->
</script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!-- AdSense for Content -->
</center>
</body>
</html>
P.S.
請將廣告寫入 <body> 和 </body> 之間;
背景顏色 (bgcolor) 請酌予自訂.

header.html

代碼: 選擇全部

<html>
<head>
<title>頂端頁面</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>

<body bgcolor="#008000">
<center>
<!-- Search Google -->
<form action="http://www.google.com.tw/cse" id="cse-search-box" target="_blank">
  <div>
    <input type="hidden" name="cx" value="partner-pub-1592746555586040:o9aaxrxjrow" />
    <input type="hidden" name="ie" value="utf-8" />
    <input type="text" name="q" size="31" />
    <input type="submit" name="sa" value="&#x641c;&#x5c0b;" />
  </div>
</form>
<script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&lang=zh-Hant"></script>
<!-- Search Google -->
</center>
</body>
</html>
P.S.
請將廣告寫入 <body> 和 </body> 之間;
背景顏色 (bgcolor) 請酌予自訂.

left.html

代碼: 選擇全部

<html>
<head>
<title>左邊頁面</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>

<body bgcolor="#8000ff">
<a href="http://220.134.232.37/" target="_blank"><img src="http://220.134.232.37/logo/phpbb_03.gif" border="0" alt="歡迎光臨★★心靈捕手★★"></a>
</body>
</html>
P.S.
請將廣告寫入 <body> 和 </body> 之間;
背景顏色 (bgcolor) 請酌予自訂.

right.html

代碼: 選擇全部

<html>
<head>
<title>右邊頁面</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>

<body bgcolor="#8000ff">
<a href="http://phpbb-tw.net/phpbb/" target="_blank"><img src="http://220.134.232.37/logo/phpbb-tw_logo88a.gif" border="0" alt="亞洲區正體中文支援站"></a>
</body>
</html>
P.S.
請將廣告寫入 <body> 和 </body> 之間;
背景顏色 (bgcolor) 請酌予自訂.

完成後, 您的網站首頁 (如圖) 請設為
http://YOUR_SITE/index.html
20081122_120705.jpg
利用框架頁 2
index2.jpg
(1.97 KiB) 已下載 858 次
在您的網站根目錄底下, 編輯一個首頁 index.html 如下:

代碼: 選擇全部

<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>(自訂)</title>
</head>

<frameset cols="15%, 70%, 15%">
        <frame id="left" name="left" scrolling="auto" src="left.html">
        <frame id="phpbb" name="phpbb" scrolling="yes" src="phpBB3/index.php">
        <frame id="right" name="right" scrolling="auto" src="right.html">
    <noframes>
    <body>
    <p>若要正確檢視此頁面,您必須使用支援頁框的 Web 瀏覽器。</p>
    </body>
    </noframes>
</frameset>

</html>
請注意相關路徑是否正確?
cols: 指定框架寬度.
在網站根目錄底下, 另外新增 left.html 以及 right.html (同上).

完成後, 您的網站首頁 (如圖) 請設為
http://YOUR_SITE/index.html
20081122_121007.jpg
非利用框架, 僅使用表格, 修改風格樣板檔
proslver
開啟
styles/prosilver/template/overall_header.html

找到

代碼: 選擇全部

	<a name="start_here"></a>
	<div id="page-body">
取代成

代碼: 選擇全部

	<a name="start_here"></a>
	<div id="page-body">
<table style="width: 100%;"><tr>
	<td style="text-align: center; width: 15%; vertical-align: top; background-color: #8000ff;">
		<a href="http://220.134.232.37/" onclick="window.open(this.href);return false;"><img src="http://220.134.232.37/logo/phpbb_03.gif" border="0" alt="歡迎光臨★★心靈捕手★★"></a>
	</td>
	<td style="width: 70%;">
P.S. 將左邊區塊的廣告放置在 <td> 和 </td> 之間; 背景顏色 (background-color) 請酌予自訂.

開啟
styles/prosilver/template/overall_footer.html

找到

代碼: 選擇全部

	</div>

<div id="page-footer">
取代成

代碼: 選擇全部

	</td>
	<td style="text-align: center; width: 15%; vertical-align: top; background-color: #8000ff;">
		<a href="http://phpbb-tw.net/phpbb/" onclick="window.open(this.href);return false;"><img src="http://220.134.232.37/logo/phpbb-tw_logo88a.gif" border="0" alt="亞洲區正體中文支援站"></a>
	</td>
</tr></table>
	</div>

<div id="page-footer">
P.S.
1. 將右邊區塊的廣告放置在 <td> 和 </td> 之間; 背景顏色 (background-color) 請酌予自訂.
2. 此例中, 左邊, 中間, 右邊區塊的寬度分別為 15%, 70%, 15%; 若有需要, 則請自訂, 注意總和為 100% 即可.

修改, 儲存後, 清除論壇快取.

完成後, 您的論壇首頁 (如圖).
20081122_141317.jpg
subsilver2
開啟
styles/subsilver2/template/overall_header.html

找到

代碼: 選擇全部

<div id="wrapcentre">
取代成

代碼: 選擇全部

<div id="wrapcentre">
<table width="100%"><tr>
	<td width="15%" align="center" valign="top" bgcolor="#8000ff">
		<a href="http://220.134.232.37/" target="_blank"><img src="http://220.134.232.37/logo/phpbb_03.gif" border="0" alt="歡迎光臨★★心靈捕手★★"></a>
	</td>
	<td width="70%">
P.S. 將左邊區塊的廣告放置在 <td> 和 </td> 之間; 背景顏色 (bgcolor) 請酌予自訂.

開啟
styles/subsilver2/template/overall_footer.html

找到

代碼: 選擇全部

	<!-- IF not S_IS_BOT -->{RUN_CRON_TASK}<!-- ENDIF -->
</div>
取代成

代碼: 選擇全部

	<!-- IF not S_IS_BOT -->{RUN_CRON_TASK}<!-- ENDIF -->
	</td>
	<td width="15%" align="center" valign="top" bgcolor="#8000ff">
		<a href="http://phpbb-tw.net/phpbb/" target="_blank"><img src="http://220.134.232.37/logo/phpbb-tw_logo88a.gif" border="0" alt="亞洲區正體中文支援站"></a>
	</td>
</tr></table>
</div>
P.S.
1. 將右邊區塊的廣告放置在 <td> 和 </td> 之間; 背景顏色 (bgcolor) 請酌予自訂.
2. 此例中, 左邊, 中間, 右邊區塊的寬度分別為 15%, 70%, 15%; 若有需要, 則請自訂, 注意總和為 100% 即可.

修改, 儲存後, 清除論壇快取.

完成後, 您的論壇首頁 (如圖).
20081122_141141.jpg
最後由 心靈捕手 於 2008-11-26 22:32 編輯,總共編輯了 1 次。
理由: 更新 prosilver 風格的開新視窗之語法 -- onclick="window.open(this.href);return false;"
施比受有福,祝福您好運! ^_^
歡迎光臨★★心靈捕手★★ :: 討論區
https://wang5555.dnsfor.me/phpBB3/
回覆文章

回到「3.0」