Browse Source

show page size in explorer view, hide not available data

main
ghost 2 years ago
parent
commit
f3475035c2
  1. 1
      library/mysql.php
  2. 18
      public/explore.php

1
library/mysql.php

@ -223,6 +223,7 @@ class MySQL { @@ -223,6 +223,7 @@ class MySQL {
`hostPage`.`timeAdded`,
`hostPage`.`timeUpdated`,
`hostPage`.`mime`,
`hostPage`.`size`,
`host`.`scheme`,
`host`.`name`,
`host`.`port`

18
public/explore.php

@ -228,18 +228,19 @@ $placeholder = Filter::plural($totalPages, [sprintf(_('Over %s page or enter the @@ -228,18 +228,19 @@ $placeholder = Filter::plural($totalPages, [sprintf(_('Over %s page or enter the
</a>
</div>
<div>
<p><?php echo _('MIME') ?></p>
<p><?php echo $hostPage->mime ? _('MIME') : false ?></p>
<p><?php echo $hostPage->mime ?></p>
<p><?php echo _('Time added') ?></p>
<p><?php echo $hostPage->size ? _('Size') : false ?></p>
<p><?php echo $hostPage->size ?></p>
<p><?php echo $hostPage->timeAdded ? _('Time added') : false ?></p>
<p><?php echo date('c', $hostPage->timeAdded) ?></p>
<p><?php echo _('Time updated') ?></p>
<p><?php echo $hostPage->timeUpdated ? _('Time updated') : false ?></p>
<p><?php echo date('c', $hostPage->timeUpdated) ?></p>
<?php $totalHostPageSnaps = $db->getTotalHostPageSnaps($hp); ?>
<p>
<?php echo Filter::plural($totalHostPageSnaps, [sprintf(_('%s snap'), $totalHostPageSnaps),
<?php echo $totalHostPageSnaps ? Filter::plural($totalHostPageSnaps, [sprintf(_('%s snap'), $totalHostPageSnaps),
sprintf(_('%s snaps'), $totalHostPageSnaps),
sprintf(_('%s snaps'), $totalHostPageSnaps),
]) ?>
sprintf(_('%s snaps'), $totalHostPageSnaps)]) : false ?>
</p>
<?php if ($totalHostPageSnaps) { ?>
<?php foreach ($db->getHostPageSnaps($hp) as $hostPageSnap) { ?>
@ -252,10 +253,9 @@ $placeholder = Filter::plural($totalPages, [sprintf(_('Over %s page or enter the @@ -252,10 +253,9 @@ $placeholder = Filter::plural($totalPages, [sprintf(_('Over %s page or enter the
<?php } ?>
<?php $totalHostPageIdSources = $db->getTotalHostPageIdSourcesByHostPageIdTarget($hp); ?>
<p>
<?php echo Filter::plural($totalHostPageIdSources, [sprintf(_('%s referrer'), $totalHostPageIdSources),
sprintf(_('%s referrers'), $totalHostPageIdSources),
<?php echo $totalHostPageIdSources ? Filter::plural($totalHostPageIdSources, [sprintf(_('%s referrer'), $totalHostPageIdSources),
sprintf(_('%s referrers'), $totalHostPageIdSources),
]) ?>
sprintf(_('%s referrers'), $totalHostPageIdSources)]) : false ?>
</p>
<?php if ($totalHostPageIdSources) { ?>
<?php foreach ($db->getHostPageIdSourcesByHostPageIdTarget($hp) as $hostPageIdSource) { ?>

Loading…
Cancel
Save