Merge branch 'next' into issue-543

This commit is contained in:
Sebastian Grewe 2013-09-06 09:40:28 +02:00
commit 5b353ab759
52 changed files with 594 additions and 307 deletions

View File

@ -96,3 +96,24 @@ Small Time Miners are running various stratum only pools for different coins.
| -------- | ---- | ------------: | ------------------: | ----- |
| http://www.litecoinfor.me | Litecoin | 0 | 0 | |
| http://www.fastcoinfor.me | Fastcoin | 0.830 MHash | 2 | |
### ZC
| Pool URL | Coin | Avg. Hashrate | Avg. Active Workers | Notes |
| -------- | ---- | ------------: | ------------------: | ----- |
| https://ltc.hashfaster.com | LTC | 70 MHash | 80 | Custom Template |
### nutnut
| Pool URL | Coin | Avg. Hashrate | Avg. Active Workers | Notes |
| -------- | ---- | ------------: | ------------------: | ----- |
| http://ftc.nut2pools.com | Feathercoin | 45-50Mhs | 25 workers | New style, PPLNS |
| http://wdc.nut2pools.com | Worldcoin | 3.5 Mhs | 3 workers | New style, PPLNS |
| http://pxc.nut2pools.com | Phenixcoin | 0 | 0 | New style | PPLNS |
### Dids
| Pool URL | Coin | Avg. Hashrate | Avg. Active Workers | Notes |
| -------- | ---- | ------------: | ------------------: | ----- |
| http://poolmine.it | Litecoin | 0.23 MHash | 5 | PPLNS, Custom Template |

View File

