[WordPress] 外掛分享: Tecnosenior FAQ Manager

前言介紹

  • 這款 WordPress 外掛「Tecnosenior FAQ Manager」是 2012-08-23 上架。
  • 目前尚無安裝啟用數,是個很新的外掛。如有要安裝使用,建議多測試確保功能沒問題!
  • 上一次更新是 2012-08-27,距離現在已有 4633 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 3.3 以上版本才可以安裝。
  • 尚未有人給過這款外掛評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

pedrokiefer |

外掛標籤

faq | ajax | faq manager | ask questions | search questions |

內容簡介

特點:

基於MVC的外掛
AJAX為基礎的管理介面
shortcode標籤的外觀:您可以創建自己的皮膚!
全文搜索,使用mysql的FULLTEXT支援
電子郵件通知
易於翻譯
I18N:英文和巴西葡萄牙語

開發在github

自定義
皮膚

要創建皮膚,只需在skins下添加新目錄以創建您的新皮膚。目錄中應該有一個帶有自定義標頭和兩個函數的PHP文件。這些函數由shortcode渲染器調用,不要更改函數的名稱!

皮膚標頭

文件標頭由以下字段組成,就像任何WordPress主題或外掛一樣 - 在文件的前8kb中的多行註釋中。

皮膚名稱
描述
版本號
作者
作者URI

函數

您的皮膚文件應該有以下函數:

function tsc_skin_get_headers()
function tsc_skin_render($group, $questions)

第一個函數負責添加所需的JavaScript或CSS到標頭。它必須返回一個具有“js”和“css”鍵的數組。下面的代碼包括jquery,jquery-ui和自定義javascript文件。它還包括所需的CSS文件。

function tsc_skin_get_headers()
{
    $headers = array(
        "js" => array(
            "jquery",
            "jquery-ui",
            array("name" => "tecnosenior-faq", "file" => plugin_dir_url(__FILE__) . "/tecnosenior-faq.js")
            ),
        "css" => array("tecnosenior-faq" => plugin_dir_url(__FILE__) . "/tecnosenior-faq.css")
        );

    return $headers;
}   

第二個函數接收兩個包含應該渲染的數據的對象。它必須返回一個字符串。

群組

具有以下字段的單個群組對象:
- Id
- GroupName
- SearchBox
- AskBox
- Status
- CreationDate

問題

帶有以下可用字段的問題對象數組:
- Id
- GroupId
- QuestionOrder
- Question
- WhoAsked
- Answer
- Status
- Type
- CreationDate

示例代碼,用於皮膚渲染器:

function tsc_skin_render($group, $questions)
{
    $html = "";
    if ($group->SearchBox) {
        $html .= render_search_box($group->Id);
    }

    $i = 0;
    $html .= "

\n";
    foreach ($questions as $q) {
        $html .= render_question($q, ($i % 2 == 1));
        $i++;
    }
    $html .= "
";

    if ($group->AskBox) {
        $html .= render_ask_box($group->Id);
    }

    return $html;
}

原文外掛簡介

Features:

MVC Based Plugin
AJAX Based Administration Interfaces
Skins for shortcode tag: you can create your own skin!
Full text search, using mysql FULLTEXT support
Email notifications
Easily Translatable
I18N: English and Brazilian Portuguese

Development happens on github
Customizations
Skins
To create a skin, just add a new directory under skins with your new skin. Inside the directory there should be a PHP
file with a custom header and two functions. Those functions are called by the shortcode renderer, don’t change the name of
the functions!
Skin Header
The file header is composed of the following fields, just like any WordPress theme or plugin – inside a multi line comment on
the first 8kb of the file.

Skin Name
Description
Version
Author
Author URI

Functions
The following functions should be on your skin file:
function tsc_skin_get_headers()
function tsc_skin_render($group, $questions)

The first function is responsible for adding to the headers any needed javascript or css. It must return an array with the keys js and css. The code below include jquery, jquery-ui and a custom javascript file. It also include the needed css file.
function tsc_skin_get_headers()
{
$headers = array(
"js" => array(
"jquery",
"jquery-ui",
array("name" => "tecnosenior-faq", "file" => plugin_dir_url(__FILE__) . "/tecnosenior-faq.js")
),
"css" => array("tecnosenior-faq" => plugin_dir_url(__FILE__) . "/tecnosenior-faq.css")
);

return $headers;
}

The second function receive two objects containing the data that should be rendered. It must return a string.
Group
A single group object with this fields:
– Id
– GroupName
– SearchBox
– AskBox
– Status
– CreationDate
Questions
An array of question objects with this fields available:
– Id
– GroupId
– QuestionOrder
– Question
– WhoAsked
– Answer
– Status
– Type
– CreationDate
Sample code, for skin renderer:
function tsc_skin_render($group, $questions)
{
$html = "";
if ($group->SearchBox) {
$html .= render_search_box($group->Id);
}

$i = 0;
$html .= "

\n";
foreach ($questions as $q) {
$html .= render_question($q, ($i % 2 == 1));
$i++;
}
$html .= "

";

if ($group->AskBox) {
$html .= render_ask_box($group->Id);
}

return $html;
}

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Tecnosenior FAQ Manager」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


最新版本

延伸相關外掛(你可能也想知道)

文章
Filter
Apply Filters
Mastodon