內容簡介
使用 WordPress 3.1 - 舊版本將會造成問題。
WP4Labs 是一個小型外掛,提供一些功能來管理實驗室或科學團體。我設計了它用於兩個生物實驗室的網站。這不是我的第一個 WP 外掛,但這是我想要發布的第一個。我在不同伺服器上的四到五個 WP 安裝中進行了測試,看來都沒有問題。
它提供以下幾個部分:
- 一個進階用戶檔案,包含一些學術生涯日期的欄位
- 與此相關的是與 ariw.org 世界科學機構數據庫的連接,使查找特定機構及其 URL 更輕鬆
- 管理學術團體中用戶的可能性,例如校友、後博士、主持人等(可自定義)
- 本地化頭像功能,用戶仍可使用 Gravatar(也許有一天我要把它拿出來做成自己的外掛)
- 一個名為「project」的文章類型,可以將用戶連接到(科學)團體。只有具有 P.I. 狀態(作為組長)的用戶才能添加或刪除用戶。
建立了一個好的後端整合,我還提供了一些範例模板,讓您了解如何將提供的功能整合到您的主題中。
使用方法
為模板建立以下模板:
archive-biofoo_project.php - 這提供現有項目的概述。
single-biofoo_project.php - 查看單個項目。
您還可以編輯您的 author.php 以顯示額外資訊。
外掛包含一些有用的函數,可以構建這些模板:
= get_biofoo();
將從 get_userinfo(而不是 get_users!)或類似函數中取得索引,以獲取先進的個人資料。
例如:
$user->ba_degree or $user->ma_degree) or $user->phd_degree) : ?>
$user->ba_degree) : ?>B.A.ba_degree; ?>
$user->ma_degree) : ?>M.A.ma_degree; ?>
$user->phd_degree) : ?>Ph.D.phd_degree; ?>
echo_project_members(, , )
顯示(或返回)項目的所有成員:
INT 或 STRING
類型為 biofoo_project 的文章的 ID。您可以使用字符串「all」來獲取博客的所有使用者,而不是使用文章 ID。
STRING
預設值:盒子。
知道以下樣式:
-「longlist」-> 所有成員相互下方,帶有頭像和學術信息。
-「盒子」-> 盒子和
-「文字」-> 所有成員的名稱都在一行中,可以單擊鏈接。
-「返回」-> 不會顯示任何內容,但會返回該項目的成員數組。
BOOLEAN
預設值:true
如果設為 false,則不會顯示處於校友等被動用戶組中的用戶。
the_boss()
顯示項目的主要成員(P.I.s)。
function list_users_projects()
顯示用戶所屬的項目列表。
更新日誌
1.5
- 將文件和文件夾改名為 wp4labs。
外掛標籤
開發者團隊
原文外掛簡介
Use WordPress 3.1 – Older Versions will cause trouble
WP4Labs is a small Plugin, wich provides some functions to manange a lab or a scientific group. I designed it for the websites of two Biolabs. It’s far away from being my first WP-Plugin, but it’s the first one I want to publish. I tested it in four or five WP-installtions on dofferent servers, and it seems to all OK.
It provides the following parts:
– An advanced User Profile, containing some fields for academic career dates
– in connection with that a connection to the ariw.org-database of scientific institutions wordl wide, to make it easer finding a specific institution and it’s URL
– the possibility to manage users in academic groups, such as Alumni, Post-Doc, P.I. and such (customizable)
– a local-avatar function which maintains the possibility for users to use a Gravatar (maybe someday I should take this one out and make a own plugin out of it)
– a post-type called ‘project’, to which you can connect users to (scientific) groups. Only users with P.I.-status (for being leader of the group) can add or remove users.
A nice backend integration is built, I also ship some example templates to learn, how to integrate the provided functions to your theme.
Usage
For your template, build the following templates:
archive-biofoo_project.php – This gives an overview of the existing projects.
single-biofoo_project.php – Watch a single project.
Also you can edit your author.php to display the additional information.
The plugin contains some useful functions building these templates:
= get_biofoo();
Throw a from get_userinfo (not get_users!) or such into it, to get the advanced profile information.
Example:
ba_degree or $user->ma_degree) or $user->phd_degree) : ?>
ba_degree) : ?>B.A.ba_degree; ?>
ma_degree) : ?>M.A.ma_degree; ?>
phd_degree) : ?>Ph.D.phd_degree; ?>
echo_project_members(, , )
Displays (or returns) alls members of a project:
INT or STRING
The Id of a post with type biofoo_project. Instead of a post_id you may use the string keyword ‘all’ to get all users of the blog.
STRING
Default: boxes.
Knows the following styles:
* ‘longlist’ -> All members below each other with avatar and academic information.
* ‘boxes’ -> Boxes with
* ‘text’ -> The names of all members in a line as clickable links.
* ‘return’ -> Displays nothing but returns an array with the members of the project.
BOOLEAN
Default: true
If set to false, users, which are in passive user groups like alumni are not displayed.
the_boss()
Displays the leading members (P.I.s) of a project.
function list_users_projects()
Displays a list of projects, a user is member of.
Update Log
1.5
* Renamed file and folder to wp4labs.
