aboutsummaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'index.php')
-rw-r--r--index.php46
1 files changed, 35 insertions, 11 deletions
diff --git a/index.php b/index.php
index 78ec739..7397bfc 100644
--- a/index.php
+++ b/index.php
@@ -2,12 +2,12 @@
/*
- Single File PHP Gallery 4.12.0 (SFPG)
+ Single File PHP Gallery 4.14.0 (SFPG)
See EULA in readme.txt for commercial use
See readme.txt for configuration
- Released: 2024-Sep-07
+ Released: 2024-Dec-17
https://sye.dk/sfpg/
by Kenny Svalgaard
@@ -28,6 +28,7 @@
option('DIR_DESC_FILE', '_desc.txt');
option('DIR_BANNER_FILE', '_banner.txt');
option('DIR_ROOT_BANNER_IN_SUBDIRS', TRUE);
+ option('DIR_NAME_AS_BANNER', FALSE);
option('DIR_DESC_IN_GALLERY', TRUE);
option('DIR_DESC_IN_INFO', TRUE);
option('DIR_SORT_REVERSE', FALSE);
@@ -133,6 +134,8 @@
option('SHOW_IMAGE_DAYS', FALSE);
option('DELETE_IMAGE_DAYS', FALSE);
option('DELETE_EMPTY_DIRS', FALSE);
+ option('RELOAD_IMAGE_MIN', 5000);
+ option('RELOAD_IMAGE_MAX', 10000);
option('PAYPAL_ENABLED', FALSE);
option('PAYPAL_ACCOUNT', '');
@@ -1591,6 +1594,12 @@
}
+ function reloadImage(imageID)
+ {
+ setTimeout(function(t) {t.src = t.src;}, Math.floor(Math.random() * (".(RELOAD_IMAGE_MAX - RELOAD_IMAGE_MIN + 1).") + ".RELOAD_IMAGE_MIN."), imageID);
+ };
+
+
function updateSize()
{
if (index)
@@ -1813,7 +1822,7 @@
{
if (isDef(dirInfo[id]['dirThumb']))
{
- info += '<img class=\"thumb\" alt=\"\" src=\"'+phpSelf+'?cmd=thumb&sfpg='+dirInfo[id]['dirThumb']+'\">';
+ info += '<img class=\"thumb\" onerror=\"reloadImage(this)\" alt=\"\" src=\"'+phpSelf+'?cmd=thumb&sfpg='+dirInfo[id]['dirThumb']+'\">';
}
else
{
@@ -1857,7 +1866,7 @@
}
else if (type == 'img')
{
- info += '<img class=\"thumb\" alt=\"\" src=\"'+phpSelf+'?cmd=thumb&sfpg='+imgInfo[id]['imageLink']+'\">';
+ info += '<img class=\"thumb\" onerror=\"reloadImage(this)\" alt=\"\" src=\"'+phpSelf+'?cmd=thumb&sfpg='+imgInfo[id]['imageLink']+'\">';
info += '</div>';
info += '<strong>".sts(TEXT_IMAGE_NAME)."</strong><br><div class=\"sfpg_info_text\">'+imgInfo[id]['imageName'] + '</div><br>';
";
@@ -2010,7 +2019,7 @@
{
if (isDef(fileInfo[id]['fileThumb']))
{
- info += '<img class=\"thumb\" alt=\"\" src=\"'+phpSelf+'?cmd=thumb&sfpg='+fileInfo[id]['fileThumb']+'\">';
+ info += '<img class=\"thumb\" onerror=\"reloadImage(this)\" alt=\"\" src=\"'+phpSelf+'?cmd=thumb&sfpg='+fileInfo[id]['fileThumb']+'\">';
}
else
{
@@ -2049,6 +2058,7 @@
}
else
{
+ fillInfo('dir', 0);
gebi('box_info').style.visibility='visible';
gebi('box_image').style.left='".INFO_BOX_WIDTH."px';
gebi('box_gallery').style.left='".INFO_BOX_WIDTH."px';
@@ -2663,7 +2673,10 @@
function mouseOver(that, type, nr)
{
- fillInfo(type, nr);
+ if (showInfo)
+ {
+ fillInfo(type, nr);
+ }
if (isSelected(type, nr))
{
that.className='innerbox_marked';
@@ -2685,7 +2698,10 @@
function mouseOut(that, type, nr)
{
- fillInfo('dir', 0);
+ if (showInfo)
+ {
+ fillInfo('dir', 0);
+ }
if (isSelected(type, nr))
{
that.className='innerbox_marked';
@@ -2758,7 +2774,7 @@
content += '<div class=\"thumbimgbox\">';
if (isDef(dirInfo[elementNumber]['dirThumb']))
{
- content += '<img class=\"thumb\" alt=\"\" src=\"'+phpSelf+'?cmd=thumb&sfpg='+dirInfo[elementNumber]['dirThumb']+'\">';
+ content += '<img class=\"thumb\" onerror=\"reloadImage(this)\" alt=\"\" src=\"'+phpSelf+'?cmd=thumb&sfpg='+dirInfo[elementNumber]['dirThumb']+'\">';
}
else
{
@@ -2776,7 +2792,7 @@
content += ' onmouseover=\"mouseOver(this, \'img\', '+elementNumber+')\" onmouseout=\"mouseOut(this, \'img\', '+elementNumber+')\"';
}
content += ' class=\"innerboximg\">';
- content += '<div class=\"thumbimgbox\"><img class=\"thumb\" alt=\"\" src=\"'+phpSelf+'?cmd=thumb&sfpg='+imgInfo[elementNumber]['imageLink']+'\"></div>';
+ content += '<div class=\"thumbimgbox\"><img onerror=\"reloadImage(this)\" class=\"thumb\" alt=\"\" src=\"'+phpSelf+'?cmd=thumb&sfpg='+imgInfo[elementNumber]['imageLink']+'\"></div>';
". (THUMB_CHARS_MAX ? "content += thumbDisplayName(imgInfo[elementNumber]['imageName']);" : "")."
content += '</div>';
}
@@ -2791,7 +2807,7 @@
content += '<div class=\"thumbimgbox\">';
if (isDef(fileInfo[elementNumber]['fileThumb']))
{
- content += '<img class=\"thumb\" alt=\"\" src=\"'+phpSelf+'?cmd=thumb&sfpg='+fileInfo[elementNumber]['fileThumb']+'\">';
+ content += '<img class=\"thumb\" onerror=\"reloadImage(this)\" alt=\"\" src=\"'+phpSelf+'?cmd=thumb&sfpg='+fileInfo[elementNumber]['fileThumb']+'\">';
}
else
{
@@ -2852,6 +2868,10 @@
}
}
gebi('navi').innerHTML = navLinks;
+ if (gebi('banner'))
+ {
+ gebi('banner').innerHTML = dirInfo[0]['dirName'];
+ }
addElement(0, 'desc');
for (i = 1; i < dirInfo.length; i++)
{
@@ -4133,7 +4153,7 @@
'</table>'.
'</div>'.
'<div id="box_image" class="box_image">'.
- '<img alt="" src="data:," id="full" class="full_image" onclick="closeImageView()" onmouseover="gebi(\'button_close\').className=\'sfpg_button_hover\'" onmouseout="gebi(\'button_close\').className=\'sfpg_button\'">';
+ '<img alt="" onerror=\"reloadImage(this)\" src="data:," id="full" class="full_image" onclick="closeImageView()" onmouseover="gebi(\'button_close\').className=\'sfpg_button_hover\'" onmouseout="gebi(\'button_close\').className=\'sfpg_button\'">';
if(SHOW_IMAGE_NAME_BELOW_FULL)
{
echo '<div id="box_image_full_name"></div>';
@@ -4164,6 +4184,10 @@
{
echo '<div class="banner">'.TEXT_BANNER.'</div>';
}
+ elseif (DIR_NAME_AS_BANNER)
+ {
+ echo '<div class="banner"><h1 id="banner"></h1></div>';
+ }
echo '</div>';
if (ADMIN===TRUE)
{