Merge branch 'next' of github.com:TheSerapher/php-mmcfe-ng into next
This commit is contained in:
commit
00f7f3fadf
@ -69,6 +69,7 @@ Features
|
|||||||
|
|
||||||
The following feature have been implemented so far:
|
The following feature have been implemented so far:
|
||||||
|
|
||||||
|
* Fully re-written GUI with [Smarty][2] templates
|
||||||
* Mobile WebUI
|
* Mobile WebUI
|
||||||
* Reward Systems
|
* Reward Systems
|
||||||
* Propotional
|
* Propotional
|
||||||
@ -142,3 +143,4 @@ limitations under the License.
|
|||||||
|
|
||||||
|
|
||||||
[1]: https://github.com/TheSerapher/php-mmcfe-ng/issues "Issue"
|
[1]: https://github.com/TheSerapher/php-mmcfe-ng/issues "Issue"
|
||||||
|
[2]: http://www.smarty.net/docs/en/ "Smarty"
|
||||||
|
|||||||
@ -108,8 +108,8 @@ class Block {
|
|||||||
* @param limit int Maximum blocks to check
|
* @param limit int Maximum blocks to check
|
||||||
* @return data float Float value of average shares
|
* @return data float Float value of average shares
|
||||||
**/
|
**/
|
||||||
public function getAvgBlockShares($limit=10) {
|
public function getAvgBlockShares($limit=1) {
|
||||||
$stmt = $this->mysqli->prepare("SELECT AVG(shares) AS average FROM $this->table LIMIT ?");
|
$stmt = $this->mysqli->prepare("SELECT AVG(x.shares) AS average FROM (SELECT shares FROM $this->table ORDER BY height DESC LIMIT ?) AS x");
|
||||||
if ($this->checkStmt($stmt) && $stmt->bind_param('i', $limit) && $stmt->execute() && $result = $stmt->get_result())
|
if ($this->checkStmt($stmt) && $stmt->bind_param('i', $limit) && $stmt->execute() && $result = $stmt->get_result())
|
||||||
return (float)$result->fetch_object()->average;
|
return (float)$result->fetch_object()->average;
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@ -48,6 +48,8 @@ class Tools extends Base {
|
|||||||
return 'coinchose';
|
return 'coinchose';
|
||||||
} else if (preg_match('/btc-e.com/', $url)) {
|
} else if (preg_match('/btc-e.com/', $url)) {
|
||||||
return 'btce';
|
return 'btce';
|
||||||
|
} else if (preg_match('/cryptsy.com/', $url)) {
|
||||||
|
return 'cryptsy';
|
||||||
}
|
}
|
||||||
$this->setErrorMessage("API URL unknown");
|
$this->setErrorMessage("API URL unknown");
|
||||||
return false;
|
return false;
|
||||||
@ -73,6 +75,9 @@ class Tools extends Base {
|
|||||||
case 'btce':
|
case 'btce':
|
||||||
return $aData['ticker']['last'];
|
return $aData['ticker']['last'];
|
||||||
break;
|
break;
|
||||||
|
case 'cryptsy':
|
||||||
|
return $aData['return']['markets'][$strCurrency]['lasttradeprice'];
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
// Catchall, we have no data extractor for this API url
|
// Catchall, we have no data extractor for this API url
|
||||||
$this->setErrorMessage("Undefined API to getPrice() on URL " . $this->config['price']['url']);
|
$this->setErrorMessage("Undefined API to getPrice() on URL " . $this->config['price']['url']);
|
||||||
|
|||||||
@ -235,7 +235,7 @@ class Transaction {
|
|||||||
FROM $this->table AS t
|
FROM $this->table AS t
|
||||||
LEFT JOIN " . $this->block->getTableName() . " AS b ON t.block_id = b.id
|
LEFT JOIN " . $this->block->getTableName() . " AS b ON t.block_id = b.id
|
||||||
WHERE
|
WHERE
|
||||||
t.type IN ('Credit','Bonus') AND b.confirmations < ?
|
t.type IN ('Credit','Bonus') AND b.confirmations < ? AND b.confirmations >= 0
|
||||||
AND t.account_id = ?
|
AND t.account_id = ?
|
||||||
) AS t4,
|
) AS t4,
|
||||||
(
|
(
|
||||||
@ -244,7 +244,7 @@ class Transaction {
|
|||||||
LEFT JOIN " . $this->block->getTableName() . " AS b ON t.block_id = b.id
|
LEFT JOIN " . $this->block->getTableName() . " AS b ON t.block_id = b.id
|
||||||
WHERE
|
WHERE
|
||||||
(
|
(
|
||||||
t.type IN ('Donation','Fee') AND b.confirmations < ?
|
t.type IN ('Donation','Fee') AND b.confirmations < ? AND b.confirmations >= 0
|
||||||
)
|
)
|
||||||
AND t.account_id = ?
|
AND t.account_id = ?
|
||||||
) AS t5,
|
) AS t5,
|
||||||
|
|||||||
@ -73,6 +73,11 @@ $config['wallet']['password'] = 'testnet';
|
|||||||
* url = `http://www.coinchoose.com`
|
* url = `http://www.coinchoose.com`
|
||||||
* target = `/api.php`
|
* target = `/api.php`
|
||||||
* currency = `BTC`
|
* currency = `BTC`
|
||||||
|
*
|
||||||
|
* Optional (cryptsy.com):
|
||||||
|
* url = `https://www.cryptsy.com`
|
||||||
|
* target = `/api.php?method=marketdata`
|
||||||
|
* currency = `BTC`
|
||||||
**/
|
**/
|
||||||
$config['price']['url'] = 'https://btc-e.com';
|
$config['price']['url'] = 'https://btc-e.com';
|
||||||
$config['price']['target'] = '/api/2/ltc_usd/ticker';
|
$config['price']['target'] = '/api/2/ltc_usd/ticker';
|
||||||
|
|||||||
@ -62,7 +62,7 @@
|
|||||||
{assign var=has_unconfirmed value=false}
|
{assign var=has_unconfirmed value=false}
|
||||||
{section transaction $TRANSACTIONS}
|
{section transaction $TRANSACTIONS}
|
||||||
{if
|
{if
|
||||||
(($TRANSACTIONS[transaction].type == 'Credit' or $TRANSACTIONS[transaction].type == 'Bonus' or $TRANSACTIONS[transaction].type == 'Donation' or $TRANSACTIONS[transaction].type == 'Fee') and $TRANSACTIONS[transaction].confirmations < $GLOBAL.confirmations)
|
(($TRANSACTIONS[transaction].type == 'Credit' or $TRANSACTIONS[transaction].type == 'Bonus' or $TRANSACTIONS[transaction].type == 'Donation' or $TRANSACTIONS[transaction].type == 'Fee') and $TRANSACTIONS[transaction].confirmations < $GLOBAL.confirmations and $TRANSACTIONS[transaction].confirmations >= 0)
|
||||||
}
|
}
|
||||||
{assign var=has_unconfirmed value=true}
|
{assign var=has_unconfirmed value=true}
|
||||||
<tr class="{cycle values="odd,even"}">
|
<tr class="{cycle values="odd,even"}">
|
||||||
@ -116,7 +116,7 @@
|
|||||||
<td>{$TRANSACTIONS[transaction].type}</td>
|
<td>{$TRANSACTIONS[transaction].type}</td>
|
||||||
<td>{$TRANSACTIONS[transaction].coin_address}</td>
|
<td>{$TRANSACTIONS[transaction].coin_address}</td>
|
||||||
<td>{if $TRANSACTIONS[transaction].height == 0}n/a{else}{$TRANSACTIONS[transaction].height}{/if}</td>
|
<td>{if $TRANSACTIONS[transaction].height == 0}n/a{else}{$TRANSACTIONS[transaction].height}{/if}</td>
|
||||||
<td><font color="{if $TRANSACTIONS[transaction].type == 'Orphan_Credit' or $TRANSACTIONS[transaction].type == 'Orphan_Bonus'}green{else}red{/if}">{$TRANSACTIONS[transaction].amount|number_format:"8"}</td>
|
<td><font color="{if $TRANSACTIONS[transaction].type == 'Credit' or $TRANSACTIONS[transaction].type == 'Bonus'}green{else}red{/if}">{$TRANSACTIONS[transaction].amount|number_format:"8"}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{if $TRANSACTIONS[transaction].type == 'Credit' or $TRANSACTIONS[transaction].type == 'Bonus'}
|
{if $TRANSACTIONS[transaction].type == 'Credit' or $TRANSACTIONS[transaction].type == 'Bonus'}
|
||||||
{assign var="orphan_credits" value="`$orphan_credits|default:"0"+$TRANSACTIONS[transaction].amount`"}
|
{assign var="orphan_credits" value="`$orphan_credits|default:"0"+$TRANSACTIONS[transaction].amount`"}
|
||||||
|
|||||||
@ -68,7 +68,7 @@
|
|||||||
<tbody style="font-size:12px;">
|
<tbody style="font-size:12px;">
|
||||||
{assign var=unconfirmed value=0}
|
{assign var=unconfirmed value=0}
|
||||||
{section transaction $TRANSACTIONS}
|
{section transaction $TRANSACTIONS}
|
||||||
{if ($TRANSACTIONS[transaction].type == 'Credit' or $TRANSACTIONS[transaction].type == 'Bonus' or $TRANSACTIONS[transaction].type == 'Donation' or $TRANSACTIONS[transaction].type == 'Fee') and $TRANSACTIONS[transaction].confirmations < $GLOBAL.confirmations}
|
{if ($TRANSACTIONS[transaction].type == 'Credit' or $TRANSACTIONS[transaction].type == 'Bonus' or $TRANSACTIONS[transaction].type == 'Donation' or $TRANSACTIONS[transaction].type == 'Fee') and $TRANSACTIONS[transaction].confirmations < $GLOBAL.confirmations and $TRANSACTIONS[transaction].confirmations >= 0}
|
||||||
{assign var=unconfirmed value=1}
|
{assign var=unconfirmed value=1}
|
||||||
<tr class="{cycle values="odd,even"}">
|
<tr class="{cycle values="odd,even"}">
|
||||||
<td>{$TRANSACTIONS[transaction].id}</td>
|
<td>{$TRANSACTIONS[transaction].id}</td>
|
||||||
@ -117,7 +117,7 @@
|
|||||||
<td>{$TRANSACTIONS[transaction].type}</td>
|
<td>{$TRANSACTIONS[transaction].type}</td>
|
||||||
<td>{$TRANSACTIONS[transaction].coin_address}</td>
|
<td>{$TRANSACTIONS[transaction].coin_address}</td>
|
||||||
<td>{if $TRANSACTIONS[transaction].height == 0}n/a{else}{$TRANSACTIONS[transaction].height}{/if}</td>
|
<td>{if $TRANSACTIONS[transaction].height == 0}n/a{else}{$TRANSACTIONS[transaction].height}{/if}</td>
|
||||||
<td><font color="{if $TRANSACTIONS[transaction].type == 'Orphan_Credit' or $TRANSACTIONS[transaction].type == 'Orphan_Bonus'}green{else}red{/if}">{$TRANSACTIONS[transaction].amount|number_format:"8"}</td>
|
<td><font color="{if $TRANSACTIONS[transaction].type == 'Credit' or $TRANSACTIONS[transaction].type == 'Bonus'}green{else}red{/if}">{$TRANSACTIONS[transaction].amount|number_format:"8"}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{/if}
|
{/if}
|
||||||
{/section}
|
{/section}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user