@ -58,7 +58,7 @@ if (empty($aTransactions['transactions'])) {
$aData['confirmations'] . "\t\t" .
$aData['difficulty'] . "\t" .
strftime("%Y-%m-%d %H:%M:%S", $aData['time']));
if ( ! empty($aBlockInfo['flags']) && $aBlockInfo['flags'] == 'proof-of-stake' ) {
if ( ! empty($aBlockInfo['flags']) && preg_match('/proof-of-stake/', $aBlockInfo['flags']) ) {
$log->logInfo("Block above with height " . $aData['height'] . " not added to database, proof-of-stake block!");
continue;
}

View File

@ -58,7 +58,7 @@ if (!empty($aNotifications)) {
$aData = json_decode($aNotification['data'], true);
$aWorker = $worker->getWorker($aData['id']);
$log->logInfo(" " . $aWorker['username'] . " ...");
if ($aWorker['active'] == 1) {
if ($aWorker['hashrate'] > 0) {
if ($notification->setInactive($aNotification['id'])) {
$log->logInfo(" updated #" . $aNotification['id'] . " for " . $aWorker['username'] . " as inactive\n");
} else {

View File

@ -73,6 +73,8 @@ foreach ($aAllBlocks as $iIndex => $aBlock) {
$monitoring->setStatus($cron_name . "_status", "okerror", 1);
exit(1);
}
$log->logInfo('Adjusting round target to PPLNS target ' . $pplns_target);
$iRoundShares = $pplns_target;
} else {
$log->logDebug("Not able to match PPLNS target of $pplns_target with $iRoundShares");
// We need to fill up with archived shares
@ -124,26 +126,26 @@ foreach ($aAllBlocks as $iIndex => $aBlock) {
// Loop through all accounts that have found shares for this round
foreach ($aAccountShares as $key => $aData) {
// Payout based on PPLNS target shares, proportional payout for all users
$aData['percentage'] = number_format(round(( 100 / $iRoundShares) * $aData['valid'], 8), 8);
$aData['payout'] = number_format(round(( $aData['percentage'] / 100 ) * $dReward, 8), 8);
$aData['percentage'] = round(( 100 / $iRoundShares) * $aData['valid'], 8);
$aData['payout'] = round(( $aData['percentage'] / 100 ) * $dReward, 8);
// Defaults
$aData['fee' ] = 0;
$aData['donation'] = 0;
if ($config['fees'] > 0 && $aData['no_fees'] == 0)
$aData['fee'] = number_format(round($config['fees'] / 100 * $aData['payout'], 8), 8);
$aData['fee'] = round($config['fees'] / 100 * $aData['payout'], 8);
// Calculate donation amount, fees not included
$aData['donation'] = number_format(round($user->getDonatePercent($user->getUserId($aData['username'])) / 100 * ( $aData['payout'] - $aData['fee']), 8), 8);
$aData['donation'] = round($user->getDonatePercent($user->getUserId($aData['username'])) / 100 * ( $aData['payout'] - $aData['fee']), 8);
// Verbose output of this users calculations
$log->logInfo($aData['id'] . "\t" .
$aData['username'] . "\t" .
$aData['valid'] . "\t" .
$aData['invalid'] . "\t" .
$aData['percentage'] . "\t" .
$aData['payout'] . "\t" .
$aData['donation'] . "\t" .
$aData['fee']);
number_format($aData['percentage'], 8) . "\t" .
number_format($aData['payout'], 8) . "\t" .
number_format($aData['donation'], 8) . "\t" .
number_format($aData['fee'], 8));
// Add full round share statistics, not just PPLNS
foreach ($aRoundAccountShares as $key => $aRoundData) {

View File

@ -44,13 +44,13 @@ if ( $bitcoin->can_connect() === true ){
// Value per share calculation
if ($config['reward_type'] != 'block') {
$pps_value = number_format(round($config['reward'] / (pow(2,32) * $dDifficulty) * pow(2, $config['difficulty']), 12) ,12);
$pps_value = round($config['reward'] / (pow(2,32) * $dDifficulty) * pow(2, $config['difficulty']), 12);
} else {
// Try to find the last block value and use that for future payouts, revert to fixed reward if none found
if ($aLastBlock = $block->getLast()) {
$pps_value = number_format(round($aLastBlock['amount'] / (pow(2,32) * $dDifficulty) * pow(2, $config['difficulty']), 12) ,12);
$pps_value = round($aLastBlock['amount'] / (pow(2,32) * $dDifficulty) * pow(2, $config['difficulty']), 12);
} else {
$pps_value = number_format(round($config['reward'] / (pow(2,32) * $dDifficulty) * pow(2, $config['difficulty']), 12) ,12);
$pps_value = round($config['reward'] / (pow(2,32) * $dDifficulty) * pow(2, $config['difficulty']), 12);
}
}
@ -65,7 +65,7 @@ $log->logInfo("ID\tUsername\tInvalid\tValid\t\tPPS Value\t\tPayout\t\tDonation\t
foreach ($aAccountShares as $aData) {
// Take our valid shares and multiply by per share value
$aData['payout'] = number_format(round($aData['valid'] * $pps_value, 8), 8);
$aData['payout'] = round($aData['valid'] * $pps_value, 8);
// Defaults
$aData['fee' ] = 0;
@ -73,18 +73,18 @@ foreach ($aAccountShares as $aData) {
// Calculate block fees
if ($config['fees'] > 0 && $aData['no_fees'] == 0)
$aData['fee'] = number_format(round($config['fees'] / 100 * $aData['payout'], 8), 8);
$aData['fee'] = round($config['fees'] / 100 * $aData['payout'], 8);
// Calculate donation amount
$aData['donation'] = number_format(round($user->getDonatePercent($user->getUserId($aData['username'])) / 100 * ( $aData['payout'] - $aData['fee']), 8), 8);
$aData['donation'] = round($user->getDonatePercent($user->getUserId($aData['username'])) / 100 * ( $aData['payout'] - $aData['fee']), 8);
$log->logInfo($aData['id'] . "\t" .
$aData['username'] . "\t" .
$aData['invalid'] . "\t" .
$aData['valid'] . "\t*\t" .
$pps_value . "\t=\t" .
$aData['payout'] . "\t" .
$aData['donation'] . "\t" .
$aData['fee']);
number_format($pps_value, 12) . "\t=\t" .
number_format($aData['payout'], 8) . "\t" .
number_format($aData['donation'], 8) . "\t" .
number_format($aData['fee']), 8);
// Add new credit transaction
if (!$transaction->addTransaction($aData['id'], $aData['payout'], 'Credit_PPS'))

View File

@ -60,26 +60,26 @@ foreach ($aAllBlocks as $iIndex => $aBlock) {
// Loop through all accounts that have found shares for this round
foreach ($aAccountShares as $key => $aData) {
// Payout based on shares, PPS system
$aData['percentage'] = number_format(round(( 100 / $iRoundShares ) * $aData['valid'], 8), 8);
$aData['payout'] = number_format(round(( $aData['percentage'] / 100 ) * $dReward, 8), 8);
$aData['percentage'] = round(( 100 / $iRoundShares ) * $aData['valid'], 8);
$aData['payout'] = round(( $aData['percentage'] / 100 ) * $dReward, 8);
// Defaults
$aData['fee' ] = 0;
$aData['donation'] = 0;
if ($config['fees'] > 0 && $aData['no_fees'] == 0)
$aData['fee'] = number_format(round($config['fees'] / 100 * $aData['payout'], 8), 8);
$aData['fee'] = round($config['fees'] / 100 * $aData['payout'], 8);
// Calculate donation amount, fees not included
$aData['donation'] = number_format(round($user->getDonatePercent($user->getUserId($aData['username'])) / 100 * ( $aData['payout'] - $aData['fee']), 8), 8);
$aData['donation'] = round($user->getDonatePercent($user->getUserId($aData['username'])) / 100 * ( $aData['payout'] - $aData['fee']), 8);
// Verbose output of this users calculations
$log->logInfo($aData['id'] . "\t" .
$aData['username'] . "\t" .
$aData['valid'] . "\t" .
$aData['invalid'] . "\t" .
$aData['percentage'] . "\t" .
$aData['payout'] . "\t" .
$aData['donation'] . "\t" .
$aData['fee']);
number_format($aData['percentage'], 8) . "\t" .
number_format($aData['payout'], 8) . "\t" .
number_format($aData['donation'], 8) . "\t" .
number_format($aData['fee']), 8);
// Update user share statistics
if (!$statistics->updateShareStatistics($aData, $aBlock['id']))

View File

@ -1,34 +1,40 @@
<?php
// We need this one in here to properly set our theme
require_once(INCLUDE_DIR . '/lib/Mobile_Detect.php');
// Detect device
if ($detect->isMobile() && $config['website']['mobile']) {
// Set to mobile theme
$config['website']['mobile_theme'] ? $theme = $config['website']['mobile_theme'] : $theme = 'mobile';
} else {
// Use configured theme, fallback to default theme
$config['website']['theme'] ? $theme = $config['website']['theme'] : $theme = 'mmcFE';
}
define('THEME', $theme);
// Default classes
require_once(CLASS_DIR . '/debug.class.php');
require_once(CLASS_DIR . '/bitcoin.class.php');
require_once(CLASS_DIR . '/statscache.class.php');
require_once(CLASS_DIR . '/bitcoinwrapper.class.php');
require_once(INCLUDE_DIR . '/lib/KLogger.php');
require_once(INCLUDE_DIR . '/database.inc.php');
require_once(INCLUDE_DIR . '/smarty.inc.php');
// Load classes that need the above as dependencies
// We need to load these two first
require_once(CLASS_DIR . '/base.class.php');
require_once(CLASS_DIR . '/setting.class.php');
// We need this one in here to properly set our theme
require_once(INCLUDE_DIR . '/lib/Mobile_Detect.php');
// Detect device
if ($detect->isMobile() && $setting->getValue('website_mobile_theme')) {
// Set to mobile theme
$setting->getValue('website_mobile_theme') ? $theme = $setting->getValue('website_mobile_theme') : $theme = 'mobile';
} else {
// Use configured theme, fallback to default theme
$setting->getValue('website_theme') ? $theme = $setting->getValue('website_theme') : $theme = 'mmcFE';
}
define('THEME', $theme);
// Load smarty now that we have our theme defined
require_once(INCLUDE_DIR . '/smarty.inc.php');
// Load everything else in proper order
require_once(CLASS_DIR . '/api.class.php');
require_once(CLASS_DIR . '/mail.class.php');
require_once(CLASS_DIR . '/tokentype.class.php');
require_once(CLASS_DIR . '/token.class.php');
require_once(CLASS_DIR . '/payout.class.php');
require_once(CLASS_DIR . '/block.class.php');
require_once(CLASS_DIR . '/setting.class.php');
require_once(CLASS_DIR . '/monitoring.class.php');
require_once(CLASS_DIR . '/user.class.php');
require_once(CLASS_DIR . '/invitation.class.php');
@ -40,3 +46,6 @@ require_once(CLASS_DIR . '/notification.class.php');
require_once(CLASS_DIR . '/news.class.php');
require_once(INCLUDE_DIR . '/lib/Michelf/Markdown.php');
require_once(INCLUDE_DIR . '/lib/scrypt.php');
?>

View File

@ -8,7 +8,7 @@ if (!defined('SECURITY')) die('Hacking attempt');
**/
class Api extends Base {
function isActive($error=true) {
if (!$this->config['website']['api']['disabled']) {
if (!$this->setting->getValue('disable_api')) {
return true;
} else {
if ($error == true) {
@ -21,3 +21,4 @@ class Api extends Base {
$api = new Api();
$api->setConfig($config);
$api->setSetting($setting);

View File

@ -32,7 +32,10 @@ class Base {
$this->token = $token;
}
public function setBlock($block) {
$this->block= $block;
$this->block = $block;
}
public function setSetting($setting) {
$this->setting = $setting;
}
public function setBitcoin($bitcoin) {
$this->bitcoin = $bitcoin;
@ -103,6 +106,9 @@ class Base {
}
public function getParam() {
$array = array_merge(array($this->types), $this->values);
// Clear the data
$this->values = NULL;
$this->types = NULL;
// See here why we need this: http://stackoverflow.com/questions/16120822/mysqli-bind-param-expected-to-be-a-reference-value-given
if (strnatcmp(phpversion(),'5.3') >= 0) {
$refs = array();

View File

@ -10,9 +10,10 @@ class Block {
// This defines each block
public $height, $blockhash, $confirmations, $time, $accounted;
public function __construct($debug, $mysqli, $salt) {
public function __construct($debug, $mysqli, $config) {
$this->debug = $debug;
$this->mysqli = $mysqli;
$this->config = $config;
$this->debug->append("Instantiated Block class", 2);
}
@ -120,8 +121,8 @@ class Block {
* @param confirmations int Required confirmations to consider block confirmed
* @return data array Array with database fields as keys
**/
public function getAllUnconfirmed($confirmations='120') {
$stmt = $this->mysqli->prepare("SELECT id, height, blockhash, confirmations FROM $this->table WHERE confirmations < ? AND confirmations > -1");
public function getAllUnconfirmed($confirmations=120) {
$stmt = $this->mysqli->prepare("SELECT * FROM $this->table WHERE confirmations < ? AND confirmations > -1");
if ($this->checkStmt($stmt) && $stmt->bind_param("i", $confirmations) && $stmt->execute() && $result = $stmt->get_result())
return $result->fetch_all(MYSQLI_ASSOC);
return false;
@ -267,4 +268,4 @@ class Block {
}
// Automatically load our class for furhter usage
$block = new Block($debug, $mysqli, SALT);
$block = new Block($debug, $mysqli, $config);

View File

@ -4,30 +4,7 @@
if (!defined('SECURITY'))
die('Hacking attempt');
class Mail {
private $sError = '';
public function setDebug($debug) {
$this->debug = $debug;
}
public function setMysql($mysqli) {
$this->mysqli = $mysqli;
}
public function setSmarty($smarty) {
$this->smarty = $smarty;
}
public function setUser($user) {
$this->user = $user;
}
public function setConfig($config) {
$this->config = $config;
}
public function setErrorMessage($msg) {
$this->sError = $msg;
}
public function getError() {
return $this->sError;
}
class Mail extends Base {
function checkStmt($bState) {
$this->debug->append("STA " . __METHOD__, 4);
if ($bState ===! true) {
@ -39,21 +16,15 @@ class Mail {
}
public function sendMail($template, $aData) {
$this->smarty->assign('WEBSITENAME', $this->config['website']['name']);
$this->smarty->assign('WEBSITENAME', $this->setting->getValue('website_name'));
$this->smarty->assign('SUBJECT', $aData['subject']);
$this->smarty->assign('DATA', $aData);
$headers = 'From: Website Administration <' . $this->config['website']['email'] . ">\n";
$headers = 'From: Website Administration <' . $this->setting->getValue('website_email') . ">\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
if (mail($aData['email'],
$this->smarty->fetch(BASEPATH . 'templates/mail/subject.tpl'),
$this->smarty->fetch(BASEPATH . 'templates/mail/' . $template . '.tpl'),
$headers)) {
return true;
} else {
$this->setErrorMessage("Unable to send mail");
return false;
}
if (mail($aData['email'], $this->smarty->fetch(BASEPATH . 'templates/mail/subject.tpl'), $this->smarty->fetch(BASEPATH . 'templates/mail/' . $template . '.tpl'), $headers))
return true;
$this->setErrorMessage('Unable to send mail');
return false;
}
}
@ -64,4 +35,5 @@ $mail->setDebug($debug);
$mail->setMysql($mysqli);
$mail->setSmarty($smarty);
$mail->setConfig($config);
$mail->setSetting($setting);
?>

View File

@ -17,21 +17,6 @@ class Notification extends Mail {
return $this->updateSingle($id, $field);
}
/**
* Update a single row in a table
* @param userID int Account ID
* @param field string Field to update
* @return bool
**/
private function updateSingle($id, $field, $table='') {
if (empty($table)) $table = $this->table;
$this->debug->append("STA " . __METHOD__, 4);
$stmt = $this->mysqli->prepare("UPDATE $table SET " . $field['name'] . " = ? WHERE id = ? LIMIT 1");
if ($this->checkStmt($stmt) && $stmt->bind_param($field['type'].'i', $field['value'], $id) && $stmt->execute())
return true;
$this->debug->append("Unable to update " . $field['name'] . " with " . $field['value'] . " for ID $id");
return false;
}
/**
* We check our notification table for existing data
* so we can avoid duplicate entries
@ -179,9 +164,13 @@ class Notification extends Mail {
if ($stmt && $stmt->bind_param('si', $strType, $account_id) && $stmt->execute() && $stmt->bind_result($id) && $stmt->fetch()) {
if ($stmt->close() && $this->sendMail('notifications/' . $strType, $aMailData) && $this->addNotification($account_id, $strType, $aMailData)) {
return true;
} else {
$this->setErrorMessage('SendMail call failed: ' . $this->mail->getError());
return false;
}
} else {
$this->setErrorMessage('User disabled ' . $strType . ' notifications');
return false;
}
$this->setErrorMessage('Error sending mail notification');
return false;
@ -193,5 +182,5 @@ $notification->setDebug($debug);
$notification->setMysql($mysqli);
$notification->setSmarty($smarty);
$notification->setConfig($config);
$notification->setSetting($setting);
?>

View File

@ -5,10 +5,9 @@ if (!defined('SECURITY'))
die('Hacking attempt');
class Setting {
public function __construct($debug, $mysqli, $salt) {
public function __construct($debug, $mysqli) {
$this->debug = $debug;
$this->mysqli = $mysqli;
$this->salt = $salt;
$this->table = 'settings';
}
@ -47,9 +46,8 @@ class Setting {
if ($stmt && $stmt->bind_param('sss', $name, $value, $value) && $stmt->execute())
return true;
$this->debug->append("Failed to set $name to $value");
echo $this->mysqli->error;
return false;
}
}
$setting = new Setting($debug, $mysqli, SALT);
$setting = new Setting($debug, $mysqli);

View File

@ -402,10 +402,11 @@ class Statistics {
AND a.id = ?
GROUP BY HOUR(time)");
if ($this->checkStmt($stmt) && $stmt->bind_param('ii', $account_id, $account_id) && $stmt->execute() && $result = $stmt->get_result()) {
$aData = array();
while ($row = $result->fetch_assoc()) {
$aData[$row['hour']] = $row['hashrate'];
}
$iStartHour = date('G');
// Initilize array
for ($i = 0; $i < 24; $i++) $aData[($iStartHour + $i) % 24] = 0;
// Fill data
while ($row = $result->fetch_assoc()) $aData[$row['hour']] = $row['hashrate'];
return $this->memcache->setCache(__FUNCTION__ . $account_id, $aData);
}
// Catchall
@ -438,10 +439,12 @@ class Statistics {
AND time > NOW() - INTERVAL 25 HOUR
GROUP BY HOUR(time)");
if ($this->checkStmt($stmt) && $stmt->execute() && $result = $stmt->get_result()) {
while ($row = $result->fetch_assoc()) {
$aData[$row['hour']] = $row['hashrate'];
}
return $this->memcache->setCache(__FUNCTION__, @$aData);
$iStartHour = date('G');
// Initilize array
for ($i = 0; $i < 24; $i++) $aData[($iStartHour + $i) % 24] = 0;
// Fill data
while ($row = $result->fetch_assoc()) $aData[$row['hour']] = (int) $row['hashrate'];
return $this->memcache->setCache(__FUNCTION__, $aData);
}
// Catchall
$this->debug->append("Failed to fetch hourly hashrate: " . $this->mysqli->error);

View File

@ -47,6 +47,38 @@ class Transaction extends Base {
return false;
}
/**
* Fetch a transaction summary by type with total amounts
* @param account_id int Account ID, NULL for all
* @return data array type and total
**/
public function getTransactionSummary($account_id=NULL) {
$sql = "SELECT SUM(t.amount) AS total, t.type AS type FROM $this->table AS t";
if (!empty($account_id)) {
$sql .= " WHERE t.account_id = ? ";
$this->addParam('i', $account_id);
}
$sql .= " GROUP BY t.type";
$stmt = $this->mysqli->prepare($sql);
if (!empty($account_id)) {
if (!($this->checkStmt($stmt) && call_user_func_array( array($stmt, 'bind_param'), $this->getParam()) && $stmt->execute()))
return false;
$result = $stmt->get_result();
} else {
if (!($this->checkStmt($stmt) && $stmt->execute()))
return false;
$result = $stmt->get_result();
}
if ($result) {
$aData = NULL;
while ($row = $result->fetch_assoc()) {
$aData[$row['type']] = $row['total'];
}
return $aData;
}
return false;
}
/**
* Get all transactions from start for account_id
* @param start int Starting point, id of transaction

View File

@ -28,6 +28,9 @@ class User {
public function setBitcoin($bitcoin) {
$this->bitcoin = $bitcoin;
}
public function setSetting($setting) {
$this->setting = $setting;
}
private function setErrorMessage($msg) {
$this->sError = $msg;
}
@ -525,7 +528,7 @@ class User {
}
}
if ($this->mysqli->query("SELECT id FROM $this->table LIMIT 1")->num_rows > 0) {
$this->config['accounts']['confirm_email']['enabled'] ? $is_locked = 1 : $is_locked = 0;
! $this->setting->getValue('accounts_confirm_email_disabled') ? $is_locked = 1 : $is_locked = 0;
$is_admin = 0;
$stmt = $this->mysqli->prepare("
INSERT INTO $this->table (username, pass, email, pin, api_key, is_locked)
@ -547,14 +550,14 @@ class User {
$username_clean = strip_tags($username);
if ($this->checkStmt($stmt) && $stmt->bind_param('sssssi', $username_clean, $password_hash, $email1, $pin_hash, $apikey_hash, $is_locked) && $stmt->execute()) {
if ($this->config['accounts']['confirm_email']['enabled'] && $is_admin != 1) {
if (! $this->setting->getValue('accounts_confirm_email_enabled') && $is_admin != 1) {
if ($token = $this->token->createToken('confirm_email', $stmt->insert_id)) {
$aData['username'] = $username_clean;
$aData['token'] = $token;
$aData['email'] = $email1;
$aData['subject'] = 'E-Mail verification';
if (!$this->mail->sendMail('register/confirm_email', $aData)) {
$this->setErrorMessage('Unable to request email confirmation');
$this->setErrorMessage('Unable to request email confirmation: ' . $this->mail->getError());
return false;
}
return true;
@ -666,3 +669,4 @@ $user = new User($debug, $mysqli, SALT, $config);
$user->setMail($mail);
$user->setToken($oToken);
$user->setBitcoin($bitcoin);
$user->setSetting($setting);

View File

@ -3,48 +3,186 @@
// Make sure we are called from index.php
if (!defined('SECURITY')) die('Hacking attempt');
// Load a list of themes available
$aTmpThemes = glob(THEME_DIR . '/*');
$aThemes = array();
foreach ($aTmpThemes as $dir) {
if (basename($dir) != 'cache' && basename($dir) != 'compile' && basename($dir) != 'mail') $aThemes[basename($dir)] = basename($dir);
}
// Load the settings available in this system
$aSettings['system'][] = array(
$aSettings['website'][] = array(
'display' => 'Maintenance Mode', 'type' => 'select',
'options' => array( 0 => 'No', 1 => 'Yes' ),
'default' => 0,
'name' => 'maintenance', 'value' => $setting->getValue('maintenance'),
'tooltip' => 'Enable or Disable maintenance mode. Only admins can still login.'
);
$aSettings['website'][] = array(
'display' => 'Message of the Day', 'type' => 'text',
'size' => 25,
'default' => '',
'name' => 'system_motd', 'value' => $setting->getValue('system_motd'),
'tooltip' => 'Display a message of the day as information popup if set.'
);
$aSettings['website'][] = array(
'display' => 'Website Name', 'type' => 'text',
'size' => 25,
'default' => 'The Pool',
'name' => 'website_name', 'value' => $setting->getValue('website_name'),
'tooltip' => 'The name of you pool page, displayed in the header of the page.'
);
$aSettings['website'][] = array(
'display' => 'Website Title', 'type' => 'text',
'size' => 25,
'default' => 'The Pool - Mining Evolved',
'name' => 'website_title', 'value' => $setting->getValue('website_title'),
'tooltip' => 'The title of you pool page, displayed in the browser window header.'
);
$aSettings['website'][] = array(
'display' => 'Website Slogan', 'type' => 'text',
'size' => 25,
'default' => 'Resistance is Futile',
'name' => 'website_slogan', 'value' => $setting->getValue('website_slogan'),
'tooltip' => 'The slogan of you pool page, displayed in the browser window header.'
);
$aSettings['website'][] = array(
'display' => 'Website e-mail', 'type' => 'text',
'size' => 25,
'default' => 'test@example.com',
'name' => 'website_email', 'value' => $setting->getValue('website_email'),
'tooltip' => 'The email address for your pool, used in mail templates and notifications.'
);
$aSettings['website'][] = array(
'display' => 'Website theme', 'type' => 'select',
'options' => $aThemes,
'default' => 'mmcFE',
'name' => 'website_theme', 'value' => $setting->getValue('website_theme'),
'tooltip' => 'The default theme used on your pool.'
);
$aSettings['website'][] = array(
'display' => 'Website mobile theme', 'type' => 'select',
'options' => $aThemes,
'default' => 'mobile',
'name' => 'website_mobile_theme', 'value' => $setting->getValue('website_mobile_theme'),
'tooltip' => 'The mobile theme used for your pool.'
);
$aSettings['website'][] = array(
'display' => 'Blockexplorer URL', 'type' => 'text',
'size' => 50,
'default' => 'http://explorer.litecoin.net/block/',
'name' => 'website_blockexplorer_url', 'value' => $setting->getValue('website_blockexplorer_url'),
'tooltip' => 'URL to the blockexplorer website for your blockchain. Will append the blockhash to the URL. Leave empty to disabled this.'
);
$aSettings['website'][] = array(
'display' => 'Disable Blockexplorer', 'type' => 'select',
'options' => array( 0 => 'No', 1 => 'Yes' ),
'name' => 'website_blockexplorer_disabled', 'value' => $setting->getValue('website_blockexplorer_disabled'),
'tooltip' => 'Enabled or disable the blockexplorer URL feature. Will remove any links using the blockexplorer URL.'
);
$aSettings['website'][] = array(
'display' => 'Chaininfo URL', 'type' => 'text',
'size' => 50,
'default' => 'http://allchains.info',
'name' => 'website_chaininfo_url', 'value' => $setting->getValue('website_chaininfo_url'),
'tooltip' => 'URL to the chaininfo website for your blockchain. Leave empty to disabled this.'
);
$aSettings['website'][] = array(
'display' => 'Disable Chaininfo', 'type' => 'select',
'options' => array( 0 => 'No', 1 => 'Yes' ),
'name' => 'website_chaininfo_disabled', 'value' => $setting->getValue('website_chaininfo_disabled'),
'tooltip' => 'Enabled or disable the chainfo URL feature. Will remove any links using the chaininfo URL.'
);
$aSettings['statistics'][] = array(
'display' => 'Block Statistics Count', 'type' => 'text',
'size' => 25,
'default' => 20,
'name' => 'statistics_block_count', 'value' => $setting->getValue('statistics_block_count'),
'tooltip' => 'Blocks to fetch for the block statistics page.'
);
$aSettings['acl'][] = array(
'display' => 'Pool Statistics', 'type' => 'select',
'options' => array( 0 => 'Private', 1 => 'Public'),
'default' => 1,
'name' => 'acl_pool_statistics', 'value' => $setting->getValue('acl_pool_statistics'),
'tooltip' => 'Make the pool statistics page private (users only) or public.'
);
$aSettings['acl'][] = array(
'display' => 'Blcok Statistics', 'type' => 'select',
'options' => array( 0 => 'Private', 1 => 'Public'),
'default' => 1,
'name' => 'acl_block_statistics', 'value' => $setting->getValue('acl_block_statistics'),
'tooltip' => 'Make the block statistics page private (users only) or public.'
);
$aSettings['system'][] = array(
'display' => 'Disable e-mail confirmations', 'type' => 'select',
'options' => array( 0 => 'No', 1 => 'Yes' ),
'default' => 0,
'name' => 'accounts_confirm_email_disabled', 'value' => $setting->getValue('accounts_confirm_email_disabled'),
'tooltip' => 'Should users supply a valid e-mail address upon registration. Requires them to confirm the address before accounts are activated.'
);
$aSettings['system'][] = array(
'display' => 'Disable registrations', 'type' => 'select',
'options' => array( 0 => 'No', 1 => 'Yes' ),
'default' => 0,
'name' => 'lock_registration', 'value' => $setting->getValue('lock_registration'),
'tooltip' => 'Enable or Disable registrations. Useful to create an invitation only pool.'
);
$aSettings['system'][] = array(
'display' => 'Disable Invitations', 'type' => 'select',
'options' => array( 0 => 'No', 1 => 'Yes' ),
'default' => 0,
'name' => 'disable_invitations', 'value' => $setting->getValue('disable_invitations'),
'tooltip' => 'Enable or Disable invitations. Users will not be able to invite new users via email if disabled.'
);
$aSettings['system'][] = array(
'display' => 'Disable Manual Payouts', 'type' => 'select',
'options' => array( 0 => 'No', 1 => 'Yes' ),
'default' => 0,
'name' => 'disable_mp', 'value' => $setting->getValue('disable_mp'),
'tooltip' => 'Enable or Disable the manual payout processing. Users will not be able to withdraw any funds if disabled.'
);
$aSettings['system'][] = array(
'display' => 'Disable Automatic Payouts', 'type' => 'select',
'options' => array( 0 => 'No', 1 => 'Yes' ),
'default' => 0,
'name' => 'disable_ap', 'value' => $setting->getValue('disable_ap'),
'tooltip' => 'Enable or Disable the automatic payout processing. Users exceeding their thresholds will not be paid out if disabled.'
);
$aSettings['system'][] = array(
'display' => 'Disable notifications', 'type' => 'select',
'options' => array( 0 => 'No', 1 => 'Yes' ),
'default' => 0,
'name' => 'disable_notifications', 'value' => $setting->getValue('disable_notifications'),
'tooltip' => 'Enable or Disable system notifications. This includes new found blocks, monitoring and all other notifications.'
);
$aSettings['other'][] = array(
'display' => 'Message of the Day', 'type' => 'text',
$aSettings['system'][] = array(
'display' => 'Disable API', 'type' => 'select',
'options' => array( 0 => 'No', 1 => 'Yes' ),
'default' => 0,
'name' => 'disable_api', 'value' => $setting->getValue('disable_api'),
'tooltip' => 'Enable or Disable the pool wide API functions. See API reference on Github for details.'
);
$aSettings['recaptcha'][] = array(
'display' => 'Enable re-Captcha', 'type' => 'select',
'options' => array( 0 => 'No', 1 => 'Yes' ),
'default' => 0,
'name' => 'recaptcha_enabled', 'value' => $setting->getValue('recaptcha_enabled'),
'tooltip' => 'Enable or Disable re-Captcha. This will require user input on registraion and other forms.'
);
$aSettings['recaptcha'][] = array(
'display' => 're-Captcha Private Key', 'type' => 'text',
'size' => 25,
'name' => 'system_motd', 'value' => $setting->getValue('system_motd'),
'tooltip' => 'Display a message of the day as information popup if set.'
'default' => 'YOUR_PRIVATE_KEY',
'name' => 'recaptcha_private_key', 'value' => $setting->getValue('recaptcha_private_key'),
'tooltip' => '.'
);
$aSettings['recaptcha'][] = array(
'display' => 're-Captcha Public Key', 'type' => 'text',
'size' => 25,
'default' => 'YOUR_PUBLIC_KEY',
'name' => 'recaptcha_public_key', 'value' => $setting->getValue('recaptcha_public_key'),
'tooltip' => 'Your public key as given by your re-Captcha account.'
);
?>

View File

@ -11,6 +11,9 @@ define('CLASS_DIR', INCLUDE_DIR . '/classes');
// Our pages directory which takes care of
define('PAGES_DIR', INCLUDE_DIR . '/pages');
// Our theme folder holding all themes
define('THEME_DIR', BASEPATH . 'templates');
// Set debugging level for our debug class
define('DEBUG', 0);
@ -97,49 +100,10 @@ $config['ap_threshold']['min'] = 1;
$config['ap_threshold']['max'] = 250;
/**
* Website specific configuration settings
*
* Explanation:
* title : Website title used in master template
* name : The pool name, displayed in the header and mails
* slogan : A special slogan, also displayed in the header below name
* email : `From` addresses used in notifications
* theme : Theme used for desktop browsers
* mobile : Enable/Disable mobile theme support
* mobile_theme : Theme used for mobile browsers
* api disabled : Disable the sites API functions
* blocks count : # of blocks to display on block statistics page
*
* Defaults:
* title = `The Pool - Mining Evolved`
* name = `The Pool`
* slogan = `Resistance is futile`
* email = `test@example.com`
* theme = `mmcFE`
* mobile = true
* mobile_theme = `mobile`
* api disbabled = false
* blocks count = 20
**/
$config['website']['title'] = 'The Pool - Mining Evolved';
$config['website']['name'] = 'The Pool';
$config['website']['slogan'] = 'Resistance is futile';
$config['website']['email'] = 'test@example.com';
$config['website']['theme'] = 'mmcFE';
$config['website']['mobile'] = true;
$config['website']['mobile_theme'] = 'mobile';
$config['website']['api']['disabled'] = false;
$config['website']['blocks']['count'] = 20;
/**
* Account specific settings
*
* Explanation
* You can change some defaults on how accounts are created or registered
* By default, all newly created accounts will require an email verificaiton.
* Only after acitivating an account the user will be able to login
*
* Invitations will allow your users to invite new members to join the pool.
* After sending a mail to the invited user, they can register using the token
* created. Invitations can be enabled and disabled through the admin panel.
@ -149,41 +113,13 @@ $config['website']['blocks']['count'] = 20;
* variable.
*
* Options:
* confirm_email : Send confirmation mail to user after registration
* count : Maximum invitations a user is able to send
*
* Defaults:
* confirm_email : true
* count : 5
**/
$config['accounts']['confirm_email']['enabled'] = true;
$config['accounts']['invitations']['count'] = 5;
/**
* Some basic access restrictions on some pages
*
* Explanation:
* Some pools would like to run a few pages for public access instead
* of enforcing a login. You can change visibility of some pages here.
*
* Options:
* 'public' : Allow guest access and authenticated user to view page
* 'private' : Only allow logged in users access to view page
*
* Defaults:
* 'private' for every page
**/
$config['website']['acl']['statistics']['pool'] = 'private';
$config['website']['acl']['statistics']['blocks'] = 'private';
/**
* Re-Captcha settings
* Please read http://www.google.com/recaptcha for details
**/
$config['recaptcha']['enabled'] = false;
$config['recaptcha']['public_key'] = 'YOUR_PUBLIC_RECAPTCHA_KEY';
$config['recaptcha']['private_key'] = 'YOUR_PRIVATE_RECAPTCHA_KEY';
// Currency system used in this pool, default: `LTC`
$config['currency'] = 'LTC';
@ -254,15 +190,6 @@ $config['payout_system'] = 'prop';
$config['archive']['maxrounds'] = 10;
$config['archive']['maxage'] = 60 * 24;
// URL prefix for block searches, used for block links, default: `http://explorer.litecoin.net/block/`
// The Blockhash is appended on the templates to this URL
// If this config is empty, the block link to the block information page will be removed
$config['blockexplorer'] = 'http://explorer.litecoin.net/block/';
// Link to blockchain information, used for difficulty link, default: `http://allchains.info`
// If empty, the difficulty link to the chain information will be removed
$config['chaininfo'] = 'http://allchains.info';
// Pool fees applied to users in percent, default: 0 (disabled)
$config['fees'] = 0;
@ -349,7 +276,8 @@ $config['reward'] = 50;
// Confirmations per block required to credit transactions, default: 120
$config['confirmations'] = 120;
// Confirmations per block required in network to confirm its transactions, default: 120
$config['network_confirmations'] = 120;
/**
* Memcache configuration

View File

@ -0,0 +1,6 @@
<?php
// Make sure we are called from index.php
if (!defined('SECURITY')) die('Hacking attempt');
if ($user->isAuthenticated()) $smarty->assign("CONTENT", "default.tpl");
?>

View File

@ -6,11 +6,13 @@ if ($user->isAuthenticated()) {
$iLimit = 30;
empty($_REQUEST['start']) ? $start = 0 : $start = $_REQUEST['start'];
$aTransactions = $transaction->getTransactions($start, @$_REQUEST['filter'], $iLimit, $_SESSION['USERDATA']['id']);
$aTransactionSummary = $transaction->getTransactionSummary($_SESSION['USERDATA']['id']);
$iCountTransactions = $transaction->num_rows;
$aTransactionTypes = $transaction->getTypes();
if (!$aTransactions) $_SESSION['POPUP'][] = array('CONTENT' => 'Could not find any transaction', 'TYPE' => 'errormsg');
$smarty->assign('LIMIT', $iLimit);
$smarty->assign('TRANSACTIONS', $aTransactions);
$smarty->assign('SUMMARY', $aTransactionSummary);
$smarty->assign('TRANSACTIONTYPES', $aTransactionTypes);
$smarty->assign('TXSTATUS', array('' => '', 'Confirmed' => 'Confirmed', 'Unconfirmed' => 'Unconfirmed', 'Orphan' => 'Orphan'));
$smarty->assign('COUNTTRANSACTIONS', $iCountTransactions);

View File

@ -14,11 +14,13 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
$debug->append('No cached version available, fetching from backend', 3);
empty($_REQUEST['start']) ? $start = 0 : $start = $_REQUEST['start'];
$aTransactions = $transaction->getTransactions($start, @$_REQUEST['filter'], $iLimit);
$aTransactionSummary = $transaction->getTransactionSummary();
$iCountTransactions = $transaction->num_rows;
$aTransactionTypes = $transaction->getTypes();
if (!$aTransactions) $_SESSION['POPUP'][] = array('CONTENT' => 'Could not find any transaction', 'TYPE' => 'errormsg');
$smarty->assign('LIMIT', $iLimit);
$smarty->assign('TRANSACTIONS', $aTransactions);
$smarty->assign('SUMMARY', $aTransactionSummary);
$smarty->assign('TRANSACTIONTYPES', $aTransactionTypes);
$smarty->assign('TXSTATUS', array('' => '', 'Confirmed' => 'Confirmed', 'Unconfirmed' => 'Unconfirmed', 'Orphan' => 'Orphan'));
$smarty->assign('COUNTTRANSACTIONS', $iCountTransactions);

View File

@ -24,16 +24,24 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
$dNewmint = -1;
$_SESSION['POPUP'][] = array('CONTENT' => 'Unable to connect to wallet RPC service: ' . $bitcoin->can_connect(), 'TYPE' => 'errormsg');
}
// Fetch unconfirmed amount from blocks table
$aBlocksUnconfirmed = $block->getAllUnconfirmed();
$dBlocksUnconfirmedBalance = 0;
if (!empty($aBlocksUnconfirmed))
foreach ($aBlocksUnconfirmed as $aData) $dBlocksUnconfirmedBalance += $aData['amount'];
// Fetch locked balance from transactions
$dLockedBalance = $transaction->getLockedBalance();
} else {
$debug->append('Using cached page', 3);
}
$smarty->assign("UNCONFIRMED", $dBlocksUnconfirmedBalance);
$smarty->assign("BALANCE", $dBalance);
$smarty->assign("LOCKED", $dLockedBalance);
$smarty->assign("NEWMINT", $dNewmint);
// Tempalte specifics
$smarty->assign("CONTENT", "default.tpl");
?>

View File

@ -0,0 +1,32 @@
<?php
// Make sure we are called from index.php
if (!defined('SECURITY')) die('Hacking attempt');
// Check if the API is activated
$api->isActive();
// Check user token
$user_id = $user->checkApiKey($_REQUEST['api_key']);
if ( ! $user->isAdmin($user_id) && ($_REQUEST['id'] != $user_id && !empty($_REQUEST['id']))) {
// User is admin and tries to access an ID that is not their own
header("HTTP/1.1 401 Unauthorized");
die("Access denied");
} else if ($user->isAdmin($user_id)) {
// Is it a username or a user ID
ctype_digit($_REQUEST['id']) ? $id = $_REQUEST['id'] : $id = $user->getUserId($_REQUEST['id']);
} else {
// Not admin, only allow own user ID
$id = $user_id;
}
// Output JSON format
echo json_encode(array('gethourlyhashrates' => array(
'mine' => $statistics->getHourlyHashrateByAccount($id),
'pool' => $statistics->getHourlyHashrateByPool()
)), JSON_FORCE_OBJECT);
// Supress master template
$supress_master = 1;
?>

View File

@ -0,0 +1,30 @@
<?php
// Make sure we are called from index.php
if (!defined('SECURITY')) die('Hacking attempt');
// Check if the API is activated
$api->isActive();
// Check user token
$user_id = $user->checkApiKey($_REQUEST['api_key']);
echo $user_id;
// We have to check if that user is admin too
if ( ! $user->isAdmin($user_id) && ($_REQUEST['id'] != $user_id && !empty($_REQUEST['id']))) {
header("HTTP/1.1 401 Unauthorized");
die("Access denied");
} else if ($user->isAdmin($user_id) && !empty($_REQUEST['id'])) {
$id = $_REQUEST['id'];
ctype_digit($_REQUEST['id']) ? $id = $_REQUEST['id'] : $id = $user->getUserId($_REQUEST['id']);
} else {
$id = $user_id;
}
// Output JSON format
echo json_encode(array('getuserbalance' => $transaction->getBalance($id)));
// Supress master template
$supress_master = 1;
?>

View File

@ -10,11 +10,10 @@ if ($setting->getValue('lock_registration') && $setting->getValue('disable_invit
$_SESSION['POPUP'][] = array('CONTENT' => 'Only invited users are allowed to register.', 'TYPE' => 'errormsg');
$smarty->assign("CONTENT", "disabled.tpl");
} else {
if ($config['recaptcha']['enabled']) {
if ($setting->getValue('recaptcha_enabled')) {
require_once(INCLUDE_DIR . '/lib/recaptchalib.php');
$smarty->assign("RECAPTCHA", recaptcha_get_html($config['recaptcha']['public_key']));
$smarty->assign("RECAPTCHA", recaptcha_get_html($setting->getValue('recaptcha_public_key')));
}
// Tempalte specifics
$smarty->assign("CONTENT", "default.tpl");
}
?>

View File

@ -2,11 +2,11 @@
// Make sure we are called from index.php
if (!defined('SECURITY')) die('Hacking attempt');
if ($config['recaptcha']['enabled']) {
if ($setting->getValue('recaptcha_enabled')) {
// Load re-captcha specific data
require_once(INCLUDE_DIR . '/lib/recaptchalib.php');
$rsp = recaptcha_check_answer (
$config['recaptcha']['private_key'],
$setting->getValue('recaptcha_private_key'),
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]
@ -19,28 +19,28 @@ if ($setting->getValue('disable_invitations') && $setting->getValue('lock_regist
$_SESSION['POPUP'][] = array('CONTENT' => 'Only invited users are allowed to register.', 'TYPE' => 'errormsg');
} else {
// Check if recaptcha is enabled, process form data if valid
if($config['recaptcha']['enabled'] && $_POST["recaptcha_response_field"] && $_POST["recaptcha_response_field"]!=''){
if($setting->getValue('recaptcha_enabled') && $_POST["recaptcha_response_field"] && $_POST["recaptcha_response_field"]!=''){
if ($rsp->is_valid) {
$smarty->assign("RECAPTCHA", recaptcha_get_html($config['recaptcha']['public_key']));
$smarty->assign("RECAPTCHA", recaptcha_get_html($setting->getValue('recaptcha_public_key')));
isset($_POST['token']) ? $token = $_POST['token'] : $token = '';
if ($user->register($_POST['username'], $_POST['password1'], $_POST['password2'], $_POST['pin'], $_POST['email1'], $_POST['email2'], $token)) {
$config['accounts']['confirm_email']['enabled'] ? $_SESSION['POPUP'][] = array('CONTENT' => 'Please check your mailbox to activate this account') : $_SESSION['POPUP'][] = array('CONTENT' => 'Account created, please login');
! $setting->getValue('accounts_confirm_email_disabled') ? $_SESSION['POPUP'][] = array('CONTENT' => 'Please check your mailbox to activate this account') : $_SESSION['POPUP'][] = array('CONTENT' => 'Account created, please login');
} else {
$_SESSION['POPUP'][] = array('CONTENT' => 'Unable to create account: ' . $user->getError(), 'TYPE' => 'errormsg');
}
} else {
$smarty->assign("RECAPTCHA", recaptcha_get_html($config['recaptcha']['public_key'], $rsp->error));
$smarty->assign("RECAPTCHA", recaptcha_get_html($setting->getValue('recaptcha_public_key'), $rsp->error));
$_SESSION['POPUP'][] = array('CONTENT' => 'Invalid Captcha, please try again. (' . $rsp->error . ')', 'TYPE' => 'errormsg');
}
// Empty captcha
} else if ($config['recaptcha']['enabled']) {
$smarty->assign("RECAPTCHA", recaptcha_get_html($config['recaptcha']['public_key'], $rsp->error));
} else if ($setting->getValue('recaptcha_enabled')) {
$smarty->assign("RECAPTCHA", recaptcha_get_html($setting->getValue('recaptcha_public_key'), $rsp->error));
$_SESSION['POPUP'][] = array('CONTENT' => 'Empty Captcha, please try again.', 'TYPE' => 'errormsg');
// Captcha disabled
} else {
isset($_POST['token']) ? $token = $_POST['token'] : $token = '';
if ($user->register($_POST['username'], $_POST['password1'], $_POST['password2'], $_POST['pin'], $_POST['email1'], $_POST['email2'], $token)) {
$config['accounts']['confirm_email']['enabled'] ? $_SESSION['POPUP'][] = array('CONTENT' => 'Please check your mailbox to activate this account') : $_SESSION['POPUP'][] = array('CONTENT' => 'Account created, please login');
! $setting->getValue('accounts_confirm_email_disabled') ? $_SESSION['POPUP'][] = array('CONTENT' => 'Please check your mailbox to activate this account') : $_SESSION['POPUP'][] = array('CONTENT' => 'Account created, please login');
} else {
$_SESSION['POPUP'][] = array('CONTENT' => 'Unable to create account: ' . $user->getError(), 'TYPE' => 'errormsg');
}

View File

@ -7,7 +7,7 @@ if (!defined('SECURITY')) die('Hacking attempt');
if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
$debug->append('No cached version available, fetching from backend', 3);
// Grab the last blocks found
!empty($config['website']['blocks']['count']) ? $iLimit = $config['website']['blocks']['count'] : $iLimit = 20;
$setting->getValue('statistics_block_count') ? $iLimit = $setting->getValue('statistics_block_count') : $iLimit = 20;
$aBlocksFoundData = $statistics->getBlocksFound($iLimit);
// Propagate content our template
@ -17,7 +17,7 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
$debug->append('Using cached page', 3);
}
if ($config['website']['acl']['statistics']['blocks'] == 'public') {
if ($setting->getValue('acl_block_statistics')) {
$smarty->assign("CONTENT", "default.tpl");
} else if ($user->isAuthenticated()) {
$smarty->assign("CONTENT", "default.tpl");

View File

@ -52,7 +52,7 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
$smarty->assign("CONTRIBSHARES", $aContributorsShares);
$smarty->assign("CONTRIBHASHES", $aContributorsHashes);
$smarty->assign("CURRENTBLOCK", $iBlock);
$smarty->assign("CURRENTBLOCKHASH", $sBlockHash);
$smarty->assign("CURRENTBLOCKHASH", @$sBlockHash);
if (count($aBlockData) > 0) {
$smarty->assign("LASTBLOCK", $aBlockData['height']);
$smarty->assign("LASTBLOCKHASH", $aBlockData['blockhash']);
@ -66,9 +66,9 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
}
// Public / private page detection
if ($config['website']['acl']['statistics']['pool'] == 'public') {
if ($setting->getValue('acl_pool_statistics')) {
$smarty->assign("CONTENT", "authenticated.tpl");
} else if ($user->isAuthenticated() && $config['website']['acl']['statistics']['pool'] == 'private') {
} else if ($user->isAuthenticated() && ! $setting->getValue('acl_pool_statistics')) {
$smarty->assign("CONTENT", "authenticated.tpl");
} else {
$smarty->assign("CONTENT", "../default.tpl");

View File

@ -12,14 +12,13 @@ $dDifficulty = 1;
$aRoundShares = 1;
// Only run these if the user is logged in
if (@$_SESSION['AUTHENTICATED']) {
$aRoundShares = $statistics->getRoundShares();
if ($bitcoin->can_connect() === true) {
$dDifficulty = $bitcoin->query('getdifficulty');
if (is_array($dDifficulty) && array_key_exists('proof-of-work', $dDifficulty))
$dDifficulty = $dDifficulty['proof-of-work'];
}
$aRoundShares = $statistics->getRoundShares();
if ($bitcoin->can_connect() === true) {
$dDifficulty = $bitcoin->query('getdifficulty');
if (is_array($dDifficulty) && array_key_exists('proof-of-work', $dDifficulty))
$dDifficulty = $dDifficulty['proof-of-work'];
}
// Always fetch this since we need for ministats header
$bitcoin->can_connect() === true ? $dNetworkHashrate = $bitcoin->query('getnetworkhashps') : $dNetworkHashrate = 0;
@ -33,8 +32,6 @@ if ($iCurrentPoolHashrate > $dNetworkHashrate) $dNetworkHashrate = $iCurrentPool
// Global data for Smarty
$aGlobal = array(
'slogan' => $config['website']['slogan'],
'websitename' => $config['website']['name'],
'hashrate' => $iCurrentPoolHashrate,
'nethashrate' => $dNetworkHashrate,
'sharerate' => $iCurrentPoolShareRate,
@ -44,11 +41,8 @@ $aGlobal = array(
'confirmations' => $config['confirmations'],
'reward' => $config['reward'],
'price' => $setting->getValue('price'),
'blockexplorer' => $config['blockexplorer'],
'chaininfo' => $config['chaininfo'],
'disable_mp' => $setting->getValue('disable_mp'),
'config' => array(
'website' => $config['website'],
'accounts' => $config['accounts'],
'disable_invitations' => $setting->getValue('disable_invitations'),
'disable_notifications' => $setting->getValue('disable_notifications'),
@ -64,9 +58,24 @@ $aGlobal = array(
)
);
// Website configurations
$aGlobal['website']['name'] = $setting->getValue('website_name');
$aGlobal['website']['title'] = $setting->getValue('website_title');
$aGlobal['website']['slogan'] = $setting->getValue('website_slogan');
$aGlobal['website']['email'] = $setting->getValue('website_email');
$aGlobal['website']['api']['disabled'] = $setting->getValue('disable_api');
$aGlobal['website']['blockexplorer']['disabled'] = $setting->getValue('website_blockexplorer_disabled');
$aGlobal['website']['chaininfo']['disabled'] = $setting->getValue('website_chaininfo_disabled');
$setting->getValue('website_blockexplorer_url') ? $aGlobal['website']['blockexplorer']['url'] = $setting->getValue('website_blockexplorer_url') : $aGlobal['website']['blockexplorer']['url'] = 'http://explorer.litecoin.net/block/';
$setting->getValue('website_chaininfo_url') ? $aGlobal['website']['chaininfo']['url'] = $setting->getValue('website_chaininfo_url') : $aGlobal['website']['chaininfo']['url'] = 'http://allchains.info';
// ACLs
$aGlobal['acl']['pool']['statistics'] = $setting->getValue('acl_pool_statistics');
$aGlobal['acl']['block']['statistics'] = $setting->getValue('acl_block_statistics');
// Special calculations for PPS Values based on reward_type setting and/or available blocks
if ($config['reward_type'] != 'block') {
$aGlobal['ppsvalue'] = number_format(round(50 / (pow(2,32) * $dDifficulty) * pow(2, $config['difficulty']), 12) ,12);
$aGlobal['ppsvalue'] = number_format(round($config['reward'] / (pow(2,32) * $dDifficulty) * pow(2, $config['difficulty']), 12) ,12);
} else {
// Try to find the last block value and use that for future payouts, revert to fixed reward if none found
if ($aLastBlock = $block->getLast()) {

View File

@ -0,0 +1,28 @@
(function(r){r.fn.qrcode=function(h){var s;function u(a){this.mode=s;this.data=a}function o(a,c){this.typeNumber=a;this.errorCorrectLevel=c;this.modules=null;this.moduleCount=0;this.dataCache=null;this.dataList=[]}function q(a,c){if(void 0==a.length)throw Error(a.length+"/"+c);for(var d=0;d<a.length&&0==a[d];)d++;this.num=Array(a.length-d+c);for(var b=0;b<a.length-d;b++)this.num[b]=a[b+d]}function p(a,c){this.totalCount=a;this.dataCount=c}function t(){this.buffer=[];this.length=0}u.prototype={getLength:function(){return this.data.length},
write:function(a){for(var c=0;c<this.data.length;c++)a.put(this.data.charCodeAt(c),8)}};o.prototype={addData:function(a){this.dataList.push(new u(a));this.dataCache=null},isDark:function(a,c){if(0>a||this.moduleCount<=a||0>c||this.moduleCount<=c)throw Error(a+","+c);return this.modules[a][c]},getModuleCount:function(){return this.moduleCount},make:function(){if(1>this.typeNumber){for(var a=1,a=1;40>a;a++){for(var c=p.getRSBlocks(a,this.errorCorrectLevel),d=new t,b=0,e=0;e<c.length;e++)b+=c[e].dataCount;
for(e=0;e<this.dataList.length;e++)c=this.dataList[e],d.put(c.mode,4),d.put(c.getLength(),j.getLengthInBits(c.mode,a)),c.write(d);if(d.getLengthInBits()<=8*b)break}this.typeNumber=a}this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(a,c){this.moduleCount=4*this.typeNumber+17;this.modules=Array(this.moduleCount);for(var d=0;d<this.moduleCount;d++){this.modules[d]=Array(this.moduleCount);for(var b=0;b<this.moduleCount;b++)this.modules[d][b]=null}this.setupPositionProbePattern(0,0);this.setupPositionProbePattern(this.moduleCount-
7,0);this.setupPositionProbePattern(0,this.moduleCount-7);this.setupPositionAdjustPattern();this.setupTimingPattern();this.setupTypeInfo(a,c);7<=this.typeNumber&&this.setupTypeNumber(a);null==this.dataCache&&(this.dataCache=o.createData(this.typeNumber,this.errorCorrectLevel,this.dataList));this.mapData(this.dataCache,c)},setupPositionProbePattern:function(a,c){for(var d=-1;7>=d;d++)if(!(-1>=a+d||this.moduleCount<=a+d))for(var b=-1;7>=b;b++)-1>=c+b||this.moduleCount<=c+b||(this.modules[a+d][c+b]=
0<=d&&6>=d&&(0==b||6==b)||0<=b&&6>=b&&(0==d||6==d)||2<=d&&4>=d&&2<=b&&4>=b?!0:!1)},getBestMaskPattern:function(){for(var a=0,c=0,d=0;8>d;d++){this.makeImpl(!0,d);var b=j.getLostPoint(this);if(0==d||a>b)a=b,c=d}return c},createMovieClip:function(a,c,d){a=a.createEmptyMovieClip(c,d);this.make();for(c=0;c<this.modules.length;c++)for(var d=1*c,b=0;b<this.modules[c].length;b++){var e=1*b;this.modules[c][b]&&(a.beginFill(0,100),a.moveTo(e,d),a.lineTo(e+1,d),a.lineTo(e+1,d+1),a.lineTo(e,d+1),a.endFill())}return a},
setupTimingPattern:function(){for(var a=8;a<this.moduleCount-8;a++)null==this.modules[a][6]&&(this.modules[a][6]=0==a%2);for(a=8;a<this.moduleCount-8;a++)null==this.modules[6][a]&&(this.modules[6][a]=0==a%2)},setupPositionAdjustPattern:function(){for(var a=j.getPatternPosition(this.typeNumber),c=0;c<a.length;c++)for(var d=0;d<a.length;d++){var b=a[c],e=a[d];if(null==this.modules[b][e])for(var f=-2;2>=f;f++)for(var i=-2;2>=i;i++)this.modules[b+f][e+i]=-2==f||2==f||-2==i||2==i||0==f&&0==i?!0:!1}},setupTypeNumber:function(a){for(var c=
j.getBCHTypeNumber(this.typeNumber),d=0;18>d;d++){var b=!a&&1==(c>>d&1);this.modules[Math.floor(d/3)][d%3+this.moduleCount-8-3]=b}for(d=0;18>d;d++)b=!a&&1==(c>>d&1),this.modules[d%3+this.moduleCount-8-3][Math.floor(d/3)]=b},setupTypeInfo:function(a,c){for(var d=j.getBCHTypeInfo(this.errorCorrectLevel<<3|c),b=0;15>b;b++){var e=!a&&1==(d>>b&1);6>b?this.modules[b][8]=e:8>b?this.modules[b+1][8]=e:this.modules[this.moduleCount-15+b][8]=e}for(b=0;15>b;b++)e=!a&&1==(d>>b&1),8>b?this.modules[8][this.moduleCount-
b-1]=e:9>b?this.modules[8][15-b-1+1]=e:this.modules[8][15-b-1]=e;this.modules[this.moduleCount-8][8]=!a},mapData:function(a,c){for(var d=-1,b=this.moduleCount-1,e=7,f=0,i=this.moduleCount-1;0<i;i-=2)for(6==i&&i--;;){for(var g=0;2>g;g++)if(null==this.modules[b][i-g]){var n=!1;f<a.length&&(n=1==(a[f]>>>e&1));j.getMask(c,b,i-g)&&(n=!n);this.modules[b][i-g]=n;e--; -1==e&&(f++,e=7)}b+=d;if(0>b||this.moduleCount<=b){b-=d;d=-d;break}}}};o.PAD0=236;o.PAD1=17;o.createData=function(a,c,d){for(var c=p.getRSBlocks(a,
c),b=new t,e=0;e<d.length;e++){var f=d[e];b.put(f.mode,4);b.put(f.getLength(),j.getLengthInBits(f.mode,a));f.write(b)}for(e=a=0;e<c.length;e++)a+=c[e].dataCount;if(b.getLengthInBits()>8*a)throw Error("code length overflow. ("+b.getLengthInBits()+">"+8*a+")");for(b.getLengthInBits()+4<=8*a&&b.put(0,4);0!=b.getLengthInBits()%8;)b.putBit(!1);for(;!(b.getLengthInBits()>=8*a);){b.put(o.PAD0,8);if(b.getLengthInBits()>=8*a)break;b.put(o.PAD1,8)}return o.createBytes(b,c)};o.createBytes=function(a,c){for(var d=
0,b=0,e=0,f=Array(c.length),i=Array(c.length),g=0;g<c.length;g++){var n=c[g].dataCount,h=c[g].totalCount-n,b=Math.max(b,n),e=Math.max(e,h);f[g]=Array(n);for(var k=0;k<f[g].length;k++)f[g][k]=255&a.buffer[k+d];d+=n;k=j.getErrorCorrectPolynomial(h);n=(new q(f[g],k.getLength()-1)).mod(k);i[g]=Array(k.getLength()-1);for(k=0;k<i[g].length;k++)h=k+n.getLength()-i[g].length,i[g][k]=0<=h?n.get(h):0}for(k=g=0;k<c.length;k++)g+=c[k].totalCount;d=Array(g);for(k=n=0;k<b;k++)for(g=0;g<c.length;g++)k<f[g].length&&
(d[n++]=f[g][k]);for(k=0;k<e;k++)for(g=0;g<c.length;g++)k<i[g].length&&(d[n++]=i[g][k]);return d};s=4;for(var j={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,
78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(a){for(var c=a<<10;0<=j.getBCHDigit(c)-j.getBCHDigit(j.G15);)c^=j.G15<<j.getBCHDigit(c)-j.getBCHDigit(j.G15);return(a<<10|c)^j.G15_MASK},getBCHTypeNumber:function(a){for(var c=a<<12;0<=j.getBCHDigit(c)-
j.getBCHDigit(j.G18);)c^=j.G18<<j.getBCHDigit(c)-j.getBCHDigit(j.G18);return a<<12|c},getBCHDigit:function(a){for(var c=0;0!=a;)c++,a>>>=1;return c},getPatternPosition:function(a){return j.PATTERN_POSITION_TABLE[a-1]},getMask:function(a,c,d){switch(a){case 0:return 0==(c+d)%2;case 1:return 0==c%2;case 2:return 0==d%3;case 3:return 0==(c+d)%3;case 4:return 0==(Math.floor(c/2)+Math.floor(d/3))%2;case 5:return 0==c*d%2+c*d%3;case 6:return 0==(c*d%2+c*d%3)%2;case 7:return 0==(c*d%3+(c+d)%2)%2;default:throw Error("bad maskPattern:"+
a);}},getErrorCorrectPolynomial:function(a){for(var c=new q([1],0),d=0;d<a;d++)c=c.multiply(new q([1,l.gexp(d)],0));return c},getLengthInBits:function(a,c){if(1<=c&&10>c)switch(a){case 1:return 10;case 2:return 9;case s:return 8;case 8:return 8;default:throw Error("mode:"+a);}else if(27>c)switch(a){case 1:return 12;case 2:return 11;case s:return 16;case 8:return 10;default:throw Error("mode:"+a);}else if(41>c)switch(a){case 1:return 14;case 2:return 13;case s:return 16;case 8:return 12;default:throw Error("mode:"+
a);}else throw Error("type:"+c);},getLostPoint:function(a){for(var c=a.getModuleCount(),d=0,b=0;b<c;b++)for(var e=0;e<c;e++){for(var f=0,i=a.isDark(b,e),g=-1;1>=g;g++)if(!(0>b+g||c<=b+g))for(var h=-1;1>=h;h++)0>e+h||c<=e+h||0==g&&0==h||i==a.isDark(b+g,e+h)&&f++;5<f&&(d+=3+f-5)}for(b=0;b<c-1;b++)for(e=0;e<c-1;e++)if(f=0,a.isDark(b,e)&&f++,a.isDark(b+1,e)&&f++,a.isDark(b,e+1)&&f++,a.isDark(b+1,e+1)&&f++,0==f||4==f)d+=3;for(b=0;b<c;b++)for(e=0;e<c-6;e++)a.isDark(b,e)&&!a.isDark(b,e+1)&&a.isDark(b,e+
2)&&a.isDark(b,e+3)&&a.isDark(b,e+4)&&!a.isDark(b,e+5)&&a.isDark(b,e+6)&&(d+=40);for(e=0;e<c;e++)for(b=0;b<c-6;b++)a.isDark(b,e)&&!a.isDark(b+1,e)&&a.isDark(b+2,e)&&a.isDark(b+3,e)&&a.isDark(b+4,e)&&!a.isDark(b+5,e)&&a.isDark(b+6,e)&&(d+=40);for(e=f=0;e<c;e++)for(b=0;b<c;b++)a.isDark(b,e)&&f++;a=Math.abs(100*f/c/c-50)/5;return d+10*a}},l={glog:function(a){if(1>a)throw Error("glog("+a+")");return l.LOG_TABLE[a]},gexp:function(a){for(;0>a;)a+=255;for(;256<=a;)a-=255;return l.EXP_TABLE[a]},EXP_TABLE:Array(256),
LOG_TABLE:Array(256)},m=0;8>m;m++)l.EXP_TABLE[m]=1<<m;for(m=8;256>m;m++)l.EXP_TABLE[m]=l.EXP_TABLE[m-4]^l.EXP_TABLE[m-5]^l.EXP_TABLE[m-6]^l.EXP_TABLE[m-8];for(m=0;255>m;m++)l.LOG_TABLE[l.EXP_TABLE[m]]=m;q.prototype={get:function(a){return this.num[a]},getLength:function(){return this.num.length},multiply:function(a){for(var c=Array(this.getLength()+a.getLength()-1),d=0;d<this.getLength();d++)for(var b=0;b<a.getLength();b++)c[d+b]^=l.gexp(l.glog(this.get(d))+l.glog(a.get(b)));return new q(c,0)},mod:function(a){if(0>
this.getLength()-a.getLength())return this;for(var c=l.glog(this.get(0))-l.glog(a.get(0)),d=Array(this.getLength()),b=0;b<this.getLength();b++)d[b]=this.get(b);for(b=0;b<a.getLength();b++)d[b]^=l.gexp(l.glog(a.get(b))+c);return(new q(d,0)).mod(a)}};p.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],
[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,
116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,
43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,
3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,
55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,
45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];p.getRSBlocks=function(a,c){var d=p.getRsBlockTable(a,c);if(void 0==d)throw Error("bad rs block @ typeNumber:"+a+"/errorCorrectLevel:"+c);for(var b=d.length/3,e=[],f=0;f<b;f++)for(var h=d[3*f+0],g=d[3*f+1],j=d[3*f+2],l=0;l<h;l++)e.push(new p(g,j));return e};p.getRsBlockTable=function(a,c){switch(c){case 1:return p.RS_BLOCK_TABLE[4*(a-1)+0];case 0:return p.RS_BLOCK_TABLE[4*(a-1)+1];case 3:return p.RS_BLOCK_TABLE[4*
(a-1)+2];case 2:return p.RS_BLOCK_TABLE[4*(a-1)+3]}};t.prototype={get:function(a){return 1==(this.buffer[Math.floor(a/8)]>>>7-a%8&1)},put:function(a,c){for(var d=0;d<c;d++)this.putBit(1==(a>>>c-d-1&1))},getLengthInBits:function(){return this.length},putBit:function(a){var c=Math.floor(this.length/8);this.buffer.length<=c&&this.buffer.push(0);a&&(this.buffer[c]|=128>>>this.length%8);this.length++}};"string"===typeof h&&(h={text:h});h=r.extend({},{render:"canvas",width:256,height:256,typeNumber:-1,
correctLevel:2,background:"#ffffff",foreground:"#000000"},h);return this.each(function(){var a;if("canvas"==h.render){a=new o(h.typeNumber,h.correctLevel);a.addData(h.text);a.make();var c=document.createElement("canvas");c.width=h.width;c.height=h.height;for(var d=c.getContext("2d"),b=h.width/a.getModuleCount(),e=h.height/a.getModuleCount(),f=0;f<a.getModuleCount();f++)for(var i=0;i<a.getModuleCount();i++){d.fillStyle=a.isDark(f,i)?h.foreground:h.background;var g=Math.ceil((i+1)*b)-Math.floor(i*b),
j=Math.ceil((f+1)*b)-Math.floor(f*b);d.fillRect(Math.round(i*b),Math.round(f*e),g,j)}}else{a=new o(h.typeNumber,h.correctLevel);a.addData(h.text);a.make();c=r("<table></table>").css("width",h.width+"px").css("height",h.height+"px").css("border","0px").css("border-collapse","collapse").css("background-color",h.background);d=h.width/a.getModuleCount();b=h.height/a.getModuleCount();for(e=0;e<a.getModuleCount();e++){f=r("<tr></tr>").css("height",b+"px").appendTo(c);for(i=0;i<a.getModuleCount();i++)r("<td></td>").css("width",
d+"px").css("background-color",a.isDark(e,i)?h.foreground:h.background).appendTo(f)}}a=c;jQuery(a).appendTo(this)})}})(jQuery);

View File

@ -0,0 +1,22 @@
{if !$GLOBAL.config.website.api.disabled}
{include file="global/block_header.tpl" BLOCK_HEADER="API String"}
<p>This code will allow you to import the full API string into your mobile application.</p>
<script type="text/javascript" src="{$PATH}/js/jquery.qrcode.min.js"></script>
<script type="text/javascript">
{literal}
//Wrap it within $(document).ready() to invoke the function after DOM loads.
$(document).ready(function(){
$('#qrcodeholder').qrcode({
text : "{/literal}|http{if $smarty.server.HTTPS eq '1'}s{/if}://{$smarty.server.SERVER_NAME}{$smarty.server.PHP_SELF}?page=api|{$GLOBAL.userdata.api_key}|{$GLOBAL.userdata.id}|{literal}",
render : "canvas", // 'canvas' or 'table'. Default value is 'canvas'
background : "#ffffff",
foreground : "#000000",
width : 250,
height: 250
});
});
{/literal}
</script>
<div id="qrcodeholder"></div>
{include file="global/block_footer.tpl"}
{/if}

View File

@ -1,3 +1,22 @@
{include file="global/block_header.tpl" BLOCK_HEADER="Transaction Summary"}
<table>
<thead>
<tr>
{foreach $SUMMARY as $type=>$total}
<th>{$type}</th>
{/foreach}
</tr>
</thead>
<tbody>
<tr>
{foreach $SUMMARY as $type=>$total}
<td class="right">{$total}</td>
{/foreach}
</tr>
</tbody>
</table>
{include file="global/block_footer.tpl"}
{include file="global/block_header.tpl" ALIGN="left" BLOCK_STYLE="width: 23%" BLOCK_HEADER="Transaction Filter"}
<form action="{$smarty.server.PHP_SELF}">
<input type="hidden" name="page" value="{$smarty.request.page}" />
@ -25,11 +44,11 @@
</td>
</tr>
<tr>
<td class="left">TX Type</td>
<td class="left">Type</td>
<td class="right">{html_options name="filter[type]" options=$TRANSACTIONTYPES selected=$smarty.request.filter.type|default:""}</td>
</tr>
<tr>
<td class="left">TX Status</td>
<td class="left">Status</td>
<td class="right">{html_options name="filter[status]" options=$TXSTATUS selected=$smarty.request.filter.status|default:""}</td>
</tr>
<tr>
@ -77,7 +96,7 @@
<font size="1px">({$TRANSACTIONS[transaction].confirmations|default:"n/a"})</font>
</td>
<td>{$TRANSACTIONS[transaction].coin_address}</td>
<td>{if $TRANSACTIONS[transaction].height == 0}n/a{else}{if $GLOBAL.blockexplorer}<a href="{$GLOBAL.blockexplorer}{$TRANSACTIONS[transaction].blockhash}">{$TRANSACTIONS[transaction].height}</a>{else}{$TRANSACTIONS[transaction].height}{/if}{/if}</td>
<td>{if $TRANSACTIONS[transaction].height == 0}n/a{else}{if $GLOBAL.website.blockexplorer.url}<a href="{$GLOBAL.website.blockexplorer.url}{$TRANSACTIONS[transaction].blockhash}">{$TRANSACTIONS[transaction].height}</a>{else}{$TRANSACTIONS[transaction].height}{/if}{/if}</td>
<td><font color="{if $TRANSACTIONS[transaction].type == 'Credit' or $TRANSACTIONS[transaction].type == 'Credit_PPS' or $TRANSACTIONS[transaction].type == 'Bonus'}green{else}red{/if}">{$TRANSACTIONS[transaction].amount|number_format:"8"}</td>
</tr>
{/section}

View File

@ -18,9 +18,9 @@
<td class="center">{if $SETTINGS.$TAB[setting].tooltip|default}<span id='tt'><img src='{$PATH}/images/questionmark.png' height='15px' width='15px' title='{$SETTINGS.$TAB[setting].tooltip}.'></span>{/if}</td>
<td>
{if $SETTINGS.$TAB[setting].type == 'select'}
{html_options name="data[{$SETTINGS.$TAB[setting].name}]" options=$SETTINGS.$TAB[setting].options selected=$SETTINGS.$TAB[setting].value|default:"0"}
{html_options name="data[{$SETTINGS.$TAB[setting].name}]" options=$SETTINGS.$TAB[setting].options selected=$SETTINGS.$TAB[setting].value|default:$SETTINGS.$TAB[setting].default}
{else if $SETTINGS.$TAB[setting].type == 'text'}
<input type="text" size="{$SETTINGS.$TAB[setting].size}" name="data[{$SETTINGS.$TAB[setting].name}]" value="{$SETTINGS.$TAB[setting].value|default}" />
<input type="text" size="{$SETTINGS.$TAB[setting].size}" name="data[{$SETTINGS.$TAB[setting].name}]" value="{$SETTINGS.$TAB[setting].value|default:$SETTINGS.$TAB[setting].default}" />
{else}
Unknown option type: {$SETTINGS.$TAB[setting].type}
{/if}

View File

@ -1,3 +1,22 @@
{include file="global/block_header.tpl" BLOCK_HEADER="Transaction Summary"}
<table>
<thead>
<tr>
{foreach $SUMMARY as $type=>$total}
<th>{$type}</th>
{/foreach}
</tr>
</thead>
<tbody>
<tr>
{foreach $SUMMARY as $type=>$total}
<td class="right">{$total}</td>
{/foreach}
</tr>
</tbody>
</table>
{include file="global/block_footer.tpl"}
{include file="global/block_header.tpl" ALIGN="left" BLOCK_STYLE="width: 23%" BLOCK_HEADER="Transaction Filter"}
<form action="{$smarty.server.PHP_SELF}">
<input type="hidden" name="page" value="{$smarty.request.page}" />
@ -25,11 +44,11 @@
</td>
</tr>
<tr>
<td class="left">TX Type</td>
<td class="left">Type</td>
<td class="right">{html_options name="filter[type]" options=$TRANSACTIONTYPES selected=$smarty.request.filter.type|default:""}</td>
</tr>
<tr>
<td class="left">TX Status</td>
<td class="left">Status</td>
<td class="right">{html_options name="filter[status]" options=$TXSTATUS selected=$smarty.request.filter.status|default:""}</td>
</tr>
<tr>
@ -85,7 +104,7 @@
<font size="1px">({$TRANSACTIONS[transaction].confirmations|default:"n/a"})</font>
</td>
<td>{$TRANSACTIONS[transaction].coin_address}</td>
<td>{if $TRANSACTIONS[transaction].height == 0}n/a{else}{if $GLOBAL.blockexplorer}<a href="{$GLOBAL.blockexplorer}{$TRANSACTIONS[transaction].blockhash}">{$TRANSACTIONS[transaction].height}</a>{else}{$TRANSACTIONS[transaction].height}{/if}{/if}</td>
<td>{if $TRANSACTIONS[transaction].height == 0}n/a{else}{if $GLOBAL.website.blockexplorer.url}<a href="{$GLOBAL.website.blockexplorer.url}{$TRANSACTIONS[transaction].blockhash}">{$TRANSACTIONS[transaction].height}</a>{else}{$TRANSACTIONS[transaction].height}{/if}{/if}</td>
<td><font color="{if $TRANSACTIONS[transaction].type == 'Credit' or $TRANSACTIONS[transaction].type == 'Credit_PPS' or $TRANSACTIONS[transaction].type == 'Bonus'}green{else}red{/if}">{$TRANSACTIONS[transaction].amount|number_format:"8"}</td>
</tr>
{/section}

View File

@ -8,6 +8,10 @@
<th>Locked for users</th>
<td class="right">{$LOCKED|number_format:"8"}</td>
</tr>
<tr>
<th>Unconfirmed</th>
<td class="right">{$UNCONFIRMED|number_format:"8"}</td>
</tr>
<tr>
<th>Liquid Assets</th>
<td class="right">{($BALANCE - $LOCKED)|number_format:"8"}</td>

View File

@ -1,5 +1,5 @@
<div id="siteinfo">{$GLOBAL.websitename}<br/>
<span class="slogan">{$GLOBAL.slogan}</span>
<div id="siteinfo">{$GLOBAL.website.name|default:"The Pool"}<br/>
<span class="slogan">{$GLOBAL.website.slogan|default:"Resistance is Futile"}</span>
</div>
<div id="ministats">
<table border="0">

View File

@ -8,6 +8,7 @@
<li><a href="{$smarty.server.PHP_SELF}?page=account&action=transactions">Transactions</a></li>
{if !$GLOBAL.config.disable_notifications}<li><a href="{$smarty.server.PHP_SELF}?page=account&action=notifications">Notifications</a></li>{/if}
{if !$GLOBAL.config.disable_invitations}<li><a href="{$smarty.server.PHP_SELF}?page=account&action=invitations">Invitations</a></li>{/if}
<li><a href="{$smarty.server.PHP_SELF}?page=account&action=qrcode">QR Codes</a></li>
</ul>
</li>
{/if}
@ -34,10 +35,10 @@
{else}
<li><a href="{$smarty.server.PHP_SELF}?page=statistics">Statistics</a>
<ul>
{if $GLOBAL.config.website.acl.statistics.pool == 'public'}
{if $GLOBAL.acl.pool.statistics}
<li><a href="{$smarty.server.PHP_SELF}?page=statistics&action=pool">Pool Stats</a></li>
{/if}
{if $GLOBAL.config.website.acl.statistics.blocks == 'public'}
{if $GLOBAL.acl.block.statistics}
<li><a href="{$smarty.server.PHP_SELF}?page=statistics&action=blocks">Block Stats</a></li>
{/if}
</ul>
@ -47,7 +48,7 @@
<li><a href="{$smarty.server.PHP_SELF}?page=about&action=pool">About</a>
<ul>
<li><a href="{$smarty.server.PHP_SELF}?page=about&action=pool">This Pool</a></li>
{if !$GLOBAL.config.website.api.disabled}<li><a href="{$smarty.server.PHP_SELF}?page=about&action=api">API Reference</a></li>{/if}
{if !$GLOBAL.website.api.disabled}<li><a href="{$smarty.server.PHP_SELF}?page=about&action=api">API Reference</a></li>{/if}
<li><a href="{$smarty.server.PHP_SELF}?page=about&action=donors">Pool Donors</a></li>
</ul>
</li>

View File

@ -28,6 +28,10 @@
<td><b>Pool Valid</b></td>
<td class="right"><i>{$GLOBAL.roundshares.valid|number_format}</i></td>
</tr>
<tr>
<td><b>Your Valid</b></td>
<td class="right"><i>{$GLOBAL.userdata.shares.valid|number_format}</i></td>
</tr>
<tr>
<td><b>Pool Invalid</b></td>
<td class="right"><i>{$GLOBAL.roundshares.invalid|number_format}</i>{if $GLOBAL.roundshares.valid > 0}<font size='1px'> ({($GLOBAL.roundshares.invalid / ($GLOBAL.roundshares.valid + $GLOBAL.roundshares.invalid) * 100)|number_format:"2"}%)</font>{/if}</td>

View File

@ -1,7 +1,7 @@
<!DOCTYPE unspecified PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>{$GLOBAL.config.website.title}</title>
<title>{$GLOBAL.website.title}</title>
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="favicon.ico" />

View File

@ -32,7 +32,7 @@ target and network difficulty and assuming a zero variance scenario.
{include file="global/block_header.tpl" BLOCK_HEADER="Last $BLOCKLIMIT Blocks Found" BLOCK_STYLE="clear:none;"}
<center>
<table width="100%" style="font-size:13px;">
<table width="100%" class="sortable" style="font-size:13px;">
<thead>
<tr style="background-color:#B6DAFF;">
<th class="center">Block</th>
@ -47,10 +47,19 @@ target and network difficulty and assuming a zero variance scenario.
</tr>
</thead>
<tbody>
{assign var=rank value=1}
{assign var=count value=0}
{assign var=totalexpectedshares value=0}
{assign var=totalshares value=0}
{assign var=totalpercentage value=0}
{section block $BLOCKSFOUND}
{assign var="totalshares" value=$totalshares+$BLOCKSFOUND[block].shares}
{assign var="count" value=$count+1}
<tr class="{cycle values="odd,even"}">
<td class="center"><a href="{$GLOBAL.blockexplorer}{$BLOCKSFOUND[block].blockhash}" target="_blank">{$BLOCKSFOUND[block].height}</a></td>
{if ! $GLOBAL.website.blockexplorer.disabled}
<td class="center"><a href="{$GLOBAL.website.blockexplorer.url}{$BLOCKSFOUND[block].blockhash}" target="_blank">{$BLOCKSFOUND[block].height}</a></td>
{else}
<td class="center">{$BLOCKSFOUND[block].height}</td>
{/if}
<td class="center">
{if $BLOCKSFOUND[block].confirmations >= $GLOBAL.confirmations}
<font color="green">Confirmed</font>
@ -63,15 +72,23 @@ target and network difficulty and assuming a zero variance scenario.
<td class="right">{$BLOCKSFOUND[block].amount|number_format:"2"}</td>
<td class="right">
{math assign="estshares" equation="(pow(2,32 - targetdiff) * blockdiff)" targetdiff=$GLOBAL.config.targetdiff blockdiff=$BLOCKSFOUND[block].difficulty}
{assign var="totalexpectedshares" value=$totalexpectedshares+$estshares}
{$estshares|number_format}
</td>
<td class="right">{$BLOCKSFOUND[block].shares|number_format}</td>
<td class="right">
{math assign="percentage" equation="shares / estshares * 100" shares=$BLOCKSFOUND[block].shares estshares=$estshares}
{assign var="totalpercentage" value=$totalpercentage+$percentage}
<font color="{if ($percentage <= 100)}green{else}red{/if}">{$percentage|number_format:"2"}</font>
</td>
</tr>
{/section}
<tr>
<td colspan="6" class="right"><b>Totals</b></td>
<td class="right">{$totalexpectedshares|number_format}</td>
<td class="right">{$totalshares|number_format}</td>
<td class="right"><font color="{if (($totalpercentage / $count) <= 100)}green{else}red{/if}">{($totalpercentage / $count)|number_format:"2"}</font>
</tr>
</tbody>
</table>
</center>

View File

@ -13,7 +13,11 @@
{assign var=rank value=1}
{section block $BLOCKSFOUND}
<tr class="{cycle values="odd,even"}">
<td class="center"><a href="{$GLOBAL.blockexplorer}{$BLOCKSFOUND[block].blockhash}" target="_new">{$BLOCKSFOUND[block].height}</a></td>
{if ! $GLOBAL.website.blockexplorer.disabled}
<td class="center"><a href="{$GLOBAL.website.blockexplorer.url}{$BLOCKSFOUND[block].blockhash}" target="_new">{$BLOCKSFOUND[block].height}</a></td>
{else}
<td class="center">{$BLOCKSFOUND[block].height}</td>
{/if}
<td>{if $BLOCKSFOUND[block].is_anonymous|default:"0" == 1}anonymous{else}{$BLOCKSFOUND[block].finder|default:"unknown"|escape}{/if}</td>
<td class="center">{$BLOCKSFOUND[block].time|date_format:"%d/%m %H:%M:%S"}</td>
<td class="right">{$BLOCKSFOUND[block].shares|number_format}</td>

View File

@ -5,32 +5,23 @@
<thead>
<tr>
<td></td>
{for $i=date('G') to 23}
<th scope="col">{$i}:00</th>
{/for}
{for $i=0 to date('G', time () - 60 * 60)}
<th scope="col">{$i}:00</th>
{/for}
{foreach $YOURHASHRATES as $hour=>$hashrate}
<th scope="col">{$hour|default:"0"}:00</th>
{/foreach}
</tr>
</thead>
<tbody>
<tr>
<th scope="row">{$smarty.session.USERDATA.username}</th>
{for $i=date('G') to 23}
<td>{$YOURHASHRATES.$i|default:"0"}</td>
{/for}
{for $i=0 to date('G', time() - 60 * 60)}
<td>{$YOURHASHRATES.$i|default:"0"}</td>
{/for}
{foreach $YOURHASHRATES as $hour=>$hashrate}
<td>{$hashrate|default:"0"}</td>
{/foreach}
</tr>
<tr>
<th scope="row">Pool</th>
{for $i=date('G') to 23}
<td>{$POOLHASHRATES.$i|default:"0"}</td>
{/for}
{for $i=0 to date('G', time() - 60 * 60)}
<td>{$POOLHASHRATES.$i - $YOURHASHRATES.$i|default:"0"}</td>
{/for}
{foreach $POOLHASHRATES as $hour=>$hashrate}
<td>{$hashrate|default:"0"}</td>
{/foreach}
</tr>
</tbody>
</table>

View File

@ -5,23 +5,17 @@
<thead>
<tr>
<td></td>
{for $i=date('G') to 23}
<th scope="col">{$i}:00</th>
{/for}
{for $i=0 to date('G', time () - 60 * 60)}
<th scope="col">{$i}:00</th>
{/for}
{foreach $YOURHASHRATES as $hour=>$hashrate}
<th scope="col">{$hour|default:"0"}:00</th>
{/foreach}
</tr>
</thead>
<tbody>
<tr>
<th scope="row">{$smarty.session.USERDATA.username}</th>
{for $i=date('G') to 23}
<td>{$YOURHASHRATES.$i|default:"0"}</td>
{/for}
{for $i=0 to date('G', time() - 60 * 60)}
<td>{$YOURHASHRATES.$i|default:"0"}</td>
{/for}
{foreach $YOURHASHRATES as $hour=>$hashrate}
<td>{$hashrate|default:"0"}</td>
{/foreach}
</tr>
</tbody>
</table>

View File

@ -5,23 +5,17 @@
<thead>
<tr>
<td></td>
{for $i=date('G') to 23}
<th scope="col">{$i}:00</th>
{/for}
{for $i=0 to date('G', time () - 60 * 60)}
<th scope="col">{$i}:00</th>
{/for}
{foreach $POOLHASHRATES as $hour=>$hashrate}
<th scope="col">{$hour|default:"0"}:00</th>
{/foreach}
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Pool</th>
{for $i=date('G') to 23}
<td>{$POOLHASHRATES.$i|default:"0"}</td>
{/for}
{for $i=0 to date('G', time() - 60 * 60)}
<td>{$POOLHASHRATES.$i|default:"0"}</td>
{/for}
{foreach $POOLHASHRATES as $hour=>$hashrate}
<td>{$hashrate|default:"0"}</td>
{/foreach}
</tr>
</tbody>
</table>

View File

@ -19,10 +19,10 @@
<td class="leftheader">Current Active Workers</td>
<td>{$GLOBAL.workers}</td>
</tr>
{if $GLOBAL.blockexplorer}
{if $GLOBAL.website.blockexplorer.url}
<tr>
<td class="leftheader">Next Network Block</td>
<td>{$CURRENTBLOCK + 1} &nbsp;&nbsp;<font size="1"> (Current: <a href="{$GLOBAL.blockexplorer}{$CURRENTBLOCKHASH}" target="_new">{$CURRENTBLOCK})</a></font></td>
<td>{$CURRENTBLOCK + 1} &nbsp;&nbsp;<font size="1"> (Current: <a href="{$GLOBAL.website.blockexplorer.url}{$CURRENTBLOCKHASH}" target="_new">{$CURRENTBLOCK})</a></font></td>
</tr>
{else}
<tr>
@ -32,12 +32,12 @@
{/if}
<tr>
<td class="leftheader">Last Block Found</td>
<td>{if $GLOBAL.blockexplorer}<a href="{$GLOBAL.blockexplorer}{$LASTBLOCKHASH}" target="_new">{$LASTBLOCK|default:"0"}</a>{else}{$LASTBLOCK|default:"0"}{/if}</td>
<td>{if $GLOBAL.website.blockexplorer.url}<a href="{$GLOBAL.website.blockexplorer.url}{$LASTBLOCKHASH}" target="_new">{$LASTBLOCK|default:"0"}</a>{else}{$LASTBLOCK|default:"0"}{/if}</td>
</tr>
<tr>
<td class="leftheader">Current Difficulty</td>
{if $GLOBAL.chaininfo}
<td><a href="{$GLOBAL.chaininfo}" target="_new"><font size="2">{$DIFFICULTY}</font></a></td>
{if ! $GLOBAL.website.chaininfo.disabled}
<td><a href="{$GLOBAL.website.chaininfo.url}" target="_new"><font size="2">{$DIFFICULTY}</font></a></td>
{else}
<td><font size="2">{$DIFFICULTY}</font></td>
{/if}
@ -56,7 +56,7 @@
</tr>
</tbody>
</table>
{if !$GLOBAL.config.website.api.disabled}<li>These stats are also available in JSON format <a href="{$smarty.server.PHP_SELF}?page=api&action=getpoolstatus&api_key={$GLOBAL.userdata.api_key}">HERE</a></li>{/if}
{if !$GLOBAL.website.api.disabled}<li>These stats are also available in JSON format <a href="{$smarty.server.PHP_SELF}?page=api&action=getpoolstatus&api_key={$GLOBAL.userdata.api_key}">HERE</a></li>{/if}
{include file="global/block_footer.tpl"}

View File

@ -7,9 +7,7 @@
<div class="block_content" style="padding:10px;">
<p>This product comes 'as-is' without any warranty. Please check the Apache License, Version 2.0, for details.</p>
<p>If you would like to get in touch you can find me on Freenode IRC @ #mmcfe-ng.</p>
</div> <!-- nested block ends -->
</div>
<div class="bendl"></div>
<div class="bendr"></div>
</div>

View File

@ -9,7 +9,7 @@
{assign var="username" value="."|escape|explode:$WORKERS[worker].username:2}
<tr>
<td align="left"{if $WORKERS[worker].active} style="color: orange"{/if}>{$username.0|escape}.{$username.1|escape}</td>
<td align="center"><img src="{$PATH}/images/{if $WORKERS[worker].active}success{else}error{/if}.gif" /></td>
<td align="center"><img src="{$PATH}/images/{if $WORKERS[worker].hashrate > 0}success{else}error{/if}.gif" /></td>
<td align="right">{$WORKERS[worker].hashrate|number_format}</td>
</tr>
{/section}

View File

@ -1 +1 @@
<h2>{$GLOBAL.websitename}</h2>
<h2>{$GLOBAL.website.name|default:"The Pool"}</h2>

View File

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<title>{$GLOBAL.config.website.title}</title>
<title>{$GLOBAL.website.title}</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="{$PATH}/css/jquery.mobile-1.3.2.min.css" />
<script src="{$PATH}/js/jquery-1.9.1.min.js"></script>

View File

@ -46,7 +46,7 @@ target and network difficulty and assuming a zero variance scenario.
{assign var=rank value=1}
{section block $BLOCKSFOUND}
<tr class="{cycle values="odd,even"}">
<td class="center"><a href="{$GLOBAL.blockexplorer}{$BLOCKSFOUND[block].height}" target="_blank">{$BLOCKSFOUND[block].height}</a></td>
<td class="center"><a href="{$GLOBAL.website.blockexplorer.url}{$BLOCKSFOUND[block].height}" target="_blank">{$BLOCKSFOUND[block].height}</a></td>
<td class="center">
{if $BLOCKSFOUND[block].confirmations >= $GLOBAL.confirmations}
<font color="green">Confirmed</font>

View File

@ -12,7 +12,7 @@
{assign var=rank value=1}
{section block $BLOCKSFOUND}
<tr class="{cycle values="odd,even"}">
<th><a href="{$GLOBAL.blockexplorer}{$BLOCKSFOUND[block].height}" target="_blank">{$BLOCKSFOUND[block].height}</a></th>
<th><a href="{$GLOBAL.website.blockexplorer.url}{$BLOCKSFOUND[block].height}" target="_blank">{$BLOCKSFOUND[block].height}</a></th>
<td>{if $BLOCKSFOUND[block].is_anonymous|default:"0" == 1}anonymous{else}{$BLOCKSFOUND[block].finder|default:"unknown"|escape}{/if}</td>
<td>{$BLOCKSFOUND[block].time|date_format:"%d/%m %H:%M"}</td>
<td align="right">{$BLOCKSFOUND[block].shares|number_format}</td>

View File

@ -24,10 +24,10 @@
<td class="leftheader">Current Active Workers</td>
<td>{$GLOBAL.workers}</td>
</tr>
{if $GLOBAL.blockexplorer}
{if $GLOBAL.website.blockexplorer.url}
<tr>
<td class="leftheader">Next Network Block</td>
<td>{$CURRENTBLOCK + 1} &nbsp;&nbsp;<font size="1"> (Current: <a href="{$GLOBAL.blockexplorer}{$CURRENTBLOCKHASH}" target="_new">{$CURRENTBLOCK})</a></font></td>
<td>{$CURRENTBLOCK + 1} &nbsp;&nbsp;<font size="1"> (Current: <a href="{$GLOBAL.website.blockexplorer.url}{$CURRENTBLOCKHASH}" target="_new">{$CURRENTBLOCK})</a></font></td>
</tr>
{else}
<tr>
@ -37,12 +37,12 @@
{/if}
<tr>
<td class="leftheader">Last Block Found</td>
<td>{if $GLOBAL.blockexplorer}<a href="{$GLOBAL.blockexplorer}{$LASTBLOCKHASH}" target="_new">{$LASTBLOCK|default:"0"}</a>{else}{$LASTBLOCK|default:"0"}{/if}</td>
<td>{if $GLOBAL.website.blockexplorer.url}<a href="{$GLOBAL.website.blockexplorer.url}{$LASTBLOCKHASH}" target="_new">{$LASTBLOCK|default:"0"}</a>{else}{$LASTBLOCK|default:"0"}{/if}</td>
</tr>
{if $GLOBAL.chaininfo}
{if ! $GLOBAL.website.chaininfo.disabled}
<tr>
<td class="leftheader">Current Difficulty</td>
<td><a href="{$GLOBAL.chaininfo}" target="_new"><font size="2">{$DIFFICULTY}</font></a></td>
<td><a href="{$GLOBAL.website.chaininfo.url}" target="_new"><font size="2">{$DIFFICULTY}</font></a></td>
</tr>
{/if}
<tr>