diff --git a/.gitignore b/.gitignore index 45cca5e..d66b5c5 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ lbryexplorer.zip lbryexplorer.komodoproject .komodotools +/.gtm/ diff --git a/src/Controller/MainController.php b/src/Controller/MainController.php index 7419653..0e9a4b6 100644 --- a/src/Controller/MainController.php +++ b/src/Controller/MainController.php @@ -328,8 +328,11 @@ class MainController extends AppController { // Get the basic block transaction info $txs = $this->Transactions->find()->select(['Transactions.id', 'Transactions.value', 'Transactions.input_count', 'Transactions.output_count', 'Transactions.hash', 'Transactions.version'])->where(['Transactions.block_hash_id' => $block->hash])->toArray(); + $last_block = $this->Blocks->find()->select(['height'])->order(['height' => 'desc'])->first(); + $confirmations = $last_block->height - $block->height + 1; $this->set('block', $block); $this->set('blockTxs', $txs); + $this->set('confirmations', $confirmations); } } @@ -349,7 +352,14 @@ class MainController extends AppController { } $block = $this->Blocks->find()->select(['confirmations', 'height'])->where(['hash' => $tx->block_hash_id])->first(); - $confirmations = $block->confirmations; + $confirmations = 0; + if($tx->block_hash_id == 'MEMPOOL') { + $confirmations = 0; + } + else { + $last_block = $this->Blocks->find()->select(['height'])->order(['height' => 'desc'])->first(); + $confirmations = $last_block->height - $block->height + 1; + } $inputs = $this->Inputs->find()->where(['transaction_id' => $tx->id])->order(['prevout_n' => 'asc'])->toArray(); foreach($inputs as $input) { $inputAddresses = $this->Addresses->find()->select(['id', 'address'])->where(['id' => $input->input_address_id])->toArray(); diff --git a/src/Template/Main/blocks.ctp b/src/Template/Main/blocks.ctp index 45c3b8d..9dc09e8 100644 --- a/src/Template/Main/blocks.ctp +++ b/src/Template/Main/blocks.ctp @@ -54,7 +54,7 @@
Confirmations
bits ?>
-
confirmations, 0, '', ',') ?>
+
diff --git a/src/Template/Main/index.ctp b/src/Template/Main/index.ctp index fedcf93..d6b53db 100644 --- a/src/Template/Main/index.ctp +++ b/src/Template/Main/index.ctp @@ -187,14 +187,6 @@ foreach ($recentClaims as $claim): $idx++; $autoThumbText = $claim->getAutoThumbText(); - $link = $claim->name; - $rawLink = $claim->name; - if (isset($claim->publisher)) { - $link = urlencode($claim->publisher) . '/' . $link; - $rawLink = $claim->publisher . '/' . $link; - } - $link = 'lbry://' . $link; - $rawLink = 'lbry://' . $rawLink; // content type $ctTag = $claim->getContentTag(); @@ -219,7 +211,7 @@
claim_type == 1 ? $claim->name : ((strlen(trim($claim->title)) > 0) ? $claim->title : 'No Title') ?>
- +
claim_type == 2 && strlen(trim($claim->description)) > 0): ?>