Use short tags for php echo

This commit is contained in:
Marc MAURICE 2013-08-17 21:01:29 +02:00
parent 4e42aa333d
commit 6b66fbdda7
4 changed files with 25 additions and 25 deletions

View file

@ -1 +1 @@
<div id="thumbsize" style="visibility:hidden"><?php echo THUMB_SIZE ?></div> <div id="thumbsize" style="visibility:hidden"><?= THUMB_SIZE ?></div>

View file

@ -1,5 +1,5 @@
<?php if ($GLOBALS['imageFiles'] or $GLOBALS['otherFiles']) { ?> <?php if ($GLOBALS['imageFiles'] or $GLOBALS['otherFiles']) { ?>
<div style="text-align: center; font-size: 0.25cm;"> <div style="text-align: center; font-size: 0.25cm;">
<a href="<?php echo $GLOBALS['rootUrl']."plugins/tar/tar.php".$GLOBALS['simplePath'] ?>">Download all files in this directory</a> <a href="<?= $GLOBALS['rootUrl']."plugins/tar/tar.php".$GLOBALS['simplePath'] ?>">Download all files in this directory</a>
</div> </div>
<?php } ?> <?php } ?>

View file

@ -1,6 +1,6 @@
<html> <html>
<head> <head>
<title> <?php echo IMAGES_DIR.$simpleImagePath ?> </title> <title> <?= IMAGES_DIR.$simpleImagePath ?> </title>
<style type="text/css"> <style type="text/css">
html, body { html, body {
height: 100%; height: 100%;
@ -45,28 +45,28 @@ img {
</style> </style>
<?php if ($nextImageUrl !== '' and $firefox) { ?> <?php if ($nextImageUrl !== '' and $firefox) { ?>
<link rel="prefetch" href="<?php echo $nextImageUrl ?>" /> <link rel="prefetch" href="<?= $nextImageUrl ?>" />
<link rel="prefetch" href="<?php echo $nextPageUrl ?>" /> <link rel="prefetch" href="<?= $nextPageUrl ?>" />
<?php } ?> <?php } ?>
</head> </head>
<body> <body>
<a href="<?php echo $imageUrl ?>"><img src="<?php echo $imageUrl ?>" id="theimage" /></a> <a href="<?= $imageUrl ?>"><img src="<?= $imageUrl ?>" id="theimage" /></a>
<div id="up"> <div id="up">
<a href="<?php echo $directoryUrl ?>" title="Back to directory">^</a> <a href="<?= $directoryUrl ?>" title="Back to directory">^</a>
</div> </div>
<?php if ($nextPageUrl !== '') { ?> <?php if ($nextPageUrl !== '') { ?>
<div id="next"> <div id="next">
<a href="<?php echo $nextPageUrl ?>" title="Next image">&gt;</a> <a href="<?= $nextPageUrl ?>" title="Next image">&gt;</a>
</div> </div>
<?php } ?> <?php } ?>
<?php if ($prevPageUrl !== '') { ?> <?php if ($prevPageUrl !== '') { ?>
<div id="previous"> <div id="previous">
<a href="<?php echo $prevPageUrl ?>" title="Previous image">&lt;</a> <a href="<?= $prevPageUrl ?>" title="Previous image">&lt;</a>
</div> </div>
<?php } ?> <?php } ?>
@ -75,9 +75,9 @@ img {
<?php if ($nextImageUrl !== '' and ! $firefox) { ?> <?php if ($nextImageUrl !== '' and ! $firefox) { ?>
window.onload = function() { // for browsers not supporting link rel=prefetch window.onload = function() { // for browsers not supporting link rel=prefetch
var im = new Image(); var im = new Image();
im.src = '<?php echo $nextImageUrl ?>'; im.src = '<?= $nextImageUrl ?>';
var req = new XMLHttpRequest(); var req = new XMLHttpRequest();
req.open('GET', '<?php echo $nextPageUrl ?>', false); req.open('GET', '<?= $nextPageUrl ?>', false);
req.send(null); req.send(null);
}; };
<?php } ?> <?php } ?>
@ -87,17 +87,17 @@ function keyup(e)
{ {
switch (e.keyCode) { switch (e.keyCode) {
case 37: // left case 37: // left
window.location = "<?php echo $prevPageUrl ?>"; window.location = "<?= $prevPageUrl ?>";
break; break;
case 39: // right case 39: // right
case 32: // space case 32: // space
window.location = "<?php echo $nextPageUrl ?>"; window.location = "<?= $nextPageUrl ?>";
break; break;
case 38: // up (down is 40) case 38: // up (down is 40)
window.location = "<?php echo $directoryUrl ?>"; window.location = "<?= $directoryUrl ?>";
break; break;
case 13: // enter case 13: // enter
window.location = "<?php echo $imageUrl ?>"; window.location = "<?= $imageUrl ?>";
break; break;
} }
} }

View file

@ -1,7 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title> <?php echo $realDir ?> </title> <title> <?= $realDir ?> </title>
<style type="text/css"> <style type="text/css">
body { body {
margin-top: 0; margin-top: 0;
@ -21,11 +21,11 @@ a {
vertical-align: middle; vertical-align: middle;
} }
.image, .image_nopreview { .image, .image_nopreview {
width: <?php echo THUMB_SIZE ?>px; width: <?= THUMB_SIZE ?>px;
text-align: center; text-align: center;
} }
.image, .foldername { .image, .foldername {
height: <?php echo THUMB_SIZE ?>px; height: <?= THUMB_SIZE ?>px;
} }
.foldername, .foldername_nopreview { .foldername, .foldername_nopreview {
padding-left: 1ex; padding-left: 1ex;
@ -42,13 +42,13 @@ a {
} }
</style> </style>
<?php foreach ($plugins as $p) if (is_file("plugins/$p/style.css")) { ?> <?php foreach ($plugins as $p) if (is_file("plugins/$p/style.css")) { ?>
<link rel="stylesheet" type="text/css" href="<?php echo $rootUrl."plugins/$p/style.css" ?>" /> <link rel="stylesheet" type="text/css" href="<?= $rootUrl."plugins/$p/style.css" ?>" />
<?php } ?> <?php } ?>
<?php plugins_include("head.php") ?> <?php plugins_include("head.php") ?>
</head> </head>
<body> <body>
<div id="parentfolder"><a href="<?php echo $parentLink ?>"> <div id="parentfolder"><a href="<?= $parentLink ?>">
<?php if ($parentLink !== '') { ?> <?php if ($parentLink !== '') { ?>
^ ^
<?php } ?> <?php } ?>
@ -61,10 +61,10 @@ a {
<div class="folder"> <div class="folder">
<?php if ($preview === "") { ?> <?php if ($preview === "") { ?>
<div class="square"><div class="image_nopreview"> - </div></div> <div class="square"><div class="image_nopreview"> - </div></div>
<div class="square"><div class="foldername_nopreview"> <a href="<?php echo $folder["link"] ?>"><?php echo $folder["name"] ?></a> </div></div> <div class="square"><div class="foldername_nopreview"> <a href="<?= $folder["link"] ?>"><?= $folder["name"] ?></a> </div></div>
<?php } else { ?> <?php } else { ?>
<div class="square"><div class="image"> <a href="<?php echo $folder["link"] ?>"><img src="<?php echo $rootUrl.$preview ?>" /></a> </div></div> <div class="square"><div class="image"> <a href="<?= $folder["link"] ?>"><img src="<?= $rootUrl.$preview ?>" /></a> </div></div>
<div class="square"><div class="foldername"> <a href="<?php echo $folder["link"] ?>"><?php echo $folder["name"] ?></a> </div></div> <div class="square"><div class="foldername"> <a href="<?= $folder["link"] ?>"><?= $folder["name"] ?></a> </div></div>
<?php if (isset($generating)) { ob_flush(); flush(); } ?> <?php if (isset($generating)) { ob_flush(); flush(); } ?>
<?php } ?> <?php } ?>
</div> </div>
@ -73,14 +73,14 @@ a {
<div id="images"> <div id="images">
<?php foreach ($imageFiles as $file) { ?> <?php foreach ($imageFiles as $file) { ?>
<div class="square"><div class="image"><a href="<?php echo $file["link"] ?>"><img src="<?php echo $rootUrl.getPreview($file["file"]) ?>" alt="<?php echo $file["name"] ?>" /></a></div></div> <div class="square"><div class="image"><a href="<?= $file["link"] ?>"><img src="<?= $rootUrl.getPreview($file["file"]) ?>" alt="<?= $file["name"] ?>" /></a></div></div>
<?php if (isset($generating)) { ob_flush(); flush(); } ?> <?php if (isset($generating)) { ob_flush(); flush(); } ?>
<?php } ?> <?php } ?>
</div> </div>
<div id="miscfiles"> <div id="miscfiles">
<?php foreach ($otherFiles as $file) { ?> <?php foreach ($otherFiles as $file) { ?>
<div class="miscfile"><a href="<?php echo $file["link"] ?>"><?php echo $file["name"] ?></a></div> <div class="miscfile"><a href="<?= $file["link"] ?>"><?= $file["name"] ?></a></div>
<?php } ?> <?php } ?>
</div> </div>