Mercurial > hg > fapweb
changeset 911:f007b3081872
Adjust preview showing.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 27 Nov 2014 10:53:30 +0200 |
parents | 8abd4a908098 |
children | 514d460c60a9 |
files | msite.inc.php |
diffstat | 1 files changed, 16 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/msite.inc.php Thu Nov 27 10:27:08 2014 +0200 +++ b/msite.inc.php Thu Nov 27 10:53:30 2014 +0200 @@ -1001,18 +1001,25 @@ switch ($pdata["type"]) { case EFILE_IMAGE: - if ($pdata["valid"] && $pdata["exists"] >= 2) + if ($pdata["exists"] >= 2) { - echo - "<a href=\"".ihentities($pdata["files"]["image"]["url"]). - "\" onClick=\"return jsShowPreviewImage('".ihentities($pdata["files"]["image"]["url"])."');\">". - "<img class=\"imagePreview\" src=\"".ihentities($pdata["files"]["thumb"]["url"]). - "\" alt=\"Preview\" /></a>"; + if ($pdata["valid"]) + { + echo + "<a href=\"".ihentities($pdata["files"]["image"]["url"]). + "\" onClick=\"return jsShowPreviewImage('".ihentities($pdata["files"]["image"]["url"])."');\">". + "<img class=\"imagePreview\" src=\"".ihentities($pdata["files"]["thumb"]["url"]). + "\" alt=\"Preview\" /></a>"; + } + else + { + echo + "<img class=\"imagePreview\" src=\"".stGetSetting("previewNoImage")."\" alt=\"Preview\" />"; + } } else { - echo - "<img class=\"imagePreview\" src=\"".stGetSetting("previewNoImage")."\" alt=\"Preview\" />"; + echo "<div class=\"noPreview\">No preview</div>"; } break; @@ -1028,7 +1035,7 @@ } else { - // XXX TODO? + echo "<div class=\"noPreview\">No preview</div>"; } break; }