Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
70c04cca47 | ||
|
|
ed508182b5 | ||
|
|
3d28c44fde | ||
|
|
6c61179546 |
No files matched your search
@@ -5,4 +5,3 @@
|
||||
lbryexplorer.zip
|
||||
lbryexplorer.komodoproject
|
||||
.komodotools
|
||||
/.gtm/
|
||||
@@ -5,6 +5,7 @@ dist: trusty
|
||||
sudo: false
|
||||
|
||||
php:
|
||||
- 5.6
|
||||
- 7.0
|
||||
- 7.1
|
||||
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
# LBRY Block Explorer
|
||||
|
||||
A simple PHP block explorer for browsing transactions and claims on the [LBRY](https://lbry.com) blockchain. The explorer was developed using CakePHP which is a model-view-controller (MVC) PHP framework.
|
||||
A simple PHP block explorer for browsing transactions and claims on the [LBRY](https://lbry.io) blockchain. The explorer was developed using CakePHP which is a model-view-controller (MVC) PHP framework.
|
||||
|
||||
## Installation
|
||||
There are some prerequisites that need to be installed before the explorer can be accessed.
|
||||
* Web server - Apache, caddy or nginx
|
||||
* [lbrycrd](https://github.com/lbryio/lbrycrd) with txindex turned on
|
||||
* [Python claims decoder](https://github.com/cryptodevorg/lbry-decoder)
|
||||
* MariaDB 10.2 or higher
|
||||
* Redis Server (optional, only required for the CakePHP redis cache engine, or to run `forevermempool`)
|
||||
* PHP 7.2 or higher
|
||||
@@ -75,7 +76,7 @@ Launch the URL for the configured web server root in a browser.
|
||||
|
||||
|
||||
## Contributing
|
||||
Contributions to this project are welcome, encouraged, and compensated. For more details, see https://lbry.tech/contribute
|
||||
Contributions to this project are welcome, encouraged, and compensated. For more details, see https://lbry.io/faq/contributing
|
||||
|
||||
|
||||
## License
|
||||
@@ -87,4 +88,4 @@ We take security seriously. Please contact security@lbry.io regarding any securi
|
||||
|
||||
|
||||
## Contact
|
||||
The primary contact for this project is [@akinwale](https://github.com/akinwale) (akinwale@lbry.com)
|
||||
The primary contact for this project is [@akinwale](https://github.com/akinwale) (akinwale@lbry.io)
|
||||
+1
-2
@@ -6,10 +6,9 @@
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
"php": ">=5.6",
|
||||
"cakephp/cakephp": "3.7.1",
|
||||
"cakephp/cakephp": "^3.6",
|
||||
"mobiledetect/mobiledetectlib": "2.*",
|
||||
"cakephp/migrations": "~1.0",
|
||||
"psr/simple-cache": "^1.0.0",
|
||||
"cakephp/plugin-installer": "~1.0",
|
||||
"mdanter/ecc": "^0.5.0",
|
||||
"nesbot/carbon": "~1.18",
|
||||
|
||||
Generated
+452
-678
File diff suppressed because it is too large.
Load diff
+8
-27
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace App\config;
|
||||
|
||||
return [
|
||||
/**
|
||||
* Debug Level:
|
||||
@@ -218,20 +220,20 @@ return [
|
||||
* See vendor\cakephp\cakephp\src\Database\Driver for complete list
|
||||
*/
|
||||
'Datasources' => [
|
||||
'default' => [ // Chainquery database connection
|
||||
'default' => [
|
||||
'className' => 'Cake\Database\Connection',
|
||||
'driver' => 'Cake\Database\Driver\Mysql',
|
||||
'persistent' => false,
|
||||
'host' => 'chainquery.lbry.com',
|
||||
'host' => 'localhost',
|
||||
/**
|
||||
* CakePHP will use the default DB port based on the driver selected
|
||||
* MySQL on MAMP uses port 8889, MAMP users will want to uncomment
|
||||
* the following line and set the port accordingly
|
||||
*/
|
||||
//'port' => '3000',
|
||||
'username' => 'username',
|
||||
//'port' => 'non_standard_port_number',
|
||||
'username' => 'my_app',
|
||||
'password' => 'secret',
|
||||
'database' => 'my_db',
|
||||
'database' => 'my_app',
|
||||
'encoding' => 'utf8',
|
||||
'timezone' => 'UTC',
|
||||
'flags' => [],
|
||||
@@ -257,28 +259,7 @@ return [
|
||||
*/
|
||||
//'init' => ['SET GLOBAL innodb_stats_on_metadata = 0'],
|
||||
|
||||
'url' => env('DATABASE_URL', 'chainquery.lbry.com:3600'),
|
||||
],
|
||||
|
||||
'localdb' => [ // Local db for price history
|
||||
'className' => 'Cake\Database\Connection',
|
||||
'driver' => 'Cake\Database\Driver\Mysql',
|
||||
'persistent' => false,
|
||||
'host' => 'localhost',
|
||||
/**
|
||||
* CakePHP will use the default DB port based on the driver selected
|
||||
* MySQL on MAMP uses port 8889, MAMP users will want to uncomment
|
||||
* the following line and set the port accordingly
|
||||
*/
|
||||
//'port' => '3306',
|
||||
'username' => 'username',
|
||||
'password' => 'secret',
|
||||
'database' => 'lbry',
|
||||
'encoding' => 'utf8',
|
||||
'timezone' => 'UTC',
|
||||
'flags' => [],
|
||||
'cacheMetadata' => true,
|
||||
'log' => false,
|
||||
'url' => env('DATABASE_URL', null),
|
||||
],
|
||||
|
||||
/**
|
||||
|
||||
+7
-37
@@ -15,22 +15,19 @@
|
||||
|
||||
// You can remove this if you are confident that your PHP version is sufficient.
|
||||
if (version_compare(PHP_VERSION, '5.6.0') < 0) {
|
||||
trigger_error('Your PHP version must be equal or higher than 5.6.0 to use CakePHP.', E_USER_ERROR);
|
||||
}
|
||||
trigger_error('Your PHP version must be equal or higher than 5.6.0 to}
|
||||
|
||||
/*
|
||||
* You can remove this if you are confident you have intl installed.
|
||||
*/
|
||||
if (!extension_loaded('intl')) {
|
||||
trigger_error('You must enable the intl extension to use CakePHP.', E_USER_ERROR);
|
||||
}
|
||||
trigger_error('You must enable the intl extension to}
|
||||
|
||||
/*
|
||||
* You can remove this if you are confident you have mbstring installed.
|
||||
*/
|
||||
if (!extension_loaded('mbstring')) {
|
||||
trigger_error('You must enable the mbstring extension to use CakePHP.', E_USER_ERROR);
|
||||
}
|
||||
trigger_error('You must enable the mbstring extension to}
|
||||
|
||||
/*
|
||||
* Configure paths required to find CakePHP + general filepath
|
||||
@@ -49,22 +46,6 @@ require __DIR__ . '/paths.php';
|
||||
*/
|
||||
require CORE_PATH . 'config' . DS . 'bootstrap.php';
|
||||
|
||||
use App\Application;
|
||||
use Cake\Cache\Cache;
|
||||
use Cake\Console\ConsoleErrorHandler;
|
||||
use Cake\Core\App;
|
||||
use Cake\Core\Configure;
|
||||
use Cake\Core\Configure\Engine\PhpConfig;
|
||||
use Cake\Core\Plugin;
|
||||
use Cake\Database\Type;
|
||||
use Cake\Datasource\ConnectionManager;
|
||||
use Cake\Error\ErrorHandler;
|
||||
use Cake\Log\Log;
|
||||
use Cake\Mailer\Email;
|
||||
use Cake\Mailer\TransportFactory;
|
||||
use Cake\Http\ServerRequest;
|
||||
use Cake\Utility\Inflector;
|
||||
use Cake\Utility\Security;
|
||||
|
||||
/*
|
||||
* Read configuration file and inject configuration into various
|
||||
@@ -152,11 +133,9 @@ if (!Configure::read('App.fullBaseUrl')) {
|
||||
|
||||
Cache::setConfig(Configure::consume('Cache'));
|
||||
ConnectionManager::setConfig(Configure::consume('Datasources'));
|
||||
//Email::setConfigTransport(Configure::consume('EmailTransport'));
|
||||
TransportFactory::setConfig(Configure::consume('EmailTransport'));
|
||||
Email::setConfigTransport(Configure::consume('EmailTransport'));
|
||||
Email::setConfig(Configure::consume('Email'));
|
||||
Log::setConfig(Configure::consume('Log'));
|
||||
//Security::salt(Configure::consume('Security.salt'));
|
||||
Security::setSalt(Configure::consume('Security.salt'));
|
||||
|
||||
/*
|
||||
@@ -169,12 +148,12 @@ Security::setSalt(Configure::consume('Security.salt'));
|
||||
/*
|
||||
* Setup detectors for mobile and tablet.
|
||||
*/
|
||||
ServerRequest::addDetector('mobile', function ($request) {
|
||||
Request::addDetector('mobile', function ($request) {
|
||||
$detector = new \Detection\MobileDetect();
|
||||
|
||||
return $detector->isMobile();
|
||||
});
|
||||
ServerRequest::addDetector('tablet', function ($request) {
|
||||
Request::addDetector('tablet', function ($request) {
|
||||
$detector = new \Detection\MobileDetect();
|
||||
|
||||
return $detector->isTablet();
|
||||
@@ -217,14 +196,5 @@ Type::build('timestamp')
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Only try to load DebugKit in development mode
|
||||
* Debug Kit should not be installed on a production system
|
||||
*/
|
||||
if (Configure::read('debug')) {
|
||||
//Plugin::load('DebugKit', ['bootstrap' => true]);
|
||||
Application::addPlugin('DebugKit', ['bootstrap' => true]);
|
||||
}
|
||||
|
||||
Configure::load('lbry','lbry.default');
|
||||
Configure::load('lbry');
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
* @since 3.0.0
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
namespace App\config;
|
||||
|
||||
use Cake\Core\Configure;
|
||||
use Cake\Core\Exception\MissingPluginException;
|
||||
use Cake\Core\Plugin;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace App\config;
|
||||
|
||||
return [
|
||||
'Lbry' => [
|
||||
'RpcUrl' => 'http://user:password@127.0.0.1:9245',
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
* @since 3.0.0
|
||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||
*/
|
||||
namespace App\config;
|
||||
|
||||
|
||||
/**
|
||||
* Use the DS to separate the directories in other defines
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since 3.5.0
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/*
|
||||
* You can empty out this file, if you are certain that you match all requirements.
|
||||
*/
|
||||
|
||||
/*
|
||||
* You can remove this if you are confident that your PHP version is sufficient.
|
||||
*/
|
||||
if (version_compare(PHP_VERSION, '5.6.0') < 0) {
|
||||
trigger_error('Your PHP version must be equal or higher than 5.6.0 to use CakePHP.' . PHP_EOL, E_USER_ERROR);
|
||||
}
|
||||
|
||||
/*
|
||||
* You can remove this if you are confident you have intl installed.
|
||||
*/
|
||||
if (!extension_loaded('intl')) {
|
||||
trigger_error('You must enable the intl extension to use CakePHP.' . PHP_EOL, E_USER_ERROR);
|
||||
}
|
||||
|
||||
/*
|
||||
* You can remove this if you are confident you have mbstring installed.
|
||||
*/
|
||||
if (!extension_loaded('mbstring')) {
|
||||
trigger_error('You must enable the mbstring extension to use CakePHP.' . PHP_EOL, E_USER_ERROR);
|
||||
}
|
||||
+1
-5
@@ -18,10 +18,6 @@
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
use Cake\Core\Plugin;
|
||||
use Cake\Routing\RouteBuilder;
|
||||
use Cake\Routing\Router;
|
||||
use Cake\Routing\Route\DashedRoute;
|
||||
|
||||
/**
|
||||
* The default class to use for all routes
|
||||
@@ -71,4 +67,4 @@ Router::scope('/', function (RouteBuilder $routes) {
|
||||
$routes->connect('/api/v1/claims/browse', ['controller' => 'Claims', 'action' => 'apibrowse']);
|
||||
|
||||
//$routes->fallbacks(DashedRoute::class);
|
||||
});
|
||||
});
|
||||
@@ -1,23 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
PHPBIN=php7.2
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
|
||||
if [ ! -e "config/app.php" ]; then
|
||||
cp "$DIR/config/app.default.php" "$DIR/config/app.php"
|
||||
fi
|
||||
|
||||
if ! which $PHPBIN 2>/dev/null; then
|
||||
PHPBIN=php
|
||||
fi
|
||||
|
||||
#Composer update
|
||||
composer update
|
||||
|
||||
#$PHPBIN composer.phar install
|
||||
|
||||
$PHPBIN --server localhost:8000 --docroot "$DIR/webroot" "$DIR/webroot/index.php"
|
||||
@@ -74,7 +74,7 @@ CREATE TABLE `Addresses`
|
||||
`TotalReceived` DECIMAL(18,8) DEFAULT 0 NOT NULL,
|
||||
`TotalSent` DECIMAL(18,8) DEFAULT 0 NOT NULL,
|
||||
`Balance` DECIMAL(18,8) AS (`TotalReceived` - `TotalSent`) PERSISTENT,
|
||||
`Tag` VARCHAR(30),
|
||||
`Tag` VARCHAR(30) NOT NULL,
|
||||
`TagUrl` VARCHAR(200),
|
||||
`Created` DATETIME NOT NULL,
|
||||
`Modified` DATETIME NOT NULL,
|
||||
|
||||
+14
-2
@@ -12,9 +12,11 @@
|
||||
* @since 3.3.0
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
namespace App;
|
||||
|
||||
use Cake\Core\Configure;
|
||||
use Cake\Core\Plugin;
|
||||
use Cake\Error\Middleware\ErrorHandlerMiddleware;
|
||||
use Cake\Http\BaseApplication;
|
||||
use Cake\Routing\Middleware\AssetMiddleware;
|
||||
@@ -40,13 +42,23 @@ class Application extends BaseApplication
|
||||
// Catch any exceptions in the lower layers,
|
||||
// and make an error page/response
|
||||
->add(ErrorHandlerMiddleware::class)
|
||||
|
||||
// Handle plugin/theme assets like CakePHP normally does.
|
||||
->add(AssetMiddleware::class)
|
||||
|
||||
// Apply routing
|
||||
->add(RoutingMiddleware::class);
|
||||
|
||||
return $middleware;
|
||||
}
|
||||
|
||||
public function bootstrap()
|
||||
{
|
||||
parent::bootstrap(); // TODO: Change the autogenerated stub
|
||||
/*
|
||||
* Only try to load DebugKit in development mode
|
||||
* Debug Kit should not be installed on a production system
|
||||
*/
|
||||
if (Configure::read('debug')) {
|
||||
$this->addPlugin(\DebugKit\Plugin::class);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -47,7 +47,7 @@ class Installer
|
||||
if (in_array($arg, ['Y', 'y', 'N', 'n'])) {
|
||||
return $arg;
|
||||
}
|
||||
throw new Exception('This is not a valid answer. Please choose Y or n.');
|
||||
throw new \Exception('This is not a valid answer. Please choose Y or n.');
|
||||
};
|
||||
$setFolderPermissions = $io->askAndValidate(
|
||||
'<info>Set Folder Permissions ? (Default to Y)</info> [<comment>Y,n</comment>]? ',
|
||||
|
||||
@@ -36,6 +36,7 @@ class AppController extends Controller
|
||||
* e.g. `$this->loadComponent('Security');`
|
||||
*
|
||||
* @return void
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function initialize()
|
||||
{
|
||||
@@ -61,17 +62,17 @@ class AppController extends Controller
|
||||
public function beforeRender(Event $event)
|
||||
{
|
||||
if (!array_key_exists('_serialize', $this->viewVars) &&
|
||||
in_array($this->response->type(), ['application/json', 'application/xml'])
|
||||
in_array($this->response->getType(), ['application/json', 'application/xml'])
|
||||
) {
|
||||
$this->set('_serialize', true);
|
||||
}
|
||||
}
|
||||
|
||||
protected function _jsonResponse($object = [], $statusCode = null)
|
||||
protected function _jsonResponse($object = [], $statusCode = 200)
|
||||
{
|
||||
$this->response->statusCode($statusCode);
|
||||
$this->response->type('json');
|
||||
$this->response->body(json_encode($object));
|
||||
$this->response->withStatus($statusCode);
|
||||
$this->response->withType('json');
|
||||
$this->response->withStringBody(json_encode($object));
|
||||
}
|
||||
|
||||
protected function _jsonError($message, $statusCode = null) {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Controller\AppController;
|
||||
use Cake\Datasource\ConnectionManager;
|
||||
use Cake\Log\Log;
|
||||
|
||||
@@ -11,10 +12,10 @@ class ClaimsController extends AppController {
|
||||
$this->loadModel('Claims');
|
||||
|
||||
$pageLimit = 48;
|
||||
$beforeId = intval($this->request->query('before'));
|
||||
$afterId = intval($this->request->query('after'));
|
||||
$sort = trim($this->request->query('sort'));
|
||||
$nsfw = trim($this->request->query('nsfw'));
|
||||
$beforeId = intval($this->request->getQuery('before'));
|
||||
$afterId = intval($this->request->getQuery('after'));
|
||||
$sort = trim($this->request->getQuery('sort'));
|
||||
$nsfw = trim($this->request->getQuery('nsfw'));
|
||||
switch ($sort) {
|
||||
case 'popular':
|
||||
// TODO: sort by upvote/downvote score
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
*/
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Controller\AppController;
|
||||
use Cake\Event\Event;
|
||||
|
||||
/**
|
||||
@@ -27,6 +28,7 @@ class ErrorController extends AppController
|
||||
* Initialization hook method.
|
||||
*
|
||||
* @return void
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function initialize()
|
||||
{
|
||||
|
||||
+511
-562
File diff suppressed because it is too large.
Load diff
@@ -14,9 +14,10 @@
|
||||
*/
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Controller\AppController;
|
||||
use Cake\Core\Configure;
|
||||
use Cake\Network\Exception\ForbiddenException;
|
||||
use Cake\Network\Exception\NotFoundException;
|
||||
use Cake\Http\Exception\ForbiddenException;
|
||||
use Cake\Http\Exception\NotFoundException;
|
||||
use Cake\View\Exception\MissingTemplateException;
|
||||
|
||||
/**
|
||||
@@ -33,7 +34,7 @@ class PagesController extends AppController
|
||||
* Displays a view
|
||||
*
|
||||
* @param string ...$path Path segments.
|
||||
* @return void|\Cake\Network\Response
|
||||
* @return \Cake\Http\Response
|
||||
* @throws \Cake\Network\Exception\ForbiddenException When a directory traversal attempt.
|
||||
* @throws \Cake\Network\Exception\NotFoundException When the view file could not
|
||||
* be found or \Cake\View\Exception\MissingTemplateException in debug mode.
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Model\Behavior;
|
||||
|
||||
use Cake\Event\Event;
|
||||
use Cake\ORM\Behavior;
|
||||
use Cake\ORM\Entity;
|
||||
use Cake\Event\Event;
|
||||
use Cake\Routing\Router;
|
||||
|
||||
class SimpleAuditBehavior extends Behavior {
|
||||
|
||||
+12
-12
@@ -6,30 +6,30 @@ use Cake\ORM\Entity;
|
||||
|
||||
class Claim extends Entity {
|
||||
function getLbryLink() {
|
||||
$link = $this->name;
|
||||
if (isset($this->publisher)) {
|
||||
$link = $this->publisher . '/' . $link;
|
||||
$link = $this->Name;
|
||||
if (isset($this->Publisher->Name)) {
|
||||
$link = $this->Publisher->Name . '/' . $link;
|
||||
}
|
||||
$link = 'lbry://' . $link;
|
||||
return $link;
|
||||
}
|
||||
|
||||
function getExplorerLink() {
|
||||
$link = '/claims/' . $this->claim_id;
|
||||
$link = '/claims/' . $this->ClaimId;
|
||||
return $link;
|
||||
}
|
||||
|
||||
function getContentTag() {
|
||||
$ctTag = null;
|
||||
if (substr($this->content_type, 0, 5) === 'audio') {
|
||||
if (substr($this->ContentType, 0, 5) === 'audio') {
|
||||
$ctTag = 'audio';
|
||||
} else if (substr($this->content_type, 0, 5) === 'video') {
|
||||
} else if (substr($this->ContentType, 0, 5) === 'video') {
|
||||
$ctTag = 'video';
|
||||
} else if (substr($this->content_type, 0, 5) === 'image') {
|
||||
} else if (substr($this->ContentType, 0, 5) === 'image') {
|
||||
$ctTag = 'image';
|
||||
}
|
||||
|
||||
if (!$ctTag && $this->claim_type == 2) {
|
||||
if (!$ctTag && $this->ClaimType == 1) {
|
||||
$ctTag = 'identity';
|
||||
}
|
||||
return $ctTag;
|
||||
@@ -37,11 +37,11 @@ class Claim extends Entity {
|
||||
|
||||
function getAutoThumbText() {
|
||||
$autoThumbText = '';
|
||||
if ($this->claim_type == 2) {
|
||||
$autoThumbText = strtoupper(substr($this->name, 1, min(strlen($this->name), 10)));
|
||||
if ($this->ClaimType == 1) {
|
||||
$autoThumbText = strtoupper(substr($this->Name, 1, min( strlen($this->Name), 3 )));
|
||||
} else {
|
||||
$str = (strlen(trim($this->title)) > 0) ? $this->title : $this->name;
|
||||
$autoThumbText = strtoupper(substr($str, 0, min(strlen($str), 5)));
|
||||
$str = (strlen(trim($this->Title)) > 0) ? $this->Title : $this->Name;
|
||||
$autoThumbText = strtoupper(substr($str, 0, min (strlen($str), 2 )));
|
||||
}
|
||||
return $autoThumbText;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,8 @@ namespace App\Model\Entity;
|
||||
|
||||
use Cake\ORM\Entity;
|
||||
|
||||
class TransactionAddress extends Entity {
|
||||
class ClaimStream extends Entity {
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -5,7 +5,7 @@ namespace App\Model\Entity;
|
||||
use Cake\ORM\Entity;
|
||||
|
||||
class PriceHistory extends Entity {
|
||||
public $useDbConfig = 'localdb';
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -3,9 +3,9 @@
|
||||
namespace App\Model\Entity;
|
||||
|
||||
use Cake\ORM\Entity;
|
||||
use Cake\ORM\TableRegistry;
|
||||
|
||||
class Transaction extends Entity {
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -8,8 +8,8 @@ class AddressesTable extends Table {
|
||||
public function initialize(array $config) {
|
||||
parent::initialize($config);
|
||||
|
||||
$this->setPrimaryKey('id');
|
||||
$this->setTable('address');
|
||||
$this->setPrimaryKey('Id');
|
||||
$this->setTable('Addresses');
|
||||
|
||||
$this->addBehavior('SimpleAudit');
|
||||
}
|
||||
|
||||
@@ -8,11 +8,9 @@ class BlocksTable extends Table {
|
||||
public function initialize(array $config) {
|
||||
parent::initialize($config);
|
||||
|
||||
$this->setPrimaryKey('id');
|
||||
$this->setTable('block');
|
||||
$this->setPrimaryKey('Id');
|
||||
$this->setTable('Blocks');
|
||||
|
||||
$this->addBehavior('SimpleAudit');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Model\Table;
|
||||
|
||||
use Cake\ORM\Table;
|
||||
|
||||
class ClaimStreamsTable extends Table {
|
||||
public function initialize(array $config) {
|
||||
parent::initialize($config);
|
||||
|
||||
$this->setPrimaryKey('Id');
|
||||
$this->setTable('ClaimStreams');
|
||||
|
||||
//$this->addBehavior('SimpleAudit');
|
||||
}
|
||||
}
|
||||
@@ -8,20 +8,27 @@ class ClaimsTable extends Table {
|
||||
public function initialize(array $config) {
|
||||
parent::initialize($config);
|
||||
|
||||
$this->setPrimaryKey('id');
|
||||
$this->setTable('claim');
|
||||
$this->setPrimaryKey('Id');
|
||||
$this->setTable('Claims');
|
||||
|
||||
//$this->addBehavior('SimpleAudit');
|
||||
$this->addAssociations([
|
||||
'belongsTo' => [
|
||||
'publisher' => [
|
||||
'Publisher' => [
|
||||
'className' => 'App\Model\Table\ClaimsTable',
|
||||
'foreignKey' => 'publisher_id',
|
||||
'bindingKey' => 'claim_id',
|
||||
'propertyName' => 'publisher'
|
||||
'foreignKey' => 'PublisherId',
|
||||
'bindingKey' => 'ClaimId',
|
||||
'propertyName' => 'Publisher'
|
||||
]
|
||||
],
|
||||
'hasOne' => [
|
||||
'Stream' => [
|
||||
'className' => 'App\Model\Table\ClaimStreamsTable',
|
||||
'foreignKey' => 'Id',
|
||||
'bindingKey' => 'Id',
|
||||
'propertyName' => 'Stream'
|
||||
]
|
||||
]
|
||||
]);
|
||||
}
|
||||
}
|
||||
?>
|
||||
}
|
||||
@@ -8,23 +8,21 @@ class InputsTable extends Table {
|
||||
public function initialize(array $config) {
|
||||
parent::initialize($config);
|
||||
|
||||
$this->setPrimaryKey('id');
|
||||
$this->setTable('input');
|
||||
$this->setPrimaryKey('Id');
|
||||
$this->setTable('Inputs');
|
||||
|
||||
$this->addBehavior('SimpleAudit');
|
||||
|
||||
$this->addAssociations([
|
||||
'belongsToMany' => [
|
||||
'input_addresses' => [
|
||||
'InputAddresses' => [
|
||||
'className' => 'App\Model\Table\AddressesTable',
|
||||
'joinTable' => 'input_addresses',
|
||||
'foreignKey' => 'input_id',
|
||||
'targetForeignKey' => 'address_id',
|
||||
'propertyName' => 'input_addresses'
|
||||
'joinTable' => 'InputsAddresses',
|
||||
'foreignKey' => 'InputId',
|
||||
'targetForeignKey' => 'AddressId',
|
||||
'propertyName' => 'InputAddresses'
|
||||
]
|
||||
]
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
}
|
||||
@@ -8,30 +8,28 @@ class OutputsTable extends Table {
|
||||
public function initialize(array $config) {
|
||||
parent::initialize($config);
|
||||
|
||||
$this->setPrimaryKey('id');
|
||||
$this->setTable('output');
|
||||
$this->setPrimaryKey('Id');
|
||||
$this->setTable('Outputs');
|
||||
|
||||
$this->addBehavior('SimpleAudit');
|
||||
|
||||
$this->addAssociations([
|
||||
'belongsTo' => [
|
||||
'spend_input' => [
|
||||
'SpendInput' => [
|
||||
'className' => 'App\Model\Table\InputsTable',
|
||||
'foreignKey' => 'spent_by_input_id',
|
||||
'propertyName' => 'spend_input'
|
||||
'foreignKey' => 'SpentByInputId',
|
||||
'propertyName' => 'SpendInput'
|
||||
]
|
||||
],
|
||||
'belongsToMany' => [
|
||||
'output_addresses' => [
|
||||
'OutputAddresses' => [
|
||||
'className' => 'App\Model\Table\AddressesTable',
|
||||
'joinTable' => 'output_addresses',
|
||||
'foreignKey' => 'output_id',
|
||||
'targetForeignKey' => 'address_id',
|
||||
'propertyName' => 'output_addresses'
|
||||
'joinTable' => 'OutputsAddresses',
|
||||
'foreignKey' => 'OutputId',
|
||||
'targetForeignKey' => 'AddressId',
|
||||
'propertyName' => 'OutputAddresses'
|
||||
]
|
||||
]
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
}
|
||||
@@ -11,6 +11,4 @@ class PriceHistoryTable extends Table {
|
||||
$this->setPrimaryKey('Id');
|
||||
$this->setTable('PriceHistory');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
}
|
||||
@@ -13,6 +13,4 @@ class TagAddressRequestsTable extends Table {
|
||||
|
||||
$this->addBehavior('SimpleAudit');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Model\Table;
|
||||
|
||||
use Cake\ORM\Table;
|
||||
|
||||
class TransactionAddressesTable extends Table {
|
||||
public function initialize(array $config) {
|
||||
parent::initialize($config);
|
||||
|
||||
$this->setTable('transaction_address');
|
||||
$this->addBehavior('SimpleAudit');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -8,11 +8,9 @@ class TransactionsTable extends Table {
|
||||
public function initialize(array $config) {
|
||||
parent::initialize($config);
|
||||
|
||||
$this->setPrimaryKey('id');
|
||||
$this->setTable('transaction');
|
||||
$this->setPrimaryKey('Id');
|
||||
$this->setTable('Transactions');
|
||||
|
||||
$this->addBehavior('SimpleAudit');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
}
|
||||
@@ -127,7 +127,7 @@ class AuxShell extends Shell {
|
||||
public function pricehistory() {
|
||||
self::lock('pricehistory');
|
||||
|
||||
$conn = ConnectionManager::get('localdb');
|
||||
$conn = ConnectionManager::get('default');
|
||||
$redis = new \Predis\Client(Configure::read('Redis.Url'));
|
||||
|
||||
try {
|
||||
@@ -219,6 +219,4 @@ class AuxShell extends Shell {
|
||||
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
}
|
||||
+12
-17
@@ -274,7 +274,6 @@ class BlockShell extends Shell {
|
||||
self::unlock('buildindex');
|
||||
}
|
||||
|
||||
// TODO: Refactor for unique claim identification by claim_id instead of using the claim name.
|
||||
protected function _getclaimfortxout($pubkeyasm, $tx_hash, $vout, $tx_time = null) {
|
||||
$claim_data = null;
|
||||
$claim_stream_data = null;
|
||||
@@ -296,10 +295,6 @@ class BlockShell extends Shell {
|
||||
if ($json) {
|
||||
$claim = json_decode($json);
|
||||
if ($claim) {
|
||||
if (strpos($claim_name, '#') !== false) {
|
||||
$claim_name = substr($claim_name, 0, strpos($claim_name, '#'));
|
||||
}
|
||||
|
||||
$req = ['method' => 'getvalueforname', 'params' => [$claim_name]];
|
||||
$json = null;
|
||||
try {
|
||||
@@ -1344,8 +1339,8 @@ print_r($response); print_r($json);
|
||||
$inputs[] = [
|
||||
'PrevoutHash' => $in['txid'],
|
||||
'PrevoutN' => $in['vout'],
|
||||
'ScriptSigAsm' => $in['scriptSig']['asm'],
|
||||
'ScriptSigHex' => $in['scriptSig']['hex'],
|
||||
'ScriptSigAsm' => $in->scriptSig['asm'],
|
||||
'ScriptSigHex' => $in->scriptSig['hex'],
|
||||
'Sequence' => $in['sequence']
|
||||
];
|
||||
}
|
||||
@@ -1355,16 +1350,16 @@ print_r($response); print_r($json);
|
||||
$outputs[] = [
|
||||
'Vout' => $out['vout'],
|
||||
'Value' => bcdiv($out['value'], 100000000, 8),
|
||||
'Type' => isset($out['scriptPubKey']['type']) ? $out['scriptPubKey']['type'] : '',
|
||||
'ScriptPubKeyAsm' => isset($out['scriptPubKey']['asm']) ? $out['scriptPubKey']['asm'] : '',
|
||||
'ScriptPubKeyHex' => isset($out['scriptPubKey']['hex']) ? $out['scriptPubKey']['hex'] : '',
|
||||
'RequiredSignatures' => isset($out['scriptPubKey']['reqSigs']) ? $out['scriptPubKey']['reqSigs'] : '',
|
||||
'Hash160' => isset($out['scriptPubKey']['hash160']) ? $out['scriptPubKey']['hash160'] : '',
|
||||
'Addresses' => isset($out['scriptPubKey']['addresses']) ? json_encode($out['scriptPubKey']['addresses']) : null
|
||||
'Type' => isset($out->scriptPubKey['type']) ? $out->scriptPubKey['type'] : '',
|
||||
'ScriptPubKeyAsm' => isset($out->scriptPubKey['asm']) ? $out->scriptPubKey['asm'] : '',
|
||||
'ScriptPubKeyHex' => isset($out->scriptPubKey['hex']) ? $out->scriptPubKey['hex'] : '',
|
||||
'RequiredSignatures' => isset($out->scriptPubKey['reqSigs']) ? $out->scriptPubKey['reqSigs'] : '',
|
||||
'Hash160' => isset($out->scriptPubKey['hash160']) ? $out->scriptPubKey['hash160'] : '',
|
||||
'Addresses' => isset($out->scriptPubKey['addresses']) ? json_encode($out->scriptPubKey['addresses']) : null
|
||||
];
|
||||
|
||||
if (isset($out['scriptPubKey']['addresses'])) {
|
||||
foreach ($out['scriptPubKey']['addresses'] as $address) {
|
||||
if (isset($out->scriptPubKey['addresses'])) {
|
||||
foreach ($out->scriptPubKey['addresses'] as $address) {
|
||||
$addresses[$address] = $address;
|
||||
}
|
||||
}
|
||||
@@ -1988,10 +1983,10 @@ print_r($response); print_r($json);
|
||||
$return = $define[$tx_type];
|
||||
if ($tx_type === 'p2pk') {
|
||||
$return['hash160'] = self::hash160($data[$define[$tx_type]['data_index_for_hash']]);
|
||||
$return['addresses'][0] = self::hash160_to_address($return['hash160'], self::pubKeyAddress[0]);
|
||||
$return->addresses[0] = self::hash160_to_address($return['hash160'], self::pubKeyAddress[0]);
|
||||
} else {
|
||||
$return['hash160'] = $data[$define[$tx_type]['data_index_for_hash']];
|
||||
$return['addresses'][0] = self::hash160_to_address($return['hash160'], ($tx_type === 'p2sh') ? self::scriptAddress[0] : self::pubKeyAddress[0]); // TODO: Pay to claim transaction?
|
||||
$return->addresses[0] = self::hash160_to_address($return['hash160'], ($tx_type === 'p2sh') ? self::scriptAddress[0] : self::pubKeyAddress[0]); // TODO: Pay to claim transaction?
|
||||
}
|
||||
unset($return['data_index_for_hash']);
|
||||
}
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
<?php
|
||||
$autoThumbText = $claim->getAutoThumbText();
|
||||
$cost = '';
|
||||
if (isset($claim->price) && $claim->price > 0) {
|
||||
$cost = $this->Amount->formatCurrency($claim->price) . ' LBC';
|
||||
} else if (isset($claim->fee) && strtolower($claim->fee_currency) === 'lbc') {
|
||||
$cost = $this->Amount->formatCurrency($claim->fee) . ' LBC';
|
||||
}
|
||||
$a = ['purple', 'orange', 'blue', 'teal', 'green', 'yellow'];
|
||||
// content type
|
||||
$ctTag = $claim->getContentTag();
|
||||
?>
|
||||
<div data-id="<?php echo $claim->claim_id ?>" class="claim-grid-item<?php if ($idx % 3 == 0): ?> last-item<?php endif; ?><?php if ($last_row): ?> last-row<?php endif; ?>">
|
||||
<?php if (strlen(trim($cost)) > 0): ?>
|
||||
<div class="price-tag"><?php echo $cost ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="tags">
|
||||
<?php if ($claim->bid_state == 'Controlling'): ?>
|
||||
<div class="bid-state">Controlling</div>
|
||||
<?php endif; ?>
|
||||
<?php if ($ctTag): ?>
|
||||
<div class="content-type"><?php echo strtoupper($ctTag) ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if ($claim->is_nsfw): ?>
|
||||
<div class="nsfw">NSFW</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div data-autothumb="<?php echo $autoThumbText ?>" class="thumbnail <?php echo $a[mt_rand(0, count($a) - 1)] ?>">
|
||||
<?php if (!$claim->is_nsfw && strlen(trim($claim->thumbnail_url)) > 0): ?>
|
||||
<img src="<?php echo htmlspecialchars($claim->thumbnail_url) ?>" alt="" />
|
||||
<?php else: ?>
|
||||
<div class="autothumb"><?php echo $autoThumbText ?></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php if ($claim->isBlocked): ?>
|
||||
|
||||
<div class="blocked-info">
|
||||
In response to a complaint we received under the US Digital Millennium Copyright Act, we have blocked access to this content from our applications. For more information, please refer to <a href="https://lbry.com/faq/dmca" target="_blank">DMCA takedown requests</a>
|
||||
</div>
|
||||
|
||||
<?php else: ?>
|
||||
|
||||
<div class="metadata">
|
||||
<div class="title" title="<?php echo $claim->claim_type == 1 ? $claim->name : ((strlen(trim($claim->title)) > 0) ? $claim->title : '') ?>"><?php echo $claim->claim_type == 1 ? $claim->name : ((strlen(trim($claim->title)) > 0) ? $claim->title : '<em>No Title</em>') ?></div>
|
||||
<div class="link" title="<?php echo $claim->getLbryLink() ?>"><a href="<?php echo $claim->getLbryLink() ?>" rel="nofollow"><?php echo $claim->getLbryLink() ?></a></div>
|
||||
|
||||
<div class="desc"><?php echo strlen(trim($claim->description)) > 0 ? $claim->description : '<em>No description available</em>' ?></div>
|
||||
|
||||
<div class="label half-width">Transaction</div>
|
||||
<div class="label half-width">Created</div>
|
||||
|
||||
<div class="value half-width"><a href="/tx/<?php echo $claim->transaction_hash_id ?>#output-<?php echo $claim->vout ?>" title="<?php echo $claim->transaction_hash_id ?>"><?php echo $claim->transaction_hash_id ?></a></div>
|
||||
<div class="value half-width" title="<?php echo $claim->created_at->format('j M Y H:i:s') ?> UTC">
|
||||
<?php echo \Carbon\Carbon::createFromTimestamp($claim->created_at->format('U'))->diffForHumans(); ?>
|
||||
</div>
|
||||
<div class="clear spacer"></div>
|
||||
|
||||
<?php if ($claim->claim_type == 1): ?>
|
||||
<div class="label half-width">Content Type</div>
|
||||
<div class="label half-width">Language</div>
|
||||
|
||||
<div class="value half-width" title="<?php echo $claim->content_type ?>"><?php echo $claim->content_type ?></div>
|
||||
<div class="value half-width" title="<?php echo $claim->language == 'en' ? 'English' : $claim->language ?>"><?php echo $claim->language == 'en' ? 'English' : $claim->language ?></div>
|
||||
|
||||
<div class="clear spacer"></div>
|
||||
|
||||
<!--<div class="label half-width">Author</div>
|
||||
<div class="label half-width">License</div>-->
|
||||
|
||||
|
||||
<!--<div class="value half-width" title="<?php echo strlen(trim($claim->author)) > 0 ? $claim->author : '<em>Unspecified</em>' ?>"><?php echo strlen(trim($claim->author)) > 0 ? $claim->author : '<em>Unspecified</em>' ?></div>
|
||||
|
||||
<div class="value half-width" title="<?php echo strlen(trim($claim->license)) > 0 ? $claim->license : '' ?>">
|
||||
<?php if (strlen(trim($claim->LicenseUrl)) > 0): ?><a href="<?php echo $claim->LicenseUrl ?>" rel="nofollow" target="_blank"><?php endif; ?>
|
||||
<?php echo strlen(trim($claim->License)) > 0 ? $claim->License : '<em>Unspecified</em>' ?>
|
||||
<?php if (strlen(trim($claim->LicenseUrl))): ?></a><?php endif; ?>
|
||||
</div>
|
||||
-->
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php $this->assign('title', 'Address ' . $address->address) ?>
|
||||
<?php $this->assign('title', 'Address ' . $address->Address) ?>
|
||||
|
||||
<?php $this->start('script') ?>
|
||||
<script type="text/javascript">
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
var btnClose = $('.btn-close');
|
||||
$.ajax({
|
||||
url: '/api/v1/address/<?php echo $address->address ?>/tag',
|
||||
url: '/api/v1/address/<?php echo $address->Address ?>/tag',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: req,
|
||||
@@ -87,7 +87,7 @@
|
||||
|
||||
<div class="address-head">
|
||||
<h3>LBRY Address</h3>
|
||||
<h4><?php echo $address->address ?></h4>
|
||||
<h4><?php echo $address->Address ?></h4>
|
||||
<?php if (isset($address->Tag) && strlen(trim($address->Tag)) > 0): ?>
|
||||
<?php if (strlen(trim($address->TagUrl)) > 0): ?><a href="<?php echo $address->TagUrl ?>" target="_blank" rel="nofollow"><?php echo $address->Tag ?></a><?php else: echo $address->Tag; endif; ?>
|
||||
<?php endif; ?>
|
||||
@@ -95,7 +95,7 @@
|
||||
|
||||
<div class="address-subhead">
|
||||
<div class="address-qr">
|
||||
<img src="/qr/lbry%3A<?php echo $address->address ?>" alt="lbry:<?php echo $address->address ?>" />
|
||||
<img src="/qr/lbry%3A<?php echo $address->Address ?>" alt="lbry:<?php echo $address->Address ?>" />
|
||||
</div>
|
||||
|
||||
<div class="address-summary">
|
||||
@@ -152,14 +152,14 @@
|
||||
|
||||
<?php foreach ($recentTxs as $tx): ?>
|
||||
<tr>
|
||||
<td class="w125"><?php if ($tx->height === null): ?><em>Unconfirmed</em><?php else: ?><a href="/blocks/<?php echo $tx->height ?>"><?php echo $tx->height ?></a><?php endif; ?></td>
|
||||
<td class="w250"><div><a href="/tx/<?php echo $tx->hash ?>?address=<?php echo $address->address ?>#<?php echo $address->address ?>"><?php echo $tx->hash ?></a></div></td>
|
||||
<td><?php echo \DateTime::createFromFormat('U', $tx->transaction_time)->format('d M Y H:i:s') . ' UTC'; ?></td>
|
||||
<td class="right"><?php echo number_format($tx->confirmations, 0, '', ',') ?></td>
|
||||
<td class="right"><?php echo $tx->input_count ?></td>
|
||||
<td class="right"><?php echo $tx->output_count ?></td>
|
||||
<td class="right<?php echo ' ' . ($tx->debit_amount > 0 && $tx->credit_amount > 0 ? 'diff' : ($tx->debit_amount > 0 ? 'debit' : 'credit')) ?>">
|
||||
<?php echo number_format($tx->credit_amount - $tx->debit_amount, 8, '.', ',') ?> LBC
|
||||
<td class="w125"><?php if ($tx->Height === null): ?><em>Unconfirmed</em><?php else: ?><a href="/blocks/<?php echo $tx->Height ?>"><?php echo $tx->Height ?></a><?php endif; ?></td>
|
||||
<td class="w250"><div><a href="/tx/<?php echo $tx->Hash ?>?address=<?php echo $address->Address ?>#<?php echo $address->Address ?>"><?php echo $tx->Hash ?></a></div></td>
|
||||
<td><?php echo \DateTime::createFromFormat('U', $tx->TxTime)->format('d M Y H:i:s') . ' UTC'; ?></td>
|
||||
<td class="right"><?php echo number_format($tx->Confirmations, 0, '', ',') ?></td>
|
||||
<td class="right"><?php echo $tx->InputCount ?></td>
|
||||
<td class="right"><?php echo $tx->OutputCount ?></td>
|
||||
<td class="right<?php echo ' ' . ($tx->DebitAmount > 0 && $tx->CreditAmount > 0 ? 'diff' : ($tx->DebitAmount > 0 ? 'debit' : 'credit')) ?>">
|
||||
<?php echo number_format($tx->CreditAmount - $tx->DebitAmount, 8, '.', ',') ?> LBC
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
|
||||
@@ -21,19 +21,21 @@
|
||||
</script>
|
||||
<?php $this->end(); ?>
|
||||
|
||||
<?php $this->assign('title', 'Block Height ' . $block->height) ?>
|
||||
<?php $this->assign('title', 'Block Height ' . $block->Height) ?>
|
||||
|
||||
<div class="block-head">
|
||||
<h3>LBRY Block <?php echo $block->height ?></h3>
|
||||
<h4><?php echo $block->hash ?></h4>
|
||||
<h3>LBRY Block <?php echo $block->Height ?></h3>
|
||||
<h4><?php echo $block->Hash ?></h4>
|
||||
</div>
|
||||
|
||||
<div class="block-nav">
|
||||
<?php if ($block->height > 0): ?>
|
||||
<a class="btn btn-prev" href="/blocks/<?php echo ($block->height - 1); ?>">« Previous Block</a>
|
||||
<?php if (strlen(trim($block->PreviousBlockHash)) > 0): ?>
|
||||
<a class="btn btn-prev" href="/blocks/<?php echo ($block->Height - 1); ?>">« Previous Block</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<a class="btn btn-next" href="/blocks/<?php echo ($block->height + 1); ?>">Next Block »</a>
|
||||
<?php if (strlen(trim($block->NextBlockHash)) > 0): ?>
|
||||
<a class="btn btn-next" href="/blocks/<?php echo ($block->Height + 1); ?>">Next Block »</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
@@ -45,46 +47,44 @@
|
||||
<div class="label half-width">Block Size (bytes)</div>
|
||||
<div class="label half-width">Block Time</div>
|
||||
|
||||
<div class="value half-width"><?php echo number_format($block->block_size, 0, '', ',') ?></div>
|
||||
<div class="value half-width"><?php echo \DateTime::createFromFormat('U', $block->block_time)->format('j M Y H:i:s') . ' UTC' ?></div>
|
||||
<div class="value half-width"><?php echo number_format($block->BlockSize, 0, '', ',') ?></div>
|
||||
<div class="value half-width"><?php echo \DateTime::createFromFormat('U', $block->BlockTime)->format('j M Y H:i:s') . ' UTC' ?></div>
|
||||
|
||||
<div class="clear spacer"></div>
|
||||
|
||||
<div class="label half-width">Bits</div>
|
||||
<div class="label half-width">Confirmations</div>
|
||||
|
||||
<div class="value half-width"><?php echo $block->bits ?></div>
|
||||
<div class="value half-width"><?php echo $confirmations ?></div>
|
||||
<div class="value half-width"><?php echo $block->Bits ?></div>
|
||||
<div class="value half-width"><?php echo number_format($block->Confirmations, 0, '', ',') ?></div>
|
||||
|
||||
<div class="clear spacer"></div>
|
||||
|
||||
<div class="label half-width">Difficulty</div>
|
||||
<div class="label half-width">Nonce</div>
|
||||
|
||||
<div class="value half-width"><?php echo $this->Amount->format($block->difficulty, '') ?></div>
|
||||
<div class="value half-width"><?php echo $block->nonce ?></div>
|
||||
<div class="value half-width"><?php echo $this->Amount->format($block->Difficulty, '') ?></div>
|
||||
<div class="value half-width"><?php echo $block->Nonce ?></div>
|
||||
|
||||
<div class="clear spacer"></div>
|
||||
|
||||
<div class="label">Chainwork</div> <div class="value"><?php echo $block->chainwork ?></div>
|
||||
<div class="label">Chainwork</div> <div class="value"><?php echo $block->Chainwork ?></div>
|
||||
|
||||
<div class="spacer"></div>
|
||||
|
||||
<div class="label">MerkleRoot</div> <div class="value"><?php echo $block->merkle_root ?></div>
|
||||
<div class="label">MerkleRoot</div> <div class="value"><?php echo $block->MerkleRoot ?></div>
|
||||
|
||||
<div class="spacer"></div>
|
||||
|
||||
<div class="label">NameClaimRoot</div> <div class="value"><?php echo $block->name_claim_root ?></div>
|
||||
<div class="label">NameClaimRoot</div> <div class="value"><?php echo $block->NameClaimRoot ?></div>
|
||||
|
||||
<!--
|
||||
<div class="spacer"></div>
|
||||
|
||||
<div class="label">Target</div> <div class="value"><?php echo $block->Target ?></div>
|
||||
-->
|
||||
|
||||
<div class="spacer"></div>
|
||||
|
||||
<div class="label">Version</div> <div class="value"><?php echo $block->version ?></div>
|
||||
<div class="label">Version</div> <div class="value"><?php echo $block->Version ?></div>
|
||||
</div>
|
||||
|
||||
<div class="block-transactions">
|
||||
@@ -109,10 +109,10 @@
|
||||
|
||||
<?php foreach ($blockTxs as $tx): ?>
|
||||
<tr>
|
||||
<td class="w300"><div><a href="/tx/<?php echo $tx->hash ?>"><?php echo $tx->hash ?></a></div></td>
|
||||
<td class="right"><?php echo $tx->input_count ?></td>
|
||||
<td class="right"><?php echo $tx->output_count ?></td>
|
||||
<td class="right"><div title="<?php echo $tx->value ?> LBC"><?php echo $this->Amount->formatCurrency($tx->value) ?> LBC</div></td>
|
||||
<td class="w300"><div><a href="/tx/<?php echo $tx->Hash ?>"><?php echo $tx->Hash ?></a></div></td>
|
||||
<td class="right"><?php echo $tx->InputCount ?></td>
|
||||
<td class="right"><?php echo $tx->OutputCount ?></td>
|
||||
<td class="right"><div title="<?php echo $tx->Value ?> LBC"><?php echo $this->Amount->formatCurrency($tx->Value) ?> LBC</div></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
@@ -181,13 +181,13 @@
|
||||
<tbody>
|
||||
<?php foreach ($blocks as $block): ?>
|
||||
<tr>
|
||||
<td class="right"><a href="/blocks/<?php echo $block->height ?>"><?php echo $block->height ?></a></td>
|
||||
<td class="pad-left"><?php echo number_format($block->difficulty, 8, '.', '') ?></td>
|
||||
<td class="right"><?php echo number_format((($currentBlock->height - $block->height) + 1), 0, '', ',') ?></td>
|
||||
<td class="right"><?php echo count(preg_split('#,#', $block->transaction_hashes)) ?></td>
|
||||
<td class="right"><?php echo round($block->block_size / 1024, 2) . 'KB' ?></td>
|
||||
<td class="right pad-left"><?php echo $block->nonce ?></td>
|
||||
<td class="pad-left"><?php echo \DateTime::createFromFormat('U', $block->block_time)->format('d M Y H:i:s') ?> UTC</td>
|
||||
<td class="right"><a href="/blocks/<?php echo $block->Height ?>"><?php echo $block->Height ?></a></td>
|
||||
<td class="pad-left"><?php echo number_format($block->Difficulty, 8, '.', '') ?></td>
|
||||
<td class="right"><?php echo number_format((($currentBlock->Height - $block->Height) + 1), 0, '', ',') ?></td>
|
||||
<td class="right"><?php echo count(json_decode($block->TransactionHashes)) ?></td>
|
||||
<td class="right"><?php echo round($block->BlockSize / 1024, 2) . 'KB' ?></td>
|
||||
<td class="right pad-left"><?php echo $block->Nonce ?></td>
|
||||
<td class="pad-left"><?php echo \DateTime::createFromFormat('U', $block->BlockTime)->format('d M Y H:i:s') ?> UTC</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
|
||||
+173
-47
@@ -41,13 +41,13 @@
|
||||
$a = ['purple', 'orange', 'blue', 'teal', 'green', 'yellow'];
|
||||
$autoThumbText = $claim->getAutoThumbText();
|
||||
$cost = 'Free';
|
||||
if (isset($claim->price) && $claim->price > 0) {
|
||||
$cost = $this->Amount->formatCurrency($claim->price) . ' LBC';
|
||||
} else if (isset($claim->fee) && strtolower($claim->fee_currency) === 'lbc') {
|
||||
$cost = $this->Amount->formatCurrency($claim->fee) . ' LBC';
|
||||
if (isset($claim->Price) && $claim->Price > 0) {
|
||||
$cost = $this->Amount->formatCurrency($claim->Price) . ' LBC';
|
||||
} else if (isset($claim->Fee) && strtolower($claim->FeeCurrency) === 'lbc') {
|
||||
$cost = $this->Amount->formatCurrency($claim->Fee) . ' LBC';
|
||||
}
|
||||
|
||||
$desc = $claim->description;
|
||||
$desc = $claim->Description;
|
||||
if (strlen(trim($desc)) == 0) {
|
||||
$desc = '<em>No description available.</em>';
|
||||
} else {
|
||||
@@ -57,38 +57,29 @@ if (strlen(trim($desc)) == 0) {
|
||||
|
||||
?>
|
||||
|
||||
<?php $this->assign('title', 'Claim • ' . $claim->name) ?>
|
||||
<?php $this->assign('title', 'Claim • ' . $claim->Name) ?>
|
||||
|
||||
<div class="claims-head">
|
||||
<h3><a href="/claims">LBRY Claims</a> • <?php echo $claim->name ?></h3>
|
||||
<h4><?php echo $claim->claim_id ?></h4>
|
||||
<h3><a href="/claims">LBRY Claims</a> • <?php echo $claim->Name ?></h3>
|
||||
<h4><?php echo $claim->ClaimId ?></h4>
|
||||
</div>
|
||||
|
||||
<div class="claims-body">
|
||||
<?php if ($claimIsBlocked): ?>
|
||||
|
||||
<div class="blocked-claim-info">
|
||||
<div class="content">
|
||||
In response to a complaint we received under the US Digital Millennium Copyright Act, we have blocked access to this content from our applications. For more information, please refer to <a href="https://lbry.com/faq/dmca" target="_blank">DMCA takedown requests</a>.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php else: ?>
|
||||
<div class="claim-info">
|
||||
<div data-autothumb="<?php echo $autoThumbText ?>" class="thumbnail <?php echo $a[mt_rand(0, count($a) - 1)] ?>">
|
||||
<?php if (!$claim->is_nsfw && strlen(trim($claim->thumbnail_url)) > 0): ?>
|
||||
<img src="<?php echo htmlspecialchars($claim->thumbnail_url) ?>" alt="" />
|
||||
<?php if (!$claim->IsNSFW && strlen(trim($claim->ThumbnailUrl)) > 0): ?>
|
||||
<img src="<?php echo htmlspecialchars($claim->ThumbnailUrl) ?>" alt="" />
|
||||
<?php else: ?>
|
||||
<div class="autothumb"><?php echo $autoThumbText ?></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
<?php if ($claim->claim_type == 1): ?>
|
||||
<?php if ($claim->ClaimType == 2): ?>
|
||||
<div class="label">Published By</div>
|
||||
<div class="value">
|
||||
<?php if (isset($claim->publisher)): ?>
|
||||
<a href="lbry://<?php echo $claim->publisher ?>"><?php echo $claim->publisher ?></a>
|
||||
<?php if (isset($claim->Publisher)): ?>
|
||||
<a href="lbry://<?php echo $claim->Publisher->Name ?>"><?php echo $claim->Publisher->Name ?></a>
|
||||
<?php else: ?>
|
||||
<em>Anonymous</em>
|
||||
<?php endif; ?>
|
||||
@@ -96,17 +87,17 @@ if (strlen(trim($desc)) == 0) {
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="label">Created On</div>
|
||||
<div class="value"><?php echo \DateTime::createFromFormat('U', $claim->transaction_time > 0 ? $claim->transaction_time : $claim->created_at->format('U'))->format('j M Y H:i:s') ?> UTC</div>
|
||||
<div class="value"><?php echo \DateTime::createFromFormat('U', $claim->TransactionTime > 0 ? $claim->TransactionTime : $claim->Created->format('U'))->format('j M Y H:i:s') ?> UTC</div>
|
||||
|
||||
<div class="label">Transaction ID</div>
|
||||
<div class="value"><a href="/tx/<?php echo $claim->transaction_hash_id ?>#output-<?php echo $claim->vout ?>"><?php echo $claim->transaction_hash_id ?></a></div>
|
||||
<div class="value"><a href="/tx/<?php echo $claim->TransactionHash ?>#output-<?php echo $claim->Vout ?>"><?php echo $claim->TransactionHash ?></a></div>
|
||||
|
||||
<?php if ($claim->claim_type == 1): ?>
|
||||
<?php if ($claim->ClaimType == 2): ?>
|
||||
<div class="label half-width">Cost</div>
|
||||
<div class="label half-width">Safe for Work</div>
|
||||
|
||||
<div class="value half-width"><?php echo $cost ?></div>
|
||||
<div class="value half-width"><?php echo $claim->is_nsfw ? 'No' : 'Yes' ?></div>
|
||||
<div class="value half-width"><?php echo $claim->IsNSFW ? 'No' : 'Yes' ?></div>
|
||||
|
||||
<div class="clear"></div>
|
||||
<?php endif; ?>
|
||||
@@ -114,34 +105,30 @@ if (strlen(trim($desc)) == 0) {
|
||||
</div>
|
||||
|
||||
<div class="claim-metadata">
|
||||
<?php if ($claim->claim_type == 2): ?>
|
||||
<?php if ($claim->ClaimType == 1): ?>
|
||||
<div class="title">Identity Claim</div>
|
||||
<div class="desc">This is an identity claim.</div>
|
||||
<?php else: ?>
|
||||
<div class="title"><?php echo $claim->title ?></div>
|
||||
<div class="desc"><?php echo str_replace("\n", '<br />', $desc) ?></div>
|
||||
<div class="title"><?php echo $claim->Title ?></div>
|
||||
<div class="desc"><?php echo str_replace("\n", '<br/>', $desc) ?></div>
|
||||
|
||||
<div class="details">
|
||||
<div class="label half-width">Author</div>
|
||||
<div class="label half-width">Content Type</div>
|
||||
|
||||
|
||||
<div class="value half-width"><?php echo strlen(trim($claim->author)) > 0 ? $claim->author : '<em>Unspecified</em>' ?></div>
|
||||
<div class="value half-width"><?php echo strlen(trim($claim->content_type)) > 0 ? $claim->content_type : '<em>Unspecified</em>' ?></div>
|
||||
<div class="value half-width"><?php echo strlen(trim($claim->Author)) > 0 ? $claim->Author : '<em>Unspecified</em>' ?></div>
|
||||
<div class="value half-width"><?php echo strlen(trim($claim->ContentType)) > 0 ? $claim->ContentType : '<em>Unspecified</em>' ?></div>
|
||||
|
||||
<!--
|
||||
<div class="label half-width">License</div>
|
||||
-->
|
||||
<div class="label">Language</div>
|
||||
<div class="label half-width">Language</div>
|
||||
|
||||
<!--
|
||||
<div class="value half-width"<?php if(strlen(trim($claim->license)) > 0): ?> title="<?php echo $claim->license ?>"<?php endif; ?>>
|
||||
<?php if (strlen(trim($claim->license_url)) > 0): ?><a href="<?php echo $claim->LicenseUrl ?>" rel="nofollow" target="_blank"><?php endif; ?>
|
||||
<div class="value half-width"<?php if(strlen(trim($claim->License)) > 0): ?> title="<?php echo $claim->License ?>"<?php endif; ?>>
|
||||
<?php if (strlen(trim($claim->LicenseUrl)) > 0): ?><a href="<?php echo $claim->LicenseUrl ?>" rel="nofollow" target="_blank"><?php endif; ?>
|
||||
<?php echo strlen(trim($claim->License)) > 0 ? $claim->License : '<em>Unspecified</em>' ?>
|
||||
<?php if (strlen(trim($claim->LicenseUrl))): ?></a><?php endif; ?>
|
||||
</div>
|
||||
-->
|
||||
<div class="value half-width"><?php echo strlen(trim($claim->language)) > 0 ? ($claim->language == 'en' ? 'English' : '') : '<em>Unspecified</em>' ?></div>
|
||||
<div class="value half-width"><?php echo strlen(trim($claim->Language)) > 0 ? ($claim->Language == 'en' ? 'English' : '') : '<em>Unspecified</em>' ?></div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<a href="<?php echo $claim->getLbryLink() ?>" class="open-lbry-link">Open in LBRY</a>
|
||||
@@ -149,12 +136,11 @@ if (strlen(trim($desc)) == 0) {
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (count($moreClaims) > 0): ?>
|
||||
|
||||
<div class="more-claims">
|
||||
<h4><?php echo isset($claim->publisher) ? 'More from the publisher' : 'Published by this identity' ?></h4>
|
||||
<h4><?php echo isset($claim->Publisher) ? 'More from the publisher' : 'Published by this identity' ?></h4>
|
||||
|
||||
<div class="claims-grid">
|
||||
<?php $idx = 1; $row = 1; $rowCount = ceil(count($moreClaims) / 3);
|
||||
@@ -164,9 +150,80 @@ if (strlen(trim($desc)) == 0) {
|
||||
if ($idx % 3 == 0) {
|
||||
$row++;
|
||||
}
|
||||
echo $this->element('claimbox', array('claim' => $claim, 'idx' => $idx, 'last_row' => $last_row));
|
||||
$idx++;
|
||||
endforeach; ?>
|
||||
|
||||
$autoThumbText = $claim->getAutoThumbText();
|
||||
$cost = '';
|
||||
if (isset($claim->Price) && $claim->Price > 0) {
|
||||
$cost = $this->Amount->formatCurrency($claim->Price) . ' LBC';
|
||||
} else if (isset($claim->Fee) && strtolower($claim->FeeCurrency) === 'lbc') {
|
||||
$cost = $this->Amount->formatCurrency($claim->Fee) . ' LBC';
|
||||
}
|
||||
|
||||
// content type
|
||||
$ctTag = $claim->getContentTag();
|
||||
?>
|
||||
<div data-id="<?php echo $claim->ClaimId ?>" class="claim-grid-item<?php if ($idx % 3 == 0): ?> last-item<?php endif; ?><?php if ($last_row): ?> last-row<?php endif; ?>">
|
||||
<?php if (strlen(trim($cost)) > 0): ?>
|
||||
<div class="price-tag"><?php echo $cost ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="tags">
|
||||
<?php if ($ctTag): ?>
|
||||
<div class="content-type"><?php echo strtoupper($ctTag) ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if ($claim->IsNSFW): ?>
|
||||
<div class="nsfw">NSFW</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div data-autothumb="<?php echo $autoThumbText ?>" class="thumbnail <?php echo $a[mt_rand(0, count($a) - 1)] ?>">
|
||||
<?php if (!$claim->IsNSFW && strlen(trim($claim->ThumbnailUrl)) > 0): ?>
|
||||
<img src="<?php echo htmlspecialchars($claim->ThumbnailUrl) ?>" alt="" />
|
||||
<?php else: ?>
|
||||
<div class="autothumb"><?php echo $autoThumbText ?></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="metadata">
|
||||
<div class="title" title="<?php echo $claim->ClaimType == 1 ? $claim->Name : ((strlen(trim($claim->Title)) > 0) ? $claim->Title : '') ?>"><?php echo $claim->ClaimType == 1 ? $claim->Name : ((strlen(trim($claim->Title)) > 0) ? $claim->Title : '<em>No Title</em>') ?></div>
|
||||
<div class="link" title="<?php echo $claim->getLbryLink() ?>"><a href="<?php echo $claim->getLbryLink() ?>" rel="nofollow"><?php echo $claim->getLbryLink() ?></a></div>
|
||||
|
||||
<div class="desc"><?php echo strlen(trim($claim->Description)) > 0 ? $claim->Description : '<em>No description available</em>' ?></div>
|
||||
|
||||
<div class="label half-width">Transaction</div>
|
||||
<div class="label half-width">Created</div>
|
||||
|
||||
<div class="value half-width"><a href="/tx/<?php echo $claim->TransactionHash ?>#output-<?php echo $claim->Vout ?>" title="<?php echo $claim->TransactionHash ?>"><?php echo $claim->TransactionHash ?></a></div>
|
||||
<div class="value half-width" title="<?php echo $claim->Created->format('j M Y H:i:s') ?> UTC">
|
||||
<?php echo \Carbon\Carbon::createFromTimestamp($claim->Created->format('U'))->diffForHumans(); ?>
|
||||
</div>
|
||||
|
||||
<div class="clear spacer"></div>
|
||||
|
||||
<?php if ($claim->ClaimType == 2): ?>
|
||||
<div class="label half-width">Content Type</div>
|
||||
<div class="label half-width">Language</div>
|
||||
|
||||
<div class="value half-width" title="<?php echo $claim->ContentType ?>"><?php echo $claim->ContentType ?></div>
|
||||
<div class="value half-width" title="<?php echo $claim->Language == 'en' ? 'English' : $claim->Language ?>"><?php echo $claim->Language == 'en' ? 'English' : $claim->Language ?></div>
|
||||
|
||||
<div class="clear spacer"></div>
|
||||
|
||||
<div class="label half-width">Author</div>
|
||||
<div class="label half-width">License</div>
|
||||
|
||||
<div class="value half-width" title="<?php echo strlen(trim($claim->Author)) > 0 ? $claim->Author : '<em>Unspecified</em>' ?>"><?php echo strlen(trim($claim->Author)) > 0 ? $claim->Author : '<em>Unspecified</em>' ?></div>
|
||||
<div class="value half-width" title="<?php echo strlen(trim($claim->License)) > 0 ? $claim->License : '' ?>">
|
||||
<?php if (strlen(trim($claim->LicenseUrl)) > 0): ?><a href="<?php echo $claim->LicenseUrl ?>" rel="nofollow" target="_blank"><?php endif; ?>
|
||||
<?php echo strlen(trim($claim->License)) > 0 ? $claim->License : '<em>Unspecified</em>' ?>
|
||||
<?php if (strlen(trim($claim->LicenseUrl))): ?></a><?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<?php $idx++; endforeach; ?>
|
||||
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -195,9 +252,78 @@ if (strlen(trim($desc)) == 0) {
|
||||
if ($idx % 3 == 0) {
|
||||
$row++;
|
||||
}
|
||||
echo $this->element('claimbox', array('claim' => $claim, 'idx' => $idx, 'last_row' => $last_row));
|
||||
$idx++;
|
||||
endforeach; ?>
|
||||
$autoThumbText = $claim->getAutoThumbText();
|
||||
$cost = '';
|
||||
if (isset($claim->Price) && $claim->Price > 0) {
|
||||
$cost = $this->Amount->formatCurrency($claim->Price) . ' LBC';
|
||||
} else if (isset($claim->Fee) && strtolower($claim->FeeCurrency) === 'lbc') {
|
||||
$cost = $this->Amount->formatCurrency($claim->Fee) . ' LBC';
|
||||
}
|
||||
|
||||
// content type
|
||||
$ctTag = $claim->getContentTag();
|
||||
?>
|
||||
<div data-id="<?php echo $claim->ClaimId ?>" class="claim-grid-item<?php if ($idx % 3 == 0): ?> last-item<?php endif; ?><?php if ($last_row): ?> last-row<?php endif; ?>">
|
||||
<?php if (strlen(trim($cost)) > 0): ?>
|
||||
<div class="price-tag"><?php echo $cost ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="tags">
|
||||
<?php if ($ctTag): ?>
|
||||
<div class="content-type"><?php echo strtoupper($ctTag) ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if ($claim->IsNSFW): ?>
|
||||
<div class="nsfw">NSFW</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div data-autothumb="<?php echo $autoThumbText ?>" class="thumbnail <?php echo $a[mt_rand(0, count($a) - 1)] ?>">
|
||||
<?php if (!$claim->IsNSFW && strlen(trim($claim->ThumbnailUrl)) > 0): ?>
|
||||
<img src="<?php echo htmlspecialchars($claim->ThumbnailUrl) ?>" alt="" />
|
||||
<?php else: ?>
|
||||
<div class="autothumb"><?php echo $autoThumbText ?></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="metadata">
|
||||
<div class="title" title="<?php echo $claim->ClaimType == 1 ? $claim->Name : ((strlen(trim($claim->Title)) > 0) ? $claim->Title : '') ?>"><?php echo $claim->ClaimType == 1 ? $claim->Name : ((strlen(trim($claim->Title)) > 0) ? $claim->Title : '<em>No Title</em>') ?></div>
|
||||
<div class="link" title="<?php echo $claim->getLbryLink() ?>"><a href="<?php echo $claim->getLbryLink() ?>" rel="nofollow"><?php echo $claim->getLbryLink() ?></a></div>
|
||||
|
||||
<div class="desc"><?php echo strlen(trim($claim->Description)) > 0 ? $claim->Description : '<em>No description available</em>' ?></div>
|
||||
|
||||
<div class="label half-width">Transaction</div>
|
||||
<div class="label half-width">Created</div>
|
||||
|
||||
<div class="value half-width"><a href="/tx/<?php echo $claim->TransactionHash ?>#output-<?php echo $claim->Vout ?>" title="<?php echo $claim->TransactionHash ?>"><?php echo $claim->TransactionHash ?></a></div>
|
||||
<div class="value half-width" title="<?php echo $claim->Created->format('j M Y H:i:s') ?> UTC">
|
||||
<?php echo \Carbon\Carbon::createFromTimestamp($claim->TransactionTime > 0 ? $claim->TransactionTime : $claim->Created->format('U'))->diffForHumans(); ?>
|
||||
</div>
|
||||
|
||||
<div class="clear spacer"></div>
|
||||
|
||||
<?php if ($claim->ClaimType == 2): ?>
|
||||
<div class="label half-width">Content Type</div>
|
||||
<div class="label half-width">Language</div>
|
||||
|
||||
<div class="value half-width" title="<?php echo $claim->ContentType ?>"><?php echo $claim->ContentType ?></div>
|
||||
<div class="value half-width" title="<?php echo $claim->Language == 'en' ? 'English' : $claim->Language ?>"><?php echo $claim->Language == 'en' ? 'English' : $claim->Language ?></div>
|
||||
|
||||
<div class="clear spacer"></div>
|
||||
|
||||
<div class="label half-width">Author</div>
|
||||
<div class="label half-width">License</div>
|
||||
|
||||
<div class="value half-width" title="<?php echo strlen(trim($claim->Author)) > 0 ? $claim->Author : '<em>Unspecified</em>' ?>"><?php echo strlen(trim($claim->Author)) > 0 ? $claim->Author : '<em>Unspecified</em>' ?></div>
|
||||
<div class="value half-width" title="<?php echo strlen(trim($claim->License)) > 0 ? $claim->License : '' ?>">
|
||||
<?php if (strlen(trim($claim->LicenseUrl)) > 0): ?><a href="<?php echo $claim->LicenseUrl ?>" rel="nofollow" target="_blank"><?php endif; ?>
|
||||
<?php echo strlen(trim($claim->License)) > 0 ? $claim->License : '<em>Unspecified</em>' ?>
|
||||
<?php if (strlen(trim($claim->LicenseUrl))): ?></a><?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php $idx++; endforeach; ?>
|
||||
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -54,9 +54,77 @@
|
||||
if ($idx % 3 == 0) {
|
||||
$row++;
|
||||
}
|
||||
echo $this->element('claimbox', array('claim' => $claim, 'idx' => $idx, 'last_row' => $last_row));
|
||||
$idx++;
|
||||
endforeach; ?>
|
||||
$autoThumbText = $claim->getAutoThumbText();
|
||||
$cost = '';
|
||||
if (isset($claim->Price) && $claim->Price > 0) {
|
||||
$cost = $this->Amount->formatCurrency($claim->Price) . ' LBC';
|
||||
} else if (isset($claim->Fee) && strtolower($claim->FeeCurrency) === 'lbc') {
|
||||
$cost = $this->Amount->formatCurrency($claim->Fee) . ' LBC';
|
||||
}
|
||||
|
||||
// content type
|
||||
$ctTag = $claim->getContentTag();
|
||||
?>
|
||||
<div data-id="<?php echo $claim->ClaimId ?>" class="claim-grid-item<?php if ($idx % 3 == 0): ?> last-item<?php endif; ?><?php if ($last_row): ?> last-row<?php endif; ?>">
|
||||
<?php if (strlen(trim($cost)) > 0): ?>
|
||||
<div class="price-tag"><?php echo $cost ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="tags">
|
||||
<?php if ($ctTag): ?>
|
||||
<div class="content-type"><?php echo strtoupper($ctTag) ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if ($claim->IsNSFW): ?>
|
||||
<div class="nsfw">NSFW</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div data-autothumb="<?php echo $autoThumbText ?>" class="thumbnail <?php echo $a[mt_rand(0, count($a) - 1)] ?>">
|
||||
<?php if (!$claim->IsNSFW && strlen(trim($claim->ThumbnailUrl)) > 0): ?>
|
||||
<img src="<?php echo htmlspecialchars($claim->ThumbnailUrl) ?>" alt="" />
|
||||
<?php else: ?>
|
||||
<div class="autothumb"><?php echo $autoThumbText ?></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="metadata">
|
||||
<div class="title" title="<?php echo $claim->ClaimType == 1 ? $claim->Name : ((strlen(trim($claim->Title)) > 0) ? $claim->Title : '') ?>"><?php echo $claim->ClaimType == 1 ? $claim->Name : ((strlen(trim($claim->Title)) > 0) ? $claim->Title : '<em>No Title</em>') ?></div>
|
||||
<div class="link" title="<?php echo $claim->getLbryLink() ?>"><a href="<?php echo $claim->getLbryLink() ?>" rel="nofollow"><?php echo $claim->getLbryLink() ?></a></div>
|
||||
|
||||
<div class="desc"><?php echo strlen(trim($claim->Description)) > 0 ? $claim->Description : '<em>No description available</em>' ?></div>
|
||||
|
||||
<div class="label half-width">Transaction</div>
|
||||
<div class="label half-width">Created</div>
|
||||
|
||||
<div class="value half-width"><a href="/tx/<?php echo $claim->TransactionHash ?>#output-<?php echo $claim->Vout ?>" title="<?php echo $claim->TransactionHash ?>"><?php echo $claim->TransactionHash ?></a></div>
|
||||
<div class="value half-width" title="<?php echo $claim->Created->format('j M Y H:i:s') ?> UTC">
|
||||
<?php echo \Carbon\Carbon::createFromTimestamp($claim->Created->format('U'))->diffForHumans(); ?>
|
||||
</div>
|
||||
<div class="clear spacer"></div>
|
||||
|
||||
<?php if ($claim->ClaimType == 2): ?>
|
||||
<div class="label half-width">Content Type</div>
|
||||
<div class="label half-width">Language</div>
|
||||
|
||||
<div class="value half-width" title="<?php echo $claim->ContentType ?>"><?php echo $claim->ContentType ?></div>
|
||||
<div class="value half-width" title="<?php echo $claim->Language == 'en' ? 'English' : $claim->Language ?>"><?php echo $claim->Language == 'en' ? 'English' : $claim->Language ?></div>
|
||||
|
||||
<div class="clear spacer"></div>
|
||||
|
||||
<div class="label half-width">Author</div>
|
||||
<div class="label half-width">License</div>
|
||||
|
||||
<div class="value half-width" title="<?php echo strlen(trim($claim->Author)) > 0 ? $claim->Author : '<em>Unspecified</em>' ?>"><?php echo strlen(trim($claim->Author)) > 0 ? $claim->Author : '<em>Unspecified</em>' ?></div>
|
||||
<div class="value half-width" title="<?php echo strlen(trim($claim->License)) > 0 ? $claim->License : '' ?>">
|
||||
<?php if (strlen(trim($claim->LicenseUrl)) > 0): ?><a href="<?php echo $claim->LicenseUrl ?>" rel="nofollow" target="_blank"><?php endif; ?>
|
||||
<?php echo strlen(trim($claim->License)) > 0 ? $claim->License : '<em>Unspecified</em>' ?>
|
||||
<?php if (strlen(trim($claim->LicenseUrl))): ?></a><?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php $idx++; endforeach; ?>
|
||||
|
||||
<?php else: ?>
|
||||
<div class="no-results">No results were found.</div>
|
||||
<?php endif; ?>
|
||||
|
||||
+28
-21
@@ -113,7 +113,7 @@
|
||||
<div class="home-container">
|
||||
<div class="home-container-cell">
|
||||
<div class="main">
|
||||
<div class="title">LBRY Block Explorer</div><br>
|
||||
<div class="title">LBRY Block Explorer</div><br/>
|
||||
<form method="get" action="/find">
|
||||
<input class="search-input" name="q" type="text" placeholder="Enter a block height or hash, claim id or name, transaction hash or address" />
|
||||
<div class="ctls">
|
||||
@@ -129,12 +129,12 @@
|
||||
<div class="stats">
|
||||
<div class="box box-20">
|
||||
<div class="title">Block Height</div>
|
||||
<div class="value"><?php echo $recentBlocks[0]->height ?></div>
|
||||
<div class="value"><?php echo $recentBlocks[0]->Height ?></div>
|
||||
</div>
|
||||
|
||||
<div class="box box-30">
|
||||
<div class="title">Difficulty</div>
|
||||
<div class="value" title="<?php echo $recentBlocks[0]->difficulty ?>"><?php echo number_format($recentBlocks[0]->difficulty, 2, '.', '') ?></div>
|
||||
<div class="value" title="<?php echo $recentBlocks[0]->Difficulty ?>"><?php echo number_format($recentBlocks[0]->Difficulty, 2, '.', '') ?></div>
|
||||
</div>
|
||||
|
||||
<div class="box box-30">
|
||||
@@ -167,13 +167,13 @@
|
||||
|
||||
<tbody>
|
||||
<?php foreach ($recentBlocks as $block): ?>
|
||||
<tr data-height="<?php echo $block->height ?>" data-time="<?php echo $block->block_time ?>">
|
||||
<td><a href="/blocks/<?php echo $block->height ?>"><?php echo $block->height ?></a></td>
|
||||
<td><?php echo \Carbon\Carbon::createFromTimestamp($block->block_time)->diffForHumans(); ?></td>
|
||||
<td class="right"><?php echo round($block->block_size / 1024, 2) . 'KB' ?></td>
|
||||
<td class="right"><?php echo $block->transaction_count ?></td>
|
||||
<td class="right"><?php echo number_format($block->difficulty, 2, '.', '') ?></td>
|
||||
<td class="last-cell"><?php echo DateTime::createFromFormat('U', $block->block_time)->format('d M Y H:i:s') . ' UTC' ?></td>
|
||||
<tr data-height="<?php echo $block->Height ?>" data-time="<?php echo $block->BlockTime ?>">
|
||||
<td><a href="/blocks/<?php echo $block->Height ?>"><?php echo $block->Height ?></a></td>
|
||||
<td><?php echo \Carbon\Carbon::createFromTimestamp($block->BlockTime)->diffForHumans(); ?></td>
|
||||
<td class="right"><?php echo round($block->BlockSize / 1024, 2) . 'KB' ?></td>
|
||||
<td class="right"><?php echo $block->TransactionCount ?></td>
|
||||
<td class="right"><?php echo number_format($block->Difficulty, 2, '.', '') ?></td>
|
||||
<td class="last-cell"><?php echo DateTime::createFromFormat('U', $block->BlockTime)->format('d M Y H:i:s') . ' UTC' ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
@@ -183,43 +183,50 @@
|
||||
<div class="recent-claims">
|
||||
<h3>Recent Claims</h3>
|
||||
<a class="claim-explorer-link" href="/claims">Claims Explorer</a>
|
||||
<?php $idx = 0; $a = ['purple', 'orange', 'blue', 'teal', 'green', 'yellow'];
|
||||
foreach ($recentClaims as $claim):
|
||||
<?php $idx = 0; $a = ['purple', 'orange', 'blue', 'teal', 'green', 'yellow']; foreach ($recentClaims as $claim):
|
||||
$idx++;
|
||||
$autoThumbText = $claim->getAutoThumbText();
|
||||
$link = $claim->Name;
|
||||
$rawLink = $claim->Name;
|
||||
if (isset($claim->Publisher->Name)) {
|
||||
$link = urlencode($claim->Publisher->Name) . '/' . $link;
|
||||
$rawLink = $claim->Publisher->Name . '/' . $link;
|
||||
}
|
||||
$link = 'lbry://' . $link;
|
||||
$rawLink = 'lbry://' . $rawLink;
|
||||
|
||||
// content type
|
||||
$ctTag = $claim->getContentTag();
|
||||
?>
|
||||
<div data-id="<?php echo $claim->claim_id ?>" class="claim-box<?php if ($idx == 5): ?> last<?php endif; ?>">
|
||||
<div data-id="<?php echo $claim->ClaimId ?>" class="claim-box<?php if ($idx == 5): ?> last<?php endif; ?>">
|
||||
<div class="tags">
|
||||
<?php if ($ctTag): ?>
|
||||
<div class="content-type"><?php echo strtoupper($ctTag) ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if ($claim->is_nsfw): ?>
|
||||
<?php if ($claim->IsNSFW): ?>
|
||||
<div class="nsfw">NSFW</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div data-autothumb="<?php echo $autoThumbText ?>" class="thumbnail <?php echo $a[mt_rand(0, count($a) - 1)] ?>">
|
||||
<?php if (!$claim->is_nsfw && strlen(trim($claim->thumbnail_url)) > 0): ?>
|
||||
<img src="<?php echo strip_tags($claim->thumbnail_url) ?>" alt="" />
|
||||
<?php if (!$claim->IsNSFW && strlen(trim($claim->ThumbnailUrl)) > 0): ?>
|
||||
<img src="<?php echo strip_tags($claim->ThumbnailUrl) ?>" alt="" />
|
||||
<?php else: ?>
|
||||
<div class="autothumb"><?php echo $autoThumbText ?></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="metadata">
|
||||
<div class="title" title="<?php echo $claim->claim_type == 1 ? $claim->name : ((strlen(trim($claim->title)) > 0) ? $claim->title : ''); ?>"><?php echo $claim->claim_type == 1 ? $claim->name : ((strlen(trim($claim->title)) > 0) ? $claim->title : '<em>No Title</em>') ?></div>
|
||||
<div class="link" title="<?php echo $claim->getLbryLink() ?>"><a href="<?php echo $claim->getLbryLink() ?>"><?php echo $claim->getLbryLink() ?></a></div>
|
||||
<div class="title" title="<?php echo $claim->ClaimType == 1 ? $claim->Name : ((strlen(trim($claim->Title)) > 0) ? $claim->Title : ''); ?>"><?php echo $claim->ClaimType == 1 ? $claim->Name : ((strlen(trim($claim->Title)) > 0) ? $claim->Title : '<em>No Title</em>') ?></div>
|
||||
<div class="link" title="<?php echo $rawLink ?>"><a href="<?php echo $link ?>"><?php echo $rawLink ?></a></div>
|
||||
|
||||
<div class="clear"></div>
|
||||
<?php if ($claim->claim_type == 2 && strlen(trim($claim->description)) > 0): ?>
|
||||
<div class="desc"><?php echo $claim->description ?></div>
|
||||
<?php if ($claim->ClaimType == 2 && strlen(trim($claim->Description)) > 0): ?>
|
||||
<div class="desc"><?php echo $claim->Description ?></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<a class="tx-link" href="/tx/<?php echo $claim->transaction_hash_id ?>#output-<?php echo $claim->vout ?>" target="_blank">Transaction</a>
|
||||
<a class="tx-link" href="/tx/<?php echo $claim->TransactionHash ?>#output-<?php echo $claim->Vout ?>" target="_blank">Transaction</a>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
|
||||
|
||||
@@ -128,10 +128,10 @@
|
||||
|
||||
<tbody>
|
||||
<?php foreach ($blocks as $block): ?>
|
||||
<tr data-height="<?php echo $block->height ?>" data-time="<?php echo $block->block_time ?>">
|
||||
<td><a href="/blocks/<?php echo $block->height ?>" target="_blank"><?php echo $block->height ?></a></td>
|
||||
<td><?php echo \Carbon\Carbon::createFromTimestamp($block->block_time)->diffForHumans(); ?></td>
|
||||
<td class="right"><?php echo $block->transaction_count ?></td>
|
||||
<tr data-height="<?php echo $block->Height ?>" data-time="<?php echo $block->BlockTime ?>">
|
||||
<td><a href="/blocks/<?php echo $block->Height ?>" target="_blank"><?php echo $block->Height ?></a></td>
|
||||
<td><?php echo \Carbon\Carbon::createFromTimestamp($block->BlockTime)->diffForHumans(); ?></td>
|
||||
<td class="right"><?php echo $block->TransactionCount ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
@@ -153,12 +153,12 @@
|
||||
|
||||
<tbody>
|
||||
<?php foreach ($txs as $tx): ?>
|
||||
<tr data-hash="<?php echo $tx->hash ?>" data-time="<?php echo $tx->transaction_time ?>">
|
||||
<td class="w200"><div><a href="/tx/<?php echo $tx->hash ?>" target="_blank"><?php echo $tx->hash ?></a></div></td>
|
||||
<td><?php echo $tx->created_at->diffForHumans(); ?></td>
|
||||
<td class="right"><?php echo $tx->input_count ?></td>
|
||||
<td class="right"><?php echo $tx->output_count ?></td>
|
||||
<td class="right"><?php echo number_format($tx->value, 8, '.', '') ?> LBC</td>
|
||||
<tr data-hash="<?php echo $tx->Hash ?>" data-time="<?php echo $tx->TxTime ?>">
|
||||
<td class="w200"><div><a href="/tx/<?php echo $tx->Hash ?>" target="_blank"><?php echo $tx->Hash ?></a></div></td>
|
||||
<td><?php echo \Carbon\Carbon::createFromTimestamp($tx->TxTime)->diffForHumans(); ?></td>
|
||||
<td class="right"><?php echo $tx->InputCount ?></td>
|
||||
<td class="right"><?php echo $tx->OutputCount ?></td>
|
||||
<td class="right"><?php echo number_format($tx->Value, 8, '.', '') ?> LBC</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
|
||||
@@ -47,8 +47,8 @@
|
||||
<?php $rank = 0; foreach ($richList as $item): $rank++; ?>
|
||||
<tr>
|
||||
<td class="right topvalign"><?php echo $rank ?></td>
|
||||
<td class="topvalign"><a href="/address/<?php echo $item->address ?>" target="_blank"><?php echo $item->address ?></a>
|
||||
<?php if(in_array($item->address, $lbryAddresses)): ?>
|
||||
<td class="topvalign"><a href="/address/<?php echo $item->Address ?>" target="_blank"><?php echo $item->Address ?></a>
|
||||
<?php if(in_array($item->Address, $lbryAddresses)): ?>
|
||||
<span class="lbry-address">
|
||||
<img src="/img/lbry.png" height="18px" width="18px" title="Address owned by LBRY Inc."/>
|
||||
</span>
|
||||
@@ -58,14 +58,16 @@
|
||||
<?php if (strlen(trim($item->TagUrl)) > 0): ?><a href="<?php echo $item->TagUrl ?>" target="_blank" rel="nofollow"><?php echo $tiem->Tag ?></a><?php else: echo $item->Tag; endif; ?>
|
||||
</div>
|
||||
<?php endif; ?></td>
|
||||
<td class="right topvalign"><?php echo number_format($item->balance, 8, '.', ',') ?></td>
|
||||
<td class="right topvalign">$<?php echo number_format(bcmul($item->balance, $rate, 8), 2, '.', ',') ?></td>
|
||||
<td class="med-pad-left topvalign"><?php echo $item->first_seen->format('d M Y H:i:s') . ' UTC'; ?></td>
|
||||
<td class="right topvalign"><?php echo number_format($item->Balance, 8, '.', ',') ?></td>
|
||||
<td class="right topvalign">$<?php echo number_format(bcmul($item->Balance, $rate, 8), 2, '.', ',') ?></td>
|
||||
<td class="med-pad-left topvalign"><?php echo $item->FirstSeen->format('d M Y H:i:s') . ' UTC'; ?></td>
|
||||
<td class="w150 center top500-percent-cell"><div class="top500-percent" style="width: <?php echo $item->MinMaxPercent ?>%"></div><div class="text"><?php echo number_format($item->Top500Percent, 5, '.', '') ?>%</div></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
</div>
|
||||
+33
-34
@@ -14,22 +14,22 @@
|
||||
|
||||
<div class="tx-head">
|
||||
<h3>LBRY Transaction</h3>
|
||||
<h4><?php echo $tx->hash ?></h4>
|
||||
<h4><?php echo $tx->Hash ?></h4>
|
||||
</div>
|
||||
|
||||
<div class="tx-time">
|
||||
<div class="created-time">
|
||||
<h3 title="Represents the time this transaction was created on the explorer">Time Created</h3>
|
||||
<div><?php echo $tx->created_at->format('j M Y H:i:s') . ' UTC '; ?></div>
|
||||
<div><?php echo $tx->Created->format('j M Y H:i:s') . ' UTC '; ?></div>
|
||||
</div>
|
||||
|
||||
<div class="conf-time">
|
||||
<h3 title="The time the first confirmation of this transaction happened on the blockchain">Block Time</h3>
|
||||
<div><?php echo ($tx->transaction_time == null || strlen(trim($tx->transaction_time)) == 0) ? '<em>Not yet confirmed</em>' :
|
||||
\DateTime::createFromFormat('U', $tx->transaction_time)->format('j M Y H:i:s') . ' UTC' ?>
|
||||
<div><?php echo ($tx->TransactionTime == null || strlen(trim($tx->TransactionTime)) == 0) ? '<em>Not yet confirmed</em>' :
|
||||
\DateTime::createFromFormat('U', $tx->TransactionTime)->format('j M Y H:i:s') . ' UTC' ?>
|
||||
|
||||
<?php if ($tx->transaction_time > $tx->created_at->getTimestamp()):
|
||||
$diffSeconds = $tx->transaction_time - $tx->created_at->getTimestamp();
|
||||
<?php if ($tx->TransactionTime > $tx->Created->getTimestamp()):
|
||||
$diffSeconds = $tx->TransactionTime - $tx->Created->getTimestamp();
|
||||
if ($diffSeconds <= 60) {
|
||||
echo sprintf(' (+%s second%s)', $diffSeconds, $diffSeconds == 1 ? '' : 's');
|
||||
} else {
|
||||
@@ -47,15 +47,15 @@
|
||||
<div class="tx-summary">
|
||||
<div class="box p25">
|
||||
<div class="title">Amount (LBC)</div>
|
||||
<div class="value"><?php echo $this->Amount->format($tx->value) ?></div>
|
||||
<div class="value"><?php echo $this->Amount->format($tx->Value) ?></div>
|
||||
</div>
|
||||
|
||||
<div class="box p15">
|
||||
<div class="title">Block Height</div>
|
||||
<?php if (!isset($tx->block_hash_id) || strlen(trim($tx->block_hash_id)) === 0): ?>
|
||||
<?php if (!isset($tx->BlockHash) || strlen(trim($tx->BlockHash)) === 0): ?>
|
||||
<div class="value" title="Unconfirmed">Unconf.</div>
|
||||
<?php else: ?>
|
||||
<div class="value" title="<?php echo $tx->block_hash_id ?>"><a href="/blocks/<?php echo $block->height ?>"><?php echo $block->height ?></a></div>
|
||||
<div class="value" title="<?php echo $tx->BlockHash ?>"><a href="/blocks/<?php echo $block->Height ?>"><?php echo $block->Height ?></a></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
@@ -66,17 +66,17 @@
|
||||
|
||||
<div class="box p15">
|
||||
<div class="title">Size (bytes)</div>
|
||||
<div class="value"><?php echo number_format($tx->transaction_size, 0, '', ',') ?></div>
|
||||
<div class="value"><?php echo number_format($tx->TransactionSize, 0, '', ',') ?></div>
|
||||
</div>
|
||||
|
||||
<div class="box p15">
|
||||
<div class="title">Inputs</div>
|
||||
<div class="value"><?php echo $tx->input_count ?></div>
|
||||
<div class="value"><?php echo $tx->InputCount ?></div>
|
||||
</div>
|
||||
|
||||
<div class="box p15 last">
|
||||
<div class="title">Outputs</div>
|
||||
<div class="value"><?php echo $tx->output_count ?></div>
|
||||
<div class="value"><?php echo $tx->OutputCount ?></div>
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
@@ -86,29 +86,28 @@
|
||||
<h3>Details</h3>
|
||||
<div class="tx-details-layout">
|
||||
<div class="inputs">
|
||||
<div class="subtitle"><?php echo $tx->input_count ?> input<?php echo $tx->input_count === 1 ? '' : 's'; ?></div>
|
||||
<div class="subtitle"><?php echo $tx->InputCount ?> input<?php echo $tx->InputCount === 1 ? '' : 's'; ?></div>
|
||||
|
||||
<?php
|
||||
$setAddressIds = [];
|
||||
foreach ($inputs as $in):
|
||||
?>
|
||||
<div id="input-<?php echo $in->id ?>" class="input <?php if (isset($in->input_addresses) && count($in->input_addresses) > 0 && $in->input_addresses[0]->address == $sourceAddress): ?>is-source<?php endif; ?>">
|
||||
<?php if ($in->is_coinbase): ?>
|
||||
<div id="input-<?php echo $in->Id ?>" class="input <?php if (isset($in['InputAddresses']) && count($in['InputAddresses']) > 0 && $in->inputAddresses[0]->Address == $sourceAddress): ?>is-source<?php endif; ?>">
|
||||
<?php if ($in['IsCoinbase']): ?>
|
||||
<div>Block Reward (New Coins)</div>
|
||||
<?php else: ?>
|
||||
<?php if (strlen(trim($in->value)) == 0): ?>
|
||||
<?php if (strlen(trim($in->Value)) == 0): ?>
|
||||
<div>Incomplete data</div>
|
||||
<?php else:
|
||||
$addr = $in->input_addresses[0];
|
||||
$addr = $in->inputAddresses[0];
|
||||
|
||||
if (!isset($setAddressIds[$addr->address])):
|
||||
$setAddressIds[$addr->address] = 1; ?>
|
||||
<a id="<?php echo $addr->address ?>"></a>
|
||||
if (!isset($setAddressIds[$addr->Address])):
|
||||
$setAddressIds[$addr->Address] = 1; ?>
|
||||
<a id="<?php echo $addr->Address ?>"></a>
|
||||
<?php endif; ?>
|
||||
<div><span class="value"><?php echo $this->Amount->format($in->value) ?> LBC</span> from</div>
|
||||
<div class="address"><a href="/address/<?php echo $addr->address ?>"><?php echo $addr->address ?></a>
|
||||
(<a class="output-link" href="/tx/<?php echo $in->prevout_hash ?>#output-<?php echo $in->prevout_n ?>">output</a>)
|
||||
|
||||
<div><span class="value"><?php echo $this->Amount->format($in['Value']) ?> LBC</span> from</div>
|
||||
<div class="address"><a href="/address/<?php echo $addr->Address ?>"><?php echo $addr->Address ?></a>
|
||||
(<a class="output-link" href="/tx/<?php echo $in->PrevoutHash ?>#output-<?php echo $in->PrevoutN ?>">output</a>)
|
||||
<?php if (isset($addr->Tag) && strlen(trim($addr->Tag)) > 0): ?>
|
||||
<div class="tag">
|
||||
<?php if (strlen(trim($addr->TagUrl)) > 0): ?><a href="<?php echo $addr->TagUrl ?>" target="_blank" rel="nofollow"><?php echo $addr->Tag ?></a><?php else: echo $addr->Tag; endif; ?>
|
||||
@@ -126,7 +125,7 @@
|
||||
</div>
|
||||
|
||||
<div class="outputs">
|
||||
<div class="subtitle"><?php echo $tx->output_count ?> output<?php echo $tx->output_count === 1 ? '' : 's'; ?>
|
||||
<div class="subtitle"><?php echo $tx->OutputCount ?> output<?php echo $tx->OutputCount === 1 ? '' : 's'; ?>
|
||||
|
||||
<?php if ($fee > 0): ?>
|
||||
<span class="fee"><span class="label">Fee</span> <span class="value"><?php echo $this->Amount->format($fee) ?> LBC</span></span>
|
||||
@@ -135,7 +134,7 @@
|
||||
|
||||
<?php
|
||||
foreach ($outputs as $out): ?>
|
||||
<div id="output-<?php echo $out->vout ?>" class="output <?php if (isset($out->output_addresses) && count($out->output_addresses) > 0 && $out->output_addresses[0]->address == $sourceAddress): ?>is-source<?php endif; ?>">
|
||||
<div id="output-<?php echo $out->Vout ?>" class="output <?php if (isset($out['OutputAddresses']) && count($out['OutputAddresses']) > 0 && $out->outputAddresses[0]->Address == $sourceAddress): ?>is-source<?php endif; ?>">
|
||||
<div class="labels">
|
||||
<?php if($out->Claim && ($out->IsClaim or $out->IsSupportClaim or $out->IsUpdateClaim)): ?><a class="view-claim" href="<?php echo $out->Claim->getExplorerLink() ?>">View</a><?php endif; ?>
|
||||
<?php if($out->IsSupportClaim): ?><div class="support">SUPPORT</div><?php endif; ?>
|
||||
@@ -143,19 +142,19 @@
|
||||
<?php if($out->IsClaim): ?><div class="claim">CLAIM</div><?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php if (strlen(trim($out->value)) == 0): ?>
|
||||
<?php if (strlen(trim($out['Value'])) == 0): ?>
|
||||
<div>Incomplete data</div>
|
||||
<?php else:
|
||||
$addr = $out->output_addresses[0];
|
||||
$addr = $out->outputAddresses[0];
|
||||
|
||||
if (!isset($setAddressIds[$addr->address])):
|
||||
$setAddressIds[$addr->address] = 1; ?>
|
||||
<a id="<?php echo $addr->address ?>"></a>
|
||||
if (!isset($setAddressIds[$addr->Address])):
|
||||
$setAddressIds[$addr->Address] = 1; ?>
|
||||
<a id="<?php echo $addr->Address ?>"></a>
|
||||
<?php endif; ?>
|
||||
<div><span class="value"><?php echo $this->Amount->format($out->value) ?> LBC</span> to</div>
|
||||
<div class="address"><a href="/address/<?php echo $addr->address ?>"><?php echo $addr->address ?></a>
|
||||
<div><span class="value"><?php echo $this->Amount->format($out['Value']) ?> LBC</span> to</div>
|
||||
<div class="address"><a href="/address/<?php echo $addr->Address ?>"><?php echo $addr->Address ?></a>
|
||||
|
||||
<?php if ($out->is_spent): ?>(<a href="/tx/<?php if(isset($out->spend_input_id)) { echo $out->spend_input_hash; } ?>#input-<?php if(isset($out->spend_input_id)) {echo $out->spend_input_id; } ?>">spent</a>)<?php else: ?>(unspent)<?php endif; ?>
|
||||
<?php if ($out->IsSpent): ?>(<a href="/tx/<?php echo $out->SpendInput->TransactionHash ?>#input-<?php echo $out->SpendInput->Id ?>">spent</a>)<?php else: ?>(unspent)<?php endif; ?>
|
||||
|
||||
<?php if (isset($addr->Tag) && strlen(trim($addr->Tag)) > 0): ?>
|
||||
<div class="tag">
|
||||
|
||||
@@ -59,8 +59,8 @@ $cakeDescription = 'CakePHP: the rapid development PHP framework';
|
||||
<div id="url-rewriting-warning" class="alert url-rewriting">
|
||||
<ul>
|
||||
<li class="bullet problem">
|
||||
URL rewriting is not properly configured on your server.<br />
|
||||
1) <a target="_blank" href="http://book.cakephp.org/3.0/en/installation.html#url-rewriting">Help me configure it</a><br />
|
||||
URL rewriting is not properly configured on your server.<br/>
|
||||
1) <a target="_blank" href="http://book.cakephp.org/3.0/en/installation.html#url-rewriting">Help me configure it</a><br/>
|
||||
2) <a target="_blank" href="http://book.cakephp.org/3.0/en/development/configuration.html#general-configuration">I don't / can't use URL rewriting</a>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -139,7 +139,7 @@ $cakeDescription = 'CakePHP: the rapid development PHP framework';
|
||||
if (method_exists($connectionError, 'getAttributes')):
|
||||
$attributes = $connectionError->getAttributes();
|
||||
if (isset($errorMsg['message'])):
|
||||
$errorMsg .= '<br />' . $attributes['message'];
|
||||
$errorMsg .= '<br/>' . $attributes['message'];
|
||||
endif;
|
||||
endif;
|
||||
}
|
||||
@@ -148,7 +148,7 @@ $cakeDescription = 'CakePHP: the rapid development PHP framework';
|
||||
<?php if ($connected): ?>
|
||||
<li class="bullet success">CakePHP is able to connect to the database.</li>
|
||||
<?php else: ?>
|
||||
<li class="bullet problem">CakePHP is NOT able to connect to the database.<br /><?= $errorMsg ?></li>
|
||||
<li class="bullet problem">CakePHP is NOT able to connect to the database.<br/><?= $errorMsg ?></li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -188,7 +188,7 @@ $cakeDescription = 'CakePHP: the rapid development PHP framework';
|
||||
<div class="columns large-12 text-center">
|
||||
<h3 class="more">More about Cake</h3>
|
||||
<p>
|
||||
CakePHP is a rapid development framework for PHP which uses commonly known design patterns like Front Controller and MVC.<br />
|
||||
CakePHP is a rapid development framework for PHP which uses commonly known design patterns like Front Controller and MVC.<br/>
|
||||
Our primary goal is to provide a structured framework that enables PHP users at all levels to rapidly develop robust web applications, without any loss to flexibility.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
namespace App\View;
|
||||
|
||||
use Cake\Event\EventManager;
|
||||
use Cake\Http\ServerRequest;
|
||||
use Cake\Network\Request;
|
||||
use Cake\Network\Response;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
.bids-chart-container { width: 1200px; margin: 0 auto 48px auto; box-shadow: 0 2px 6px rgba(0,0,0,.175); border: 1px solid rgba(0,0,0,.15); padding: 24px 36px; position: relative; overflow: hidden }
|
||||
.bids-chart-container .load-progress { position: absolute; top: 0; left: 0; width: 100%; height: 3px; background: #1e88e5; animation: indeterminate 4s linear infinite; }
|
||||
.bids-chart-container .chart { height: 414px }
|
||||
.bids-chart-container .btn-chart-export { position: absolute; right: 40px; bottom: 36px }
|
||||
@keyframes indeterminate {
|
||||
from { left: -70%; }
|
||||
to { left: 100% }
|
||||
}
|
||||
@@ -81,9 +81,7 @@ border-radius: 0 8px 8px 0 }
|
||||
.claims-grid .claim-grid-item .thumbnail .autothumb { display: block; margin: 73px auto 0 auto; text-align: center; font-size: 240%; color: #fff; line-height: 54px }
|
||||
.claims-grid .claim-grid-item .tags > div { display: inline-block; padding: 4px 12px; margin-left: 2px }
|
||||
.claims-grid .claim-grid-item .tags .nsfw { background: #e53935; text-align: center; color: #fff; position: relative; left: 1px }
|
||||
.claims-grid .claim-grid-item .tags .bid-state { background: #551CA1; text-align: center; color: #fff; }
|
||||
.claims-grid .claim-grid-item .tags .content-type { background: #880e4f; text-align: center; color: #fff; }
|
||||
.claims-grid .claim-grid-item .blocked-info { padding: 24px; font-size: 90%; }
|
||||
.claims-grid .claim-grid-item .metadata { padding: 24px; font-size: 90% }
|
||||
.claims-grid .claim-grid-item .title { font-size: 120%; height: 25px; line-height: 25px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
|
||||
.claims-grid .claim-grid-item .desc { font-size: 90%; font-weight: 300; height: 72px; overflow: hidden; text-overflow: ellipsis; margin: 8px 0 20px 0; line-height: 24px }
|
||||
@@ -96,8 +94,6 @@ border-radius: 0 8px 8px 0 }
|
||||
.claims-grid .claim-grid-item .spacer { height: 16px }
|
||||
|
||||
.claims-body { width: 1200px; margin: 0 auto 0 auto; cursor: default }
|
||||
.claims-body .blocked-claim-info { border: 1px solid rgba(0,0,0,.15); cursor: default }
|
||||
.claims-body .blocked-claim-info .content { padding: 48px }
|
||||
.claims-body .claim-info { width: 400px; float: left; /*box-shadow: 0 2px 4px rgba(0,0,0,.175);*/ border: 1px solid rgba(0,0,0,.15); cursor: default }
|
||||
.claims-body .claim-info .thumbnail { width: 100%; height: 220px; background: #f0f0f0; display: block; position: relative; overflow: hidden }
|
||||
.claims-body .claim-info .thumbnail img { width: 100% }
|
||||
|
||||
@@ -1,170 +0,0 @@
|
||||
function buildChartData(claimsData) {
|
||||
var chartData = [];
|
||||
var lastDate = 0;
|
||||
var nbClaimsDay = 0;
|
||||
var nbClaimsTotal = 0;
|
||||
var bidClaimsDay = 0;
|
||||
var bidClaimsTotal = 0;
|
||||
var nbChannelsDay = 0;
|
||||
var nbChannelsTotal = 0;
|
||||
for(var i = 0; i < claimsData.length; i++) {
|
||||
if(claimsData[i].transaction_time == 0) {
|
||||
continue;
|
||||
}
|
||||
var transactionDate = new Date(claimsData[i].transaction_time * 1000);
|
||||
transactionDate.setHours(0,0,0,0)
|
||||
if(lastDate == 0) {
|
||||
lastDate = transactionDate;
|
||||
}
|
||||
if(transactionDate.toString() != lastDate.toString()) {
|
||||
nbClaimsTotal += nbClaimsDay;
|
||||
bidClaimsTotal += bidClaimsDay;
|
||||
var dateData = {
|
||||
date: lastDate,
|
||||
NumberClaims: nbClaimsTotal,
|
||||
BidsClaims: bidClaimsTotal,
|
||||
};
|
||||
chartData.push(dateData);
|
||||
nbClaimsDay = 0;
|
||||
bidClaimsDay = 0;
|
||||
lastDate = transactionDate;
|
||||
}
|
||||
if(claimsData[i].claim_type == 1) {
|
||||
nbClaimsDay += 1;
|
||||
bidClaimsDay += claimsData[i].effective_amount/100000000;
|
||||
}
|
||||
}
|
||||
return chartData;
|
||||
}
|
||||
|
||||
function loadChartData() {
|
||||
var api_url = "https://chainquery.lbry.com/api/sql?query=";
|
||||
var query = "SELECT c1.claim_type, c1.bid_state, c1.effective_amount, c1.transaction_time, o.transaction_time AS 'spent_time' FROM claim c1 LEFT JOIN (SELECT output.claim_id, tx.transaction_time FROM output INNER JOIN input ON input.prevout_hash = output.transaction_hash AND input.prevout_n = output.vout INNER JOIN transaction tx ON tx.id = input.transaction_id) o ON o.claim_id=c1.claim_id AND c1.bid_state='Spent' ORDER BY c1.transaction_time ASC";
|
||||
var url = api_url + query;
|
||||
var loadProgress = $('.bids-chart-container .load-progress');
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'get',
|
||||
dataType: 'json',
|
||||
beforeSend: function() {
|
||||
chartLoadInProgress = true;
|
||||
loadProgress.css({ display: 'block' });
|
||||
},
|
||||
success: function(response) {
|
||||
if(response.success) {
|
||||
chartData = buildChartData(response.data);
|
||||
if(chart) {
|
||||
chart.dataProvider = chartData;
|
||||
chart.validateNow();
|
||||
chart.validateData();
|
||||
}
|
||||
}
|
||||
else {
|
||||
console.log("Could not fetch block data.");
|
||||
}
|
||||
},
|
||||
complete: function() {
|
||||
chartLoadInProgress = false;
|
||||
loadProgress.css({ display: 'none' });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var chart;
|
||||
var chartData = [];
|
||||
var chartLoadInProgress = false;
|
||||
AmCharts.ready(function() {
|
||||
chart = AmCharts.makeChart('bids-chart', {
|
||||
type: 'serial',
|
||||
theme: 'light',
|
||||
mouseWheelZoomEnabled: true,
|
||||
height: '100%',
|
||||
categoryField: 'date',
|
||||
synchronizeGrid: true,
|
||||
dataProvider: chartData,
|
||||
responsive: {
|
||||
enabled: true,
|
||||
},
|
||||
valueAxes: [
|
||||
{
|
||||
id: 'v-number-claims',
|
||||
axisColor: '#1e88e5',
|
||||
axisThickness: 2,
|
||||
position: 'left',
|
||||
},
|
||||
{
|
||||
id: 'v-bids-claims',
|
||||
axisColor: '#0b7a06',
|
||||
axisThickness: 2,
|
||||
position: 'left',
|
||||
offset: 75,
|
||||
},
|
||||
],
|
||||
categoryAxis: {
|
||||
parseDates: true,
|
||||
autoGridCount: false,
|
||||
minorGridEnabled: true,
|
||||
minorGridAlpha: 0.04,
|
||||
axisColor: '#dadada',
|
||||
twoLineMode: true
|
||||
},
|
||||
graphs: [
|
||||
{
|
||||
id: 'g-number-claims',
|
||||
valueAxis: 'v-number-claims',
|
||||
title: 'Number of claims',
|
||||
valueField: 'NumberClaims',
|
||||
bullet: 'round',
|
||||
bulletBorderThickness: 1,
|
||||
bulletBorderAlpha: 1,
|
||||
bulletColor: '#ffffff',
|
||||
bulletSize: 5,
|
||||
useLineColorForBulletBorder: true,
|
||||
lineColor: '#1e88e5',
|
||||
hideBulletsCount: 101,
|
||||
balloonText: '[[NumberClaims]]',
|
||||
},
|
||||
{
|
||||
id: 'g-bids-claims',
|
||||
valueAxis: 'v-bids-claims',
|
||||
title: 'Bids for claims (LBC)',
|
||||
valueField: 'BidsClaims',
|
||||
bullet: 'round',
|
||||
bulletBorderThickness: 1,
|
||||
bulletBorderAlpha: 1,
|
||||
bulletColor: '#ffffff',
|
||||
bulletSize: 5,
|
||||
useLineColorForBulletBorder: true,
|
||||
lineColor: '#0b7a06',
|
||||
balloonText: '[[BidsClaims]] LBC',
|
||||
hideBulletsCount: 101
|
||||
},
|
||||
],
|
||||
chartCursor: {
|
||||
cursorAlpha: 0.1,
|
||||
fullWidth: true,
|
||||
valueLineBalloonEnabled: true,
|
||||
categoryBalloonColor: '#333333',
|
||||
cursorColor: '#1e88e5'
|
||||
},
|
||||
chartScrollbar: {
|
||||
scrollbarHeight: 36,
|
||||
color: '#888888',
|
||||
gridColor: '#bbbbbb'
|
||||
},
|
||||
legend: {
|
||||
marginLeft: 110,
|
||||
useGraphSettings: true,
|
||||
valueText: "",
|
||||
spacing: 64,
|
||||
|
||||
},
|
||||
export: {
|
||||
enabled: true,
|
||||
fileName: 'lbry-bids-chart',
|
||||
position: 'bottom-right',
|
||||
divId: 'chart-export'
|
||||
}
|
||||
});
|
||||
loadChartData();
|
||||
});
|
||||
@@ -85,6 +85,7 @@ function buildChartData(blockData) {
|
||||
inflationRate = ((supply - lastYearSupply) / lastYearSupply) * 100;
|
||||
if(i % skip == 0) { // Only push 1/<skip> of all blocks to optimize data loading
|
||||
chartData.push({
|
||||
date: new Date(blockTime * 1000),
|
||||
date: new Date(blockTime * 1000),
|
||||
AvailableSupply: supply,
|
||||
RewardLBC: reward,
|
||||
@@ -97,8 +98,8 @@ function buildChartData(blockData) {
|
||||
}
|
||||
|
||||
function loadChartData() {
|
||||
var api_url = "https://chainquery.lbry.com/api/sql?query=";
|
||||
var query = "SELECT height, block_time FROM block WHERE confirmations > 0 ORDER BY height";
|
||||
var api_url = "https://chainquery.lbry.io/api/sql?query=";
|
||||
var query = "SELECT id, block_time FROM block";
|
||||
var url = api_url + query;
|
||||
var loadProgress = $('.mining-inflation-chart-container .load-progress');
|
||||
$.ajax({
|
||||
@@ -261,4 +262,4 @@ divId: 'chart-export'
|
||||
}
|
||||
});
|
||||
loadChartData();
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user