
內容簡介
此 WordPress 外掛為 Spectacu.la Discussion。你是否發現你的佈景主題不支援分層評論?想要在你的網站上實現像 P2 那樣的即時評論功能嗎?此外掛可以取代你佈景主題中的評論代碼,使用全 Ajax 式的評論引擎。
此插件使用快取記憶表在數據庫中進行快速快取(不用擔心什麼煩人的權限設置),並可調整輪詢時間以適應各種服務器性能。
此外掛也適用於開發人員,這意味著你可以輕鬆地為你的佈景主題添加樣式,以便用戶實現你精心設計的外觀。默認情況下,有兩種樣式可用於大多數情況。詳細說明請見下文。
安裝後,此外掛將用其自己的全 Ajax 式評論模板替換你的主題評論模板。這允許提交和更新評論,不需刷新頁面,讓你的訪問者更像是在使用聊天室而不是傳統的評論系統。你還可以捲起回覆,使用設置頁面可以在任何深度觸發,或者使用該插件的管理員頁面中提供的其他或不使用樣式表,切換評論的即時更新和改變即時更新的刷新區間。
自版本 2 起,你可以通過將樣式複製到該插件的樣式文件夾中並在該表單頂部添加類似於“/* comment style: Stylesheet name */”的註釋,或將評論樣式表添加到你的主題或子主題中,以輕鬆添加新的樣式表。添加後,它們將顯示在管理員頁面上的下拉菜單中。
當然,此外掛也適用於多站點。
此外,也為開發人員提供了一些可用於攔截 JavaScript、傳遞給 JavaScript 的參數以及 CSS 文件位置的過濾器。
有幾個可用於攔截 JavaScript、傳遞給 JavaScript 的參數和 CSS 文件位置的過濾器:
1. spec_comment_css:將樣式表的 URL 傳遞給你的函數以替換為你自己的文件。
2. spec_comment_js:將操縱卷起和其他元素的 jQuery 文件的 URL 傳遞給你的函數。
3. spec_comment_local_js:將本地化字符串數組傳遞給 jQuery 代碼。
要替換 CSS 文件,你可以像以下這樣在 functions.php 中添加代碼,該代碼將指向當前佈景主題文件夾中的 comments.css 檔案,這將覆蓋用戶在管理員頁面上做出的任何選擇。
注意:我們已盡力使此外掛與各種佈景主題兼容,但我們無法涵蓋所有情況,因此某些主題可能需要你先對外掛或主題進行一些更改。最可能引起問題的原因是主題中的某些 CSS 與評論中的 CSS 衝突。還有其他各種可能引起問題的地方,例如如果主題不使用 comments_template(); 模板標籤來調用 comments.php,或者如果你的主題以非傳統的方式處理評論,例如將評論置於側欄或以其他方式調用,都有可能出現問題。
外掛標籤
開發者團隊
📦 歷史版本下載
原文外掛簡介
Ever found your theme doesn’t support threaded comments? Would you like it to
be able to have P2 style live commenting on your site? Spectacu.la Discussion
is a plugin that replaces the commenting code in your theme with a fully Ajaxed
comments engine.
The plugin uses memory tables for fast caching within the database (no pesky
permission setting for you to worry about here) and adjustible polling times to
suit a wide range of server performance.
The plugin is also developer friendly, meaning that you can easily add styles to
your theme so that should a user implement the plugin your meticulous design can
be carried through. By default there are two styles that should work in most
cases. Read below for further instructions.
Once installed this plug-in will replace your theme’s comments template with its
own fully Ajax comment template. This allows both submission and update of
comments without a page refres letting your visitors use it more as a chat room
than the more traditional comment system. You can also roll up replied which can
be told to trigger at any depth you feel is best using the settings page. Also
available on the plug-ins admin page is the option to use another or no
stylesheet, toggle the live updating of comments and change the refresh period
for live update.
As of version 2 you can now easily add new stylesheets to the available list by
either copying them into the plug-in’s style folder with a comment at the top of
the sheet that looks like this /* comment style: Stylesheet name */ or adding a
commenting.css to your theme or child theme. Once added they will then be listed
in the dropdown menu that shows on the admin page.
The plugin is also, of course, Multisites compatible.
=The filters=
There are a few filters available for developers to intercept the javascript,
paramerers passed to the javascript and the CSS file location
spec_comment_css
Passes the URL of the stylesheet through to your function to replace
with your own file.
spec_comment_js
Passes the URL to the jQuery file that controls the roll up and a few
other elements.
spec_comment_local_js
Passes in an array of localisation strings that are passed to the
jQuery code.
To replace the CSS file you could add something like the following to your
functions.php that would point to a comments.css file in the folder of your
current theme. This will then override any choice made by the user on the admin
page.
Warning
Every effort has been made to make this work with as wide a variety of themes as
possible but we can’t cover every eventuality so some themes out there will
cause problems with this plugin without you doing something to either the
plug-in or the theme first. The most likely cause of problems is that some of
the CSS in the theme conflicts with the CSS in the comments. There are various
other areas where problems could arise, such as if the theme doesn’t call the
comments.php using the comments_template(); template tag or if your theme
deals with comments in an unusual way, such as placing them in a sidebar or
calling them in using Ajax that conflicts with our own. A missing or unusual
DOCTYPE could cause problems too, in fact there are lots of things that could
cause strangeness. However with most of the themes I’ve tested this with it has
worked without issue straight out of the gate and even if it doesn’t look right
you need only disable the plug-in to go back to how things were, so nothing’s
lost.
