added more claims to identity claim page
This commit is contained in:
parent
5f98c38c39
commit
6472a7ca49
2 changed files with 11 additions and 9 deletions
|
@ -131,6 +131,7 @@ class MainController extends AppController {
|
|||
return $this->redirect('/');
|
||||
}
|
||||
|
||||
if (isset($claim->Stream)) {
|
||||
$json = json_decode($claim->Stream->Stream);
|
||||
if (isset($json->metadata->license)) {
|
||||
$claim->License = $json->metadata->license;
|
||||
|
@ -138,12 +139,13 @@ class MainController extends AppController {
|
|||
if (isset($json->metadata->licenseUrl)) {
|
||||
$claim->LicenseUrl = $json->metadata->licenseUrl;
|
||||
}
|
||||
}
|
||||
|
||||
$moreClaims = [];
|
||||
if (isset($claim->Publisher)) {
|
||||
if (isset($claim->Publisher) || $claim->ClaimType == 1) {
|
||||
// find more claims for the publisher
|
||||
$moreClaims = $this->Claims->find()->contain(['Stream', 'Publisher' => ['fields' => ['Name']]])->
|
||||
where(['Claims.ClaimType' => 2, 'Claims.Id <>' => $claim->Id, 'Claims.PublisherId' => $claim->Publisher->ClaimId])->
|
||||
where(['Claims.ClaimType' => 2, 'Claims.Id <>' => $claim->Id, 'Claims.PublisherId' => isset($claim->Publisher) ? $claim->Publisher->ClaimId : $claim->ClaimId])->
|
||||
limit(9)->order(['RAND()' => 'DESC'])->toArray();
|
||||
for ($i = 0; $i < count($moreClaims); $i++) {
|
||||
if (isset($moreClaims[$i]->Stream)) {
|
||||
|
|
|
@ -138,7 +138,7 @@ if (strlen(trim($desc)) == 0) {
|
|||
<?php if (count($moreClaims) > 0): ?>
|
||||
|
||||
<div class="more-claims">
|
||||
<h4>More from the publisher</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); foreach ($moreClaims as $claim):
|
||||
|
|
Loading…
Reference in a new issue