Soshot/inc/index.php

42 lines
1.5 KiB
PHP
Raw Normal View History

<form method="post">
<p>
<input type="url" placeholder="<?php echo $defUrl; ?>" value="<?php echo $defUrl; ?>" name="url"/>
</p>
<p>
<label>Size</label>
<select name="s">
<?php
foreach ($GLOBALS['config']['thumbSize'] as $key => $value) {
if ($value === $width) {
echo '<option value="', $key, '" selected="selected">', $value, '</option>';
} else {
echo '<option value="', $key, '">', $value, '</option>';
}
}
?>
</select>
</p>
<p>
<label>Force refresh</label>
<input type="checkbox" value="1" name="fr" />
</p>
<p>
<input type="hidden" name="token" value="<?php echo genToken(); ?>" />
<input type="submit" value="Generate"/>
</p>
<p class="info">
<a href="http://forge.leslibres.org/projects/soshot">Homepage</a>
</p>
</form>
<?php
if (!empty($success)) {
echo '<div id="result">';
echo '<h3>This image will be removed in ', $GLOBALS['config']['expireCache'], 'h</h3>';
echo '<img src="data:image/png;base64,',base64_encode(file_get_contents($success['thumb'])), '"/>';
echo '<p><label>Thumbshot</label><input type="text" value="http://', $_SERVER['SERVER_NAME'], '/', $success['thumb'], '" onclick="this.select()"/>';
if ($GLOBALS['config']['onlyThumb'] === false) {
echo '<p><label>1280x1024</label><input type="text" value="http://', $_SERVER['SERVER_NAME'], '/', $success['thumb'], '" onclick="this.select()"/></p>';
}
echo '</div>';
}