Рейтинг участников по СГ
'; + +$users = ''; +foreach ($tag as $k4 => $datas4) { + $users .= $k4 . "=" . $datas4 . "&"; +} +parse_str($users, $data[0]); + + require $_SERVER['DOCUMENT_ROOT'].'/snippets/get_account.php'; + require $_SERVER['DOCUMENT_ROOT'].'/snippets/get_dynamic_global_properties.php'; + require $_SERVER['DOCUMENT_ROOT'].'/snippets/get_config.php'; + $res = $command->execute($commandQuery); + + $mass = $res['result']; + + $res3 = $command3->execute($commandQuery3); + + $mass3 = $res3['result']; + + $config_res = $config_command->execute($config_commandQuery); + + $config_mass = $config_res['result']; + + $tvfs = (float)$mass3['total_vesting_fund_steem']; +$tvsh = (float)$mass3['total_vesting_shares']; + + $steem_per_vests = 1000000 * $tvfs / $tvsh; +$arr_sp = array(); +$arr_charge = array(); +$line2 = ''; +foreach ($mass as $datas) { +// Конвертация VESTS в STEEM POWER +$sp = $datas['vesting_shares'] / 1000000 * $steem_per_vests; +$delegated_sp = $datas['received_vesting_shares'] / 1000000 * $steem_per_vests; +$un_delegating_sp = $datas['delegated_vesting_shares'] / 1000000 * $steem_per_vests; +$delegating_sp = round($un_delegating_sp, 3); + $gp = round(($sp ?? $sp ?? "")-($delegating_sp ?? $delegating_sp ?? "")+($delegated_sp ?? $delegated_sp ?? ""), 3); + + $last_vote_time = $datas['last_vote_time']; +$last_vote_time2 = strtotime($last_vote_time); +$last_vote_time1 = date('d.m.Y г. H:i:s', $last_vote_time2); + + $current_time = strtotime($mass3['time']) * 1000; +$last_vote_seconds = strtotime($last_vote_time) * 1000; + +$fastpower = 10000/$config_mass['STEEMIT_VOTE_REGENERATION_SECONDS']; +$fast_power = round($fastpower, 5); + +$volume_not = ($datas['voting_power']+(($current_time-$last_vote_seconds)/1000)*$fast_power)/100; //расчет текущей Voting Power + $volume = round($volume_not, 2); // Округление до двух знаков после запятой + +if ($volume>=100) { +$charge = min($volume, 100); +} else { + $charge=$volume; + } + +$arr_sp[] = [ +'name' => $datas['name'], +'golos_power'=> $gp, +'vote_date' => $last_vote_time1, +'account_power' => $charge +]; + } + + echo "- ";
+$summ_sp = 0;
+usort ($arr_sp, 'gp_sort');
+$curator_power = '';
+foreach($arr_sp as $key_one_sp => $one_sp) {
+echo "
- ".$one_sp['name'].": ".$one_sp['golos_power']."
".$one_sp['vote_date'].", ".$one_sp['account_power']."%"."\r\n"." ";
+$summ_sp += $one_sp['golos_power'];
+
+if ($one_sp['name'] == 'belisey') {
+$curator_power .= $one_sp['account_power'];
+}
+
+}
+echo "
Общая сумма СГ:
+".round($summ_sp, 3)."
"; + +echo 'Составление формата списка участников для бота
+Внимание: запятую в последней строчке с author надо удалить - она лишняя.
'; + +// Рассчитываем минимальную батарейку, ниже которой будет 5%. +$curator_percent = ($curator_power/100)*$_SESSION['filde_percent']; // Рассчёт процента. +$CuratorVotePower = round($curator_power - $curator_percent, 2); // Рассчёт минимальной батарейки. + +echo ''; +foreach($arr_sp as $key_one_sp31 => $one_sp31) { + + if ($one_sp31['account_power'] < $CuratorVotePower) { + echo '{"author":"'.$one_sp31['name'].'", "vote":5, "delay":'.$timer.'},'.'
'; +} else if ($one_sp31['golos_power'] >=$_SESSION['power90']) { +echo '{"author":"'.$one_sp31['name'].'", "vote":90, "delay":'.$timer.'},'.'
'; +} else if ($one_sp31['golos_power'] >=$_SESSION['power85']) { +echo '{"author":"'.$one_sp31['name'].'", "vote":85, "delay":'.$timer.'},'.'
'; +} else if ($one_sp31['golos_power'] >=$_SESSION['power80']) { +echo '{"author":"'.$one_sp31['name'].'", "vote":80, "delay":'.$timer.'},'.'
'; +} else if ($one_sp31['golos_power'] >=$_SESSION['power75']) { +echo '{"author":"'.$one_sp31['name'].'", "vote":75, "delay":'.$timer.'},'.'
'; +} else if ($one_sp31['golos_power'] >=$_SESSION['power70']) { +echo '{"author":"'.$one_sp31['name'].'", "vote":70, "delay":'.$timer.'},'.'
'; +} else if ($one_sp31['golos_power'] >=$_SESSION['power65']) { +echo '{"author":"'.$one_sp31['name'].'", "vote":65, "delay":'.$timer.'},'.'
'; +} else if ($one_sp31['golos_power'] >=$_SESSION['power60']) { +echo '{"author":"'.$one_sp31['name'].'", "vote":60, "delay":'.$timer.'},'.'
'; +} else if ($one_sp31['golos_power'] >=$_SESSION['power55']) { + echo '{"author":"'.$one_sp31['name'].'", "vote":55, "delay":'.$timer.'},'.'
'; + } else if ($one_sp31['golos_power'] >=$_SESSION['power50']) { + echo '{"author":"'.$one_sp31['name'].'", "vote":50, "delay":'.$timer.'},'.'
'; + } else if ($one_sp31['golos_power'] >=$_SESSION['power45']) { + echo '{"author":"'.$one_sp31['name'].'", "vote":45, "delay":'.$timer.'},'.'
'; + } else if ($one_sp31['golos_power'] >=$_SESSION['power40']) { + echo '{"author":"'.$one_sp31['name'].'", "vote":40, "delay":'.$timer.'},'.'
'; + } else if ($one_sp31['golos_power'] >=$_SESSION['power35']) { + echo '{"author":"'.$one_sp31['name'].'", "vote":35, "delay":'.$timer.'},'.'
'; +} else if ($one_sp31['golos_power'] >=$_SESSION['power30']) { + echo '{"author":"'.$one_sp31['name'].'", "vote":30, "delay":'.$timer.'},'.'
'; + } else if ($one_sp31['golos_power'] >=$_SESSION['power25']) { + echo '{"author":"'.$one_sp31['name'].'", "vote":25, "delay":'.$timer.'},'.'
'; + } else if ($one_sp31['golos_power'] >=$_SESSION['power20']) { + echo '{"author":"'.$one_sp31['name'].'", "vote":20, "delay":'.$timer.'},'.'
'; + } else if ($one_sp31['golos_power'] >=$_SESSION['power15']) { + echo '{"author":"'.$one_sp31['name'].'", "vote":15, "delay":'.$timer.'},'.'
'; + } else if ($one_sp31['golos_power'] >=$_SESSION['power10']) { + echo '{"author":"'.$one_sp31['name'].'", "vote":10, "delay":'.$timer.'},'.'
'; + } else if ($one_sp31['golos_power'] >=$_SESSION['power5']) { + echo '{"author":"'.$one_sp31['name'].'", "vote":5, "delay":'.$timer.'},'.'
'; +} +} +echo ']
Лог файл сего момента
+Скачать файл ".date("d-m-Y-H-i-s").".txt
"; +} +} else { +require $_SERVER['DOCUMENT_ROOT'].'/login.php'; +} +?> + +