Browse Source

make paths relative

main
ghost 12 months ago
parent
commit
880764aa49
  1. 4
      example/config.json
  2. 6
      src/webui/explore.php
  3. 2
      src/webui/index.php
  4. 8
      src/webui/search.php

4
example/config.json

@ -23,10 +23,6 @@ @@ -23,10 +23,6 @@
},
"webui":
{
"url":
{
"base":"http://127.0.0.1"
},
"pagination":
{
"limit":20

6
src/webui/explore.php

@ -300,8 +300,8 @@ foreach ($config->snap->storage->remote->ftp as $i => $ftp) @@ -300,8 +300,8 @@ foreach ($config->snap->storage->remote->ftp as $i => $ftp)
</head>
<body>
<header>
<form name="search" method="GET" action="<?php echo $config->webui->url->base; ?>/search.php">
<h1><a href="<?php echo $config->webui->url->base; ?>"><?php echo _('Yo!') ?></a></h1>
<form name="search" method="GET" action="search.php">
<h1><a href="./"><?php echo _('Yo!') ?></a></h1>
<input type="text" name="q" placeholder="<?php echo $placeholder ?>" value="" />
<button type="submit">
<sub>
@ -377,7 +377,7 @@ foreach ($config->snap->storage->remote->ftp as $i => $ftp) @@ -377,7 +377,7 @@ foreach ($config->snap->storage->remote->ftp as $i => $ftp)
<ul>
<?php foreach ($snap as $file) { ?>
<li>
<a rel="nofollow" href="<?php echo $config->webui->url->base; ?>/api.php?action=snap&method=download&source=<?php echo $file->source ?>&md5url=<?php echo $file->md5url ?>&time=<?php echo $file->time ?>">
<a rel="nofollow" href="api.php?action=snap&method=download&source=<?php echo $file->source ?>&md5url=<?php echo $file->md5url ?>&time=<?php echo $file->time ?>">
<?php echo sprintf('%s (tar.gz / %s bytes)', date('c', $file->time), number_format($file->size)) ?>
</a>
</li>

2
src/webui/index.php

@ -272,7 +272,7 @@ $placeholder = sprintf( @@ -272,7 +272,7 @@ $placeholder = sprintf(
</head>
<body>
<header>
<form name="search" method="GET" action="<?php echo $config->webui->url->base; ?>/search.php">
<form name="search" method="GET" action="search.php">
<h1><?php echo _('Yo!') ?></h1>
<input type="text" name="q" placeholder="<?php echo $placeholder ?>" value="" />
<button type="submit">

8
src/webui/search.php

@ -305,8 +305,8 @@ $results = $query->offset($p * $config->webui->pagination->limit - $config->webu @@ -305,8 +305,8 @@ $results = $query->offset($p * $config->webui->pagination->limit - $config->webu
</head>
<body>
<header>
<form name="search" method="GET" action="<?php echo $config->webui->url->base; ?>/search.php">
<h1><a href="<?php echo $config->webui->url->base; ?>"><?php echo _('Yo!') ?></a></h1>
<form name="search" method="GET" action="search.php">
<h1><a href="./"><?php echo _('Yo!') ?></a></h1>
<input type="text" name="q" placeholder="<?php echo $placeholder ?>" value="<?php echo htmlentities($q) ?>" />
<button type="submit">
<sub>
@ -366,14 +366,14 @@ $results = $query->offset($p * $config->webui->pagination->limit - $config->webu @@ -366,14 +366,14 @@ $results = $query->offset($p * $config->webui->pagination->limit - $config->webu
<div>
<a href="<?php echo $result->url ?>"><?php echo htmlentities(urldecode($result->url)) ?></a>
<small>&bull;</small>
<a rel="nofollow" href="<?php echo $config->webui->url->base; ?>/explore.php?i=<?php echo $result->getId() ?>"><?php echo _('explore') ?></a>
<a rel="nofollow" href="explore.php?i=<?php echo $result->getId() ?>"><?php echo _('explore') ?></a>
</div>
</div>
<?php } ?>
<?php if ($p * $config->webui->pagination->limit <= $results->getTotal()) { ?>
<div>
<div>
<a href="<?php echo $config->webui->url->base; ?>/search.php?q=<?php echo urlencode(htmlentities($q)) ?>&p=<?php echo $p + 1 ?>">
<a href="search.php?q=<?php echo urlencode(htmlentities($q)) ?>&p=<?php echo $p + 1 ?>">
<?php echo _('More') ?>
</a>
</div>

Loading…
Cancel
Save