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 {
`hostPage`.`timeAdded`, `hostPage`.`timeAdded`,
`hostPage`.`timeUpdated`, `hostPage`.`timeUpdated`,
`hostPage`.`mime`, `hostPage`.`mime`,
`hostPage`.`size`,
`host`.`scheme`, `host`.`scheme`,
`host`.`name`, `host`.`name`,
`host`.`port` `host`.`port`

18
public/explore.php

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

Loading…
Cancel
Save