diff --git a/src/Controller/MainController.php b/src/Controller/MainController.php index 5155a6d..8e63956 100644 --- a/src/Controller/MainController.php +++ b/src/Controller/MainController.php @@ -30,6 +30,8 @@ class MainController extends AppController { const tagReceiptAddress = 'bLockNgmfvnnnZw7bM6SPz6hk5BVzhevEp'; + const blockedListUrl = 'https://api.lbry.com/file/list_blocked'; + protected $redis; public function initialize() { @@ -220,8 +222,23 @@ class MainController extends AppController { } } } + + // fetch blocked list + $blockedList = json_decode(self::curl_get(self::blockedListUrl)); + $blockedOutpoints = $blockedList->data->outpoints; + $claimIsBlocked = false; + foreach ($blockedOutpoints as $outpoint) { + // $parts[0] = txid + // $parts[1] = vout + $parts = explode(':', $outpoint); + if ($claim->transaction_hash_id == $parts[0] && $claim->vout == $parts[1]) { + $claimIsBlocked = true; + } + } + $this->set('claim', $claim); - $this->set('moreClaims', $moreClaims); + $this->set('claimIsBlocked', $claimIsBlocked); + $this->set('moreClaims', $claimIsBlocked ? [] : $moreClaims); } } diff --git a/src/Template/Main/claims.ctp b/src/Template/Main/claims.ctp index 4458105..ac4fed2 100644 --- a/src/Template/Main/claims.ctp +++ b/src/Template/Main/claims.ctp @@ -65,6 +65,15 @@ if (strlen(trim($desc)) == 0) {
+ + +
+
+ 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 DMCA takedown requests. +
+
+ +
is_nsfw && strlen(trim($claim->thumbnail_url)) > 0): ?> @@ -140,6 +149,7 @@ if (strlen(trim($desc)) == 0) {
+ 0): ?> @@ -155,7 +165,7 @@ if (strlen(trim($desc)) == 0) { $row++; } echo $this->element('claimbox', array('claim' => $claim, 'idx' => $idx, 'last_row' => $last_row)); - $idx++; + $idx++; endforeach; ?>
diff --git a/webroot/css/main.css b/webroot/css/main.css index 2f1a828..57dcee6 100644 --- a/webroot/css/main.css +++ b/webroot/css/main.css @@ -95,6 +95,8 @@ 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% }