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


PHP Stats::usersharecount方法代码示例

本文整理汇总了PHP中Stats::usersharecount方法的典型用法代码示例。如果您正苦于以下问题:PHP Stats::usersharecount方法的具体用法?PHP Stats::usersharecount怎么用?PHP Stats::usersharecount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Stats的用法示例。


在下文中一共展示了Stats::usersharecount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: User

$apikey = mysql_real_escape_string($_GET["api_key"]);
$user = new User();
$userid = 0;
$resultU = mysql_query_cache("SELECT u.id, b.balance, b.paid, u.username from webUsers u, accountBalance b WHERE u.id = b.userId AND u.api_key = '{$apikey}'", 300);
if (count($resultU) > 0) {
    $userobj = $resultU[0];
    $username = $userobj->username;
    $userid = $userobj->id;
    $user->confirmed_rewards = $userobj->balance;
    $user->hashrate = $stats->userhashrate($username);
    $user->estimated_rewards = 0;
    $user->payout_history = $userobj->paid;
    if (is_numeric($settings->getsetting("sitepercent"))) {
        $sitePercent = $settings->getsetting("sitepercent");
    }
    $totalUserShares = $stats->usersharecount($userid);
    //Get current round share information, estimated total earnings
    $totalOverallShares = $stats->currentshares();
    //Prevent divide by zero
    if ($totalUserShares > 0 && $totalOverallShares > 0) {
        //Get site percentage
        $sitePercent = 0;
        if (is_numeric($settings->getsetting('sitepercent'))) {
            $sitePercent = $settings->getsetting('sitepercent') / 100;
        }
        if ($totalOverallShares > $bitcoinDifficulty) {
            $estimatedTotalEarnings = $totalUserShares / $totalOverallShares;
        } else {
            $estimatedTotalEarnings = $totalUserShares / $bitcoinDifficulty;
        }
        $estimatedTotalEarnings *= $bonusCoins * (1 - $sitePercent);
开发者ID:neofutur,项目名称:simplecoin,代码行数:31,代码来源:api.php


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