本文整理汇总了PHP中Dashboard::getAllAddonCountByStatusAndMember方法的典型用法代码示例。如果您正苦于以下问题:PHP Dashboard::getAllAddonCountByStatusAndMember方法的具体用法?PHP Dashboard::getAllAddonCountByStatusAndMember怎么用?PHP Dashboard::getAllAddonCountByStatusAndMember使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dashboard
的用法示例。
在下文中一共展示了Dashboard::getAllAddonCountByStatusAndMember方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Dashboard
* for details visit: https://creativecommons.org/licenses/by-sa/3.0/
*
* @Contributors:
* Created by AvikB for noncommercial MusicBee project.
* Spelling mistakes and fixes from community members.
*
*/
$no_guests = true;
//kick off the guests
require_once $_SERVER['DOCUMENT_ROOT'] . '/functions.php';
include $link['root'] . 'classes/Dashboard.php';
$dashboard = new Dashboard();
$stat['total_download'] = $dashboard->getAddonDownloadCount($mb['user']['id']);
$stat['total_likes'] = $dashboard->getAddonLikeCount($mb['user']['id']);
$stat['total_addon_submitted'] = $dashboard->getAllAddonByMember($mb['user']['id']);
$stat['total_unapproved_addon'] = $dashboard->getAllAddonCountByStatusAndMember($mb['user']['id'], 0);
$stat['top_voted_addon'] = $dashboard->getTopVotedAddonsByAuthor($mb['user']['id'], 10);
$stat['top_downloaded_addon'] = $dashboard->getMostDownloadedAddonsByAuthor($mb['user']['id'], 10);
$stat['unapproved_addons'] = array_slice($dashboard->getAllUnApprovedAddons(), 0, 10);
?>
<div
class="main_content_wrapper col_1_2">
<div class="sub_content_wrapper">
<div class="box_content">
<span
class="show_info custom">
<h3><?php
echo $lang['dashboard_5'];
?>
</h3>
示例2: die
//If Add-on submission is turned of show error
if (!$setting['addonSubmissionOn']) {
die('{"status": "0", "data": "' . $lang['dashboard_err_20'] . '"}');
}
//If user already reached maximum submission limit/day show error
if (!canUserSubmitAnymoreToday()) {
die('{"status": "0", "data": "' . $lang['dashboard_err_22'] . '"}');
}
//if all user input is ok then move on
if (validateInput()) {
$dashboard = new Dashboard();
//check if an addon with similer name exists or not
if (!$dashboard->addonExists($_POST['title'], null)) {
//die, if the user alreay submitted more than X numbers of addon that needed aproval!
//This will prevent the floodgate
if ($dashboard->getAllAddonCountByStatusAndMember($mb['user']['id'], 0) > $setting['maxSubmitWithOutApproval']) {
die('{"status": "0", "data": "' . $lang['dashboard_err_10'] . '"}');
}
$readme = isset($_POST['readme']) ? $_POST['readme'] : "";
//load parsedown for markdown to html converter
$ParsedownExtra = new ParsedownExtra();
$ParsedownExtra->setBreaksEnabled(true);
$readme_raw = $ParsedownExtra->text($readme);
//load and use html purifier for the readme notes.
$readme_html = Format::htmlSafeOutput($readme_raw);
//purify the readme note html
//Phew.... all validations complete, now SUBMIT THE ADDON!
if ($dashboard->submit($readme_html, "submit")) {
//@todo: Add an item to mail queue, and send it to admin
exit('{"status": "1", "data": "' . $lang['dashboard_msg_11'] . '", "callback_function": "submitted"}');
}