FluxBB 圖片上載模組

此模組會新增一個可快速將圖片上載並附加到文章的工具。圖片會上載至我們的網站,因此無需擔心磁碟空間或網頁伺服器設定。使用此模組的按鈕上載圖片後,系統會自動產生縮圖與原圖連結的 BBCode,並插入文章中。

安裝指引

  1. 開啟要編輯的檔案。
    header.php
  2. 找到第 98 行。它應該如下所示。
    </title>
  3. 在該行之後加入以下程式碼。
    <script type="text/javascript" src="//mod.postimage.org/fluxbb.js" charset="utf-8"></script>

安裝完成。你現在可以在你的網站上使用 Postimage。

fluxbb
  1. 開啟要編輯的檔案。
    header.php
  2. 找到第 86 行。它應該如下所示。
    </title>
  3. 在該行之後加入以下程式碼。
    <script type="text/javascript" src="//mod.postimage.org/fluxbb.js" charset="utf-8"></script>

安裝完成。你現在可以在你的網站上使用 Postimage。

fluxbb

選項

PostImage 網站外掛的所有版本均支援多種選項以自訂使用體驗。設定選項最簡單的方法是於外掛的地址中指定。各選項以連字號分隔,順序不限。舉例來說,若要將 phpBB 外掛切換為德文,並指定從網站上載的所有圖片都為家長指引安全(family-safe),你可以匯入外掛,將相應的那一行編輯為如下所示:

<script type="text/javascript" src="//mod.postimage.org/phpbb3-de-hotlink.js" charset="utf-8"></script>

若未指定某個群組中的選項,將使用該群組的預設值。目前支援以下選項:

預覽大小

  • thumb (預設) 使用小型預覽圖(尺寸最多為 180 × 180px)。
  • hotlink 使用大型預覽圖(寬度最多為 1280px 像素)。

語言

Postimage 按鈕文字提供多種支援語言。你可以使用以下任何語言名稱作為選項。

af
az
bs
ca
cy
da
de
et
en (預設)
es
es-mx
eu
fil
fr
ha
hr
ig
id
it
sw
ku
lv
lt
hu
ms
nl
no
uz
pl
pt
pt-br
ro
sk
sl
sr-me
fi
sv
tl
vi
tk
tr
yo
is
cs
el
bg
mk
mn
ru
sr
uk
kk
hy
he
ur
ar
fa
ps
ckb
ne
mr
hi
bn
pa
gu
ta
te
th
my
ka
am
zh-cn
zh-hk
ja
ko

進階

你可以在呼叫 PostImage 外掛之前,於你的 JavaScript 代碼中插入 postimage_customize() 函數,以自訂例如 PostImage 按鈕外觀等選項。該函數的形式如下:有三個物件會套用到圖示、連結及容器的樣式。你可以在其中設定任何所需的 CSS 屬性。

<script type="text/javascript" charset="utf-8">
function postimage_customize() {
	if (typeof postimage === "undefined") {
		return;
	}
	postimage.style = postimage.style || {};
	postimage.style.link = {"color": "#3a80ea", "vertical-align": "middle", "font-size": "1em"};
	postimage.style.icon = { "vertical-align": "middle", "margin-right": "0.5em", "margin-left": "0.5em"};
	postimage.style.container = {"margin-bottom": "0.5em", "margin-top": "0.5em"};
	/* Add more customizations here as needed */
}
</script>

如果你不想覆寫預設值,而只是想修改或新增特定樣式選項,你的函數大概應該如下:

<script type="text/javascript" charset="utf-8">
function postimage_customize() {
	if (typeof postimage === "undefined") {
		return;
	}
	postimage.style = postimage.style || {};
	/* Specify different options for the same style separately */
	postimage.style.link["color"] = "green";
	postimage.style.link["text-decoration"] = "none";

	postimage.style.icon["border"] = "1px solid black";
	postimage.style.container["padding"] = "2px";
	/* Add more customizations here as needed */
}
</script>

支援

如有任何問題或疑問,請聯絡我們。我們甚至可免費協助你把網站與我們整合!