当前位置: 首页>>代码示例>>PHP>>正文


PHP Dashboard::getAllAddonCountByStatusAndMember方法代码示例

本文整理汇总了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>
开发者ID:Avik-B,项目名称:musicbee-website,代码行数:31,代码来源:dashboard.overview.template.php

示例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"}');
         }
开发者ID:Avik-B,项目名称:musicbee-website,代码行数:31,代码来源:dashboard.tasks.php


注:本文中的Dashboard::getAllAddonCountByStatusAndMember方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。