內容簡介
這是一個外掛程式,可將「betterplace.org」平台上的慈善計畫整合至 WordPress 網站中。
外掛程式包括小工具,可顯示不同的計畫資料。
您可以選擇靜態模式,在顯示選定的小工具區域中的每個頁面上顯示一個 betterplace.org 計畫。
此外,小工具還具有動態模式,可在同一個小工具區域中在不同頁面上顯示不同的計畫。
提供多種顯示選項。可以僅顯示計畫和捐款畫面的連結,或者顯示屬於該計畫的所有或部分需求清單。
功能列表:
- 顯示 betterplace.org 計畫和計畫需求詳細資料
- 以多種方式輸出計畫和計畫需求進度
- 添加直接連結到 betterplace.org 上的計畫捐款畫面
- 易於使用小工具
- 使用一个小工具在不同頁面上顯示不同的計畫
- 進度顯示(百分比和進度條)
即將推出的功能:
- 短代碼支援
- 顯示 betterplace.org 圖片
- 多語言支援
Better Press API 文件:
am_bpProjectController 是顯示 betterplace.org 資料的主要物件。只需創建一個新實例,添加一個 betterplace.org ID 並使用 get 方法即可在自定義範本檔案中使用它。您可以顯示該計畫的需求,使用 nextProject() 方法切換需求,顯示多個計畫。
am_bpProjectController 的所有方法:
- addProject($id)
- getProjectTitle()
- getProjectSubtitle()
- getProjectDescription()
- getProjectImageUrl($size = "original")
- getProjectProgress()
- getProjectDonationUrl()
- addNeed($id)
- getNeedTitle()
- getNeedDescription()
- getNeedProgress()
- nextNeed()
- nextProject()
外掛標籤
開發者團隊
原文外掛簡介
This is a Plugin for integrationing a charity project of the platform betterplace.org to a WordPress site.
The plugin includes a Widget for displaying different project data.
You can choose the static mode to display one betterplace.org project on every page that displays the choosen widget area.
Also the widget comes along with a dynamic mode in order to display different projects on different pages in the same widget area.
There are sereval display options. It is posible to display just the project and a link to the donation screen or you can display a list of all or a number of needs that belong to the project.
Feature List
Display project and project need details of betterplace.org projects
Output project and project need progress in sereval ways
Add direct links to the donate screen of the project on betterplace.org
Easy to use widget
Use one widget to display different projects on different pages
Progress display (per cent & progress bar)
Upcoming Features
Shortcode support
Picture display of betterplace.org pictures
Multi language support
Arbitrary section
Better Press API Documentation
am_bpProjectController
The am_bpProjectController is the main Object for displaying betterplace.org data. To use it in custom template files just create a new instance, add a betterplace.org ID and use the get methods.
Example:
$bp_projectObject = new am_bpProjectController();
$bp_projectObject->addProject(7910);
echo $bp_projectObject->getProjectTitle();
This will display the Title of the project that has the ID 7910.
You are able to display project needs in the same way.
Example:
$bp_projectObject = new am_bpProjectController();
$bp_projectObject->addProject(7910);
echo $bp_projectObject->getNeedTitle();
This will display the title of the first need of the project that have the ID 7910.
In order to display more than one need you can use the nextProject() method to switch needs. It returns false when no more needs are left:
Example:
$bp_projectObject = new am_bpProjectController();
$bp_projectObject->addProject(7910);
echo ‘
‘.$bp_projectObject->getNeedTitle().’
‘;
do{
echo ‘
‘.$bp_projectObject->getNeedTitle().’
‘;
}while($bp_projectObject->nextProject());
This will display all titles of needs of the project that have the ID 7910.
In order to display more than one project use the method nextProject() in the same way. First you have to add all projects and after that you are able to switch projects:
Example:
$bp_projectObject = new am_bpProjectController();
$bp_projectObject->addProject(7910);
$bp_projectObject->addProject(932);
$bp_projectObject->addProject(1032);
do{
echo ‘
<
h3>’.$bp_projectObject->getProjectTitle().’
<
h3>’;
}while($bp_projectObject->nextProject());
This will display the titles of the Projects that got the ID 768, 932, 1032.
All methods of am_bpProjectController
addProject($id)
Add a betterplace.org project to the stack.
nextProject()
Moves the project pointer to the next project. Returns false if no more projects are on stack.
nextNeed()
Moves the need pointer of the pointed project to the next need. Returns false if no more projects are on stack.
firstProject()
Moves the pointer to the first project on the stack.
getProjectID()
Returns the betterplace.org ID of the project that is pointed.
getProjectTitle()
Returns the title of the pointed project.
getProjectDescription($maxnumber, $option)
Returns the description of the project that is pointed. It acepts two arguments to limitade the description. $option = 0 will limit count of letters that is specified in $maxnumber, $option = 1 limits $maxnumber words.
getProjectAmount($option, $format)
Returns money amounts of the project. If $option = 0 it returns the amount of money that is still needed to fulfil the project. $option = 1 returns the monay that is already donated and $option = 2 is the complete amount that has been requested. The argument $format specified the display of the amount. $format = 1 returns the amount in Euro formated as usual in Europe. If $format = 0 the method returns the complete amount unformated in Cents. $format = 2 returns only the amount of Euros without cent amounts. $format = 3 returns only the amount of Cents like if you would cut the full Euro amounts away.
getProjectProgress()
Returns the progress of the project in per cent.
getProjectLink($option)
Returns links belonging to the project that is pointed. $option = 0 will return the link to the project page. $option = 1 will the link that leds directly to the donation page of the project.
getProjectOpinions($option)
Returns the number of opinions about the project on betterplace.org. If the argument is set to $option = 0 you will get the total number of opinions. If $option is set to 1 you’ll get the number of positive opions, if it is set to 2 you’ll get the count of negative opinions.
getProjectDonors()
Returns the total number of donors which have already donated the pointed project.
getProjectNeedCount()
Returns the number of needs of the project that is pointed.
getNeedID()
Returns the ID of the need that is pointed.
getNeedDate($option)
If $option = 0 this method will return the date of creation of the need. If $option = 1 it will return the date of the last update of the need.
getNeedTitle()
This method returns the title of the pointed need.
getNeedDescription($maxnumber, $option)
Returns the description of the need that is pointed. It acepts two arguments to limitade the description. $option = 0 will limit count of letters that is specified in $maxnumber, $option = 1 limits $maxnumber words of the need.
getNeedProgress()
Returns the progress of the pointed need in per cent.
getNeedAmount($option, $format)
Returns money amounts of the need. If $option = 0 it returns the amount of money that is still needed to fulfil the need. $option = 1 returns the monay that is already donated and $option = 2 is the complete amount that has been requested. The argument $format specified the display of the amount. $format = 1 returns the amount in Euro formated as usual in Europe. If $format = 0 the method returns the complete amount unformated in Cents. $format = 2 returns only the amount of Euros without cent amounts. $format = 3 returns only the amount of Cents like if you would cut the full Euro amounts away.
iscompletedNeed()
This method returns true, if the need is already completed.
