From 3b980cbf5d4e77230cd5fc80af7ef712cda126d9 Mon Sep 17 00:00:00 2001 From: Frederick Behrends Date: Tue, 31 Dec 2013 04:17:53 +0100 Subject: [PATCH] [IMPROVMENT] Added option to link transaction-ids to transaction on blockchainwebsite --- public/include/config/admin_settings.inc.php | 15 ++++++++++++++- public/include/smarty_globals.inc.php | 2 ++ .../mpos/account/transactions/default.tpl | 6 +++++- .../templates/mpos/admin/transactions/default.tpl | 6 +++++- 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/public/include/config/admin_settings.inc.php b/public/include/config/admin_settings.inc.php index 86a16163..3292ab40 100644 --- a/public/include/config/admin_settings.inc.php +++ b/public/include/config/admin_settings.inc.php @@ -76,6 +76,20 @@ $aSettings['website'][] = array( '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' => 'Transactionexplorer URL', 'type' => 'text', + 'size' => 50, + 'default' => 'http://explorer.litecoin.net/tx/', + 'name' => 'website_transactionexplorer_url', 'value' => $setting->getValue('website_transactionexplorer_url'), + 'tooltip' => 'URL to the transactionexplorer website for your blockchain. Will append the transactionid to the URL. Leave empty to disabled this.' +); +$aSettings['website'][] = array( + 'display' => 'Disable Transactionexplorer', 'type' => 'select', + 'options' => array( 0 => 'No', 1 => 'Yes' ), + 'default' => 0, + 'name' => 'website_transactionexplorer_disabled', 'value' => $setting->getValue('website_transactionexplorer_disabled'), + 'tooltip' => 'Enabled or disable the transactionexplorer URL feature. Will remove any links using the transactionexplorer URL.' +); $aSettings['website'][] = array( 'display' => 'Chaininfo URL', 'type' => 'text', 'size' => 50, @@ -351,4 +365,3 @@ $aSettings['monitoring'][] = array( 'tooltip' => 'Create per-monitor API keys and save them here to propagate your uptime statistics.' ); -?> diff --git a/public/include/smarty_globals.inc.php b/public/include/smarty_globals.inc.php index 18fe4e92..c1f85023 100644 --- a/public/include/smarty_globals.inc.php +++ b/public/include/smarty_globals.inc.php @@ -95,10 +95,12 @@ $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']['transactionexplorer']['disabled'] = $setting->getValue('website_transactionexplorer_disabled'); $aGlobal['website']['chaininfo']['disabled'] = $setting->getValue('website_chaininfo_disabled'); $aGlobal['website']['donors']['disabled'] = $setting->getValue('disable_donors'); $aGlobal['website']['about']['disabled'] = $setting->getValue('disable_about'); $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_transactionexplorer_url') ? $aGlobal['website']['transactionexplorer']['url'] = $setting->getValue('website_transactionexplorer_url') : $aGlobal['website']['transactionexplorer']['url'] = 'http://explorer.litecoin.net/tx/'; $setting->getValue('website_chaininfo_url') ? $aGlobal['website']['chaininfo']['url'] = $setting->getValue('website_chaininfo_url') : $aGlobal['website']['chaininfo']['url'] = 'http://allchains.info'; // Google Analytics diff --git a/public/templates/mpos/account/transactions/default.tpl b/public/templates/mpos/account/transactions/default.tpl index d50df3ad..b6c12c36 100644 --- a/public/templates/mpos/account/transactions/default.tpl +++ b/public/templates/mpos/account/transactions/default.tpl @@ -95,7 +95,11 @@ {else}Unconfirmed{/if} {$TRANSACTIONS[transaction].coin_address|truncate:20:"...":true:true} - {$TRANSACTIONS[transaction].txid|truncate:20:"...":true:true} + {if ! $GLOBAL.website.transactionexplorer.disabled} + {$TRANSACTIONS[transaction].txid|truncate:20:"...":true:true} + {else} + {$TRANSACTIONS[transaction].txid|truncate:20:"...":true:true} + {/if} {if $TRANSACTIONS[transaction].height == 0}n/a{else}{$TRANSACTIONS[transaction].height}{/if} {$TRANSACTIONS[transaction].amount|number_format:"8"} diff --git a/public/templates/mpos/admin/transactions/default.tpl b/public/templates/mpos/admin/transactions/default.tpl index 7d024c68..4e2a05ac 100644 --- a/public/templates/mpos/admin/transactions/default.tpl +++ b/public/templates/mpos/admin/transactions/default.tpl @@ -102,7 +102,11 @@ {else}Unconfirmed{/if} {$TRANSACTIONS[transaction].coin_address|truncate:20:"...":true:true} - {$TRANSACTIONS[transaction].txid|truncate:20:"...":true:true} + {if ! $GLOBAL.website.transactionexplorer.disabled} + {$TRANSACTIONS[transaction].txid|truncate:20:"...":true:true} + {else} + {$TRANSACTIONS[transaction].txid|truncate:20:"...":true:true} + {/if} {if $TRANSACTIONS[transaction].height == 0}n/a{else}{/if}{$TRANSACTIONS[transaction].height} {$TRANSACTIONS[transaction].amount|number_format:"8"}