Skip to content
Permalink
Browse files

translated error replacement thumb pictures; updates #184

  • Loading branch information...
following5 committed Sep 1, 2015
1 parent 54b8d7a commit 92f1ff6b744c9cb7a71c28caecf30298d52a8fcc
Showing with 181 additions and 34 deletions.
  1. +1 −1 htdocs/lib2/search/search.gpx.inc.php
  2. BIN htdocs/resource2/ocstyle/images/thumb/de/thumb404_1.gif
  3. BIN htdocs/resource2/ocstyle/images/thumb/de/thumb404_2.gif
  4. BIN htdocs/resource2/ocstyle/images/thumb/{ → de}/thumbextern_1.gif
  5. BIN htdocs/resource2/ocstyle/images/thumb/{ → de}/thumbextern_2.gif
  6. BIN htdocs/resource2/ocstyle/images/thumb/{ → de}/thumbintern_1.gif
  7. BIN htdocs/resource2/ocstyle/images/thumb/de/thumbintern_2.gif
  8. BIN htdocs/resource2/ocstyle/images/thumb/{ → de}/thumbspoiler_1.gif
  9. BIN htdocs/resource2/ocstyle/images/thumb/{ → de}/thumbspoiler_2.gif
  10. BIN htdocs/resource2/ocstyle/images/thumb/de/thumbunknown_1.gif
  11. BIN htdocs/resource2/ocstyle/images/thumb/de/thumbunknown_2.gif
  12. BIN htdocs/resource2/ocstyle/images/thumb/en/thumb404_1.gif
  13. BIN htdocs/resource2/ocstyle/images/thumb/en/thumb404_2.gif
  14. BIN htdocs/resource2/ocstyle/images/thumb/en/thumbextern_1.gif
  15. BIN htdocs/resource2/ocstyle/images/thumb/en/thumbextern_2.gif
  16. BIN htdocs/resource2/ocstyle/images/thumb/en/thumbintern_1.gif
  17. BIN htdocs/resource2/ocstyle/images/thumb/en/thumbintern_2.gif
  18. BIN htdocs/resource2/ocstyle/images/thumb/en/thumbspoiler_1.gif
  19. BIN htdocs/resource2/ocstyle/images/thumb/en/thumbspoiler_2.gif
  20. BIN htdocs/resource2/ocstyle/images/thumb/en/thumbunknown_1.gif
  21. BIN htdocs/resource2/ocstyle/images/thumb/en/thumbunknown_2.gif
  22. BIN htdocs/resource2/ocstyle/images/thumb/fr/thumb404_1.gif
  23. BIN htdocs/resource2/ocstyle/images/thumb/fr/thumb404_2.gif
  24. BIN htdocs/resource2/ocstyle/images/thumb/fr/thumbextern_1.gif
  25. BIN htdocs/resource2/ocstyle/images/thumb/fr/thumbextern_2.gif
  26. BIN htdocs/resource2/ocstyle/images/thumb/fr/thumbintern_1.gif
  27. BIN htdocs/resource2/ocstyle/images/thumb/fr/thumbintern_2.gif
  28. BIN htdocs/resource2/ocstyle/images/thumb/fr/thumbspoiler_1.gif
  29. BIN htdocs/resource2/ocstyle/images/thumb/fr/thumbspoiler_2.gif
  30. BIN htdocs/resource2/ocstyle/images/thumb/fr/thumbunknown_1.gif
  31. BIN htdocs/resource2/ocstyle/images/thumb/fr/thumbunknown_2.gif
  32. +127 −0 htdocs/resource2/ocstyle/images/thumb/sample.svg
  33. BIN htdocs/resource2/ocstyle/images/thumb/thumb404_1.gif
  34. BIN htdocs/resource2/ocstyle/images/thumb/thumb404_2.gif
  35. BIN htdocs/resource2/ocstyle/images/thumb/thumbintern_2.gif
  36. BIN htdocs/resource2/ocstyle/images/thumb/thumbunknown_1.gif
  37. BIN htdocs/resource2/ocstyle/images/thumb/thumbunknown_2.gif
  38. +1 −1 htdocs/templates2/ocstyle/imagebrowser.tpl
  39. +1 −1 htdocs/templates2/ocstyle/res_logpicture.tpl
  40. +1 −1 htdocs/templates2/ocstyle/viewcache.tpl
  41. +1 −1 htdocs/templates2/ocstyle/viewcache_print.tpl
  42. +49 −29 htdocs/thumbs.php
@@ -484,7 +484,7 @@ function getPictures($cacheid, $server_address)
while ($r = sql_fetch_array($rs))
{
$retval .= '<div style="float:left; padding:8px"><a href="' . $r['url'] . '" target="_blank">' .
'<img src="' . $server_address . 'thumbs.php?uuid=' . $r["uuid"]. '" />' .
'<img src="' . $server_address . 'thumbs.php?type=2&uuid=' . $r["uuid"]. '" />' .
'</a><br />' . $r['title'];
if ($r['spoiler'])
$retval .= ' (' . _('click on spoiler to display') . ')';
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
@@ -0,0 +1,127 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->

<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="210mm"
height="297mm"
id="svg2"
version="1.1"
inkscape:version="0.48.2 r9819"
sodipodi:docname="Neues Dokument 1">
<defs
id="defs4" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.4142136"
inkscape:cx="158.54244"
inkscape:cy="662.96952"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1280"
inkscape:window-height="968"
inkscape:window-x="-4"
inkscape:window-y="-4"
inkscape:window-maximized="1" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Ebene 1"
inkscape:groupmode="layer"
id="layer1">
<text
xml:space="preserve"
style="font-size:15px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#7f7f7f;fill-opacity:1;stroke:none;font-family:Trebuchet MS;-inkscape-font-specification:Trebuchet MS Bold;text-anchor:middle;text-align:center"
x="163.6145"
y="345.86218"
id="text3773"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan3775"
x="118.75"
y="345.86218"
style="font-size:15px;text-anchor:middle;text-align:center">Unbekanntes</tspan><tspan
sodipodi:role="line"
x="118.75"
y="364.61218"
style="font-size:15px;text-anchor:middle;text-align:center"
id="tspan3777">Dateiformat</tspan></text>
<text
xml:space="preserve"
style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Trebuchet MS;-inkscape-font-specification:Trebuchet MS"
x="158"
y="455.36218"
id="text2985"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan2987"
x="158"
y="455.36218" /></text>
<text
xml:space="preserve"
style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Trebuchet MS;-inkscape-font-specification:Trebuchet MS"
x="176"
y="329.36218"
id="text2989"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan2991"
x="176"
y="329.36218" /></text>
<text
xml:space="preserve"
style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Trebuchet MS;-inkscape-font-specification:Trebuchet MS"
x="162.25"
y="319.36218"
id="text2993"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan2995"
x="162.25"
y="319.36218" /></text>
<text
xml:space="preserve"
style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Trebuchet MS;-inkscape-font-specification:Trebuchet MS"
x="150.5"
y="384.61218"
id="text2997"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan2999"
x="150.5"
y="384.61218" /></text>
<text
xml:space="preserve"
style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#4d4d4d;fill-opacity:1;stroke:none;font-family:Trebuchet MS;-inkscape-font-specification:Trebuchet MS"
x="157.75"
y="339.36218"
id="text3001"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan3003"
x="157.75"
y="339.36218" /></text>
</g>
</svg>
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
@@ -37,7 +37,7 @@
{if $cc==1}
<tr>
{/if}
<td valign="middle" align="center" width="{$thumbwidth+5}px"><a href="javascript:SelectFile('{$pictureItem.url|escape:'js'}', '{$opt.page.absolute_url}thumbs.php?showspoiler=1&uuid={$pictureItem.uuid|escape:'js'}');"><img border="0" src="thumbs.php?showspoiler=1&uuid={$pictureItem.uuid|escape}" title="{$pictureItem.title|escape}" alt="{$pictureItem.title|escape}" /></a></td>
<td valign="middle" align="center" width="{$thumbwidth+5}px"><a href="javascript:SelectFile('{$pictureItem.url|escape:'js'}', '{$opt.page.absolute_url}thumbs.php?type=2&showspoiler=1&uuid={$pictureItem.uuid|escape:'js'}');"><img border="0" src="thumbs.php?type=2&showspoiler=1&uuid={$pictureItem.uuid|escape}" title="{$pictureItem.title|escape}" alt="{$pictureItem.title|escape}" /></a></td>
{if $cc==2 || $smarty.foreach.pictures.last}
</tr>
{/if}
@@ -4,7 +4,7 @@
<td style="text-align:center; padding:0" align="center" valign="middle">
<div style="max-width:{$itemwidth}px; overflow:hidden">
<a id="pl{$picture.pic_uuid}" href="{$picture.pic_url}">
<img src="thumbs.php?uuid={$picture.pic_uuid}" class="img-{if @$nopicshadow}no{/if}shadow-loggallery" onclick="enlarge(this);" longdesc="{$picture.pic_url}" onload="document.getElementById('pl{$picture.pic_uuid}').removeAttribute('href'); this.alt='{$picture.title|replace:"'":"´"|replace:'"':'´´'}'" title="{$picture.title|replace:"'":"´"|replace:'"':'´´'}" /> {* ' in title would cause enlargit and IE errors, even if escaped *}
<img src="thumbs.php?type=1&uuid={$picture.pic_uuid}" class="img-{if @$nopicshadow}no{/if}shadow-loggallery" onclick="enlarge(this);" longdesc="{$picture.pic_url}" onload="document.getElementById('pl{$picture.pic_uuid}').removeAttribute('href'); this.alt='{$picture.title|replace:"'":"´"|replace:'"':'´´'}'" title="{$picture.title|replace:"'":"´"|replace:'"':'´´'}" /> {* ' in title would cause enlargit and IE errors, even if escaped *}
</a>
{if $logdate || $loguser}
<div style="line-height:1.2em; max-height:2.4em; margin-top:5px">
@@ -451,7 +451,7 @@ function showalllists()
<div class="viewcache-pictureblock">
<div class="img-shadow">
<!-- a href="{$pictureItem.url|escape}" target="_blank" -->
<img src="thumbs.php?uuid={$pictureItem.uuid|urlencode}" alt="{$pictureItem.title|escape}" title="{$pictureItem.title|escape}" longdesc="{$pictureItem.url|escape}" border="0" align="bottom" onclick="enlarge(this)" />
<img src="thumbs.php?type=2&uuid={$pictureItem.uuid|urlencode}" alt="{$pictureItem.title|escape}" title="{$pictureItem.title|escape}" longdesc="{$pictureItem.url|escape}" border="0" align="bottom" onclick="enlarge(this)" />
<!-- /a -->
</div>
<span class="title">{$pictureItem.title|escape}</span>
@@ -321,7 +321,7 @@
<tr>
<td class="header-small-print">
{foreach from=$pictures item=pictureItem}
<a href="{$pictureItem.url|escape}" target="_blank"><img src="thumbs.php?uuid={$pictureItem.uuid|urlencode}" alt="{$pictureItem.title|escape}" title="{$pictureItem.title|escape}" border="0" align="bottom" /></a>
<a href="{$pictureItem.url|escape}" target="_blank"><img src="thumbs.php?type=2&uuid={$pictureItem.uuid|urlencode}" alt="{$pictureItem.title|escape}" title="{$pictureItem.title|escape}" border="0" align="bottom" /></a>
{/foreach}
</td>
</tr>
@@ -7,24 +7,12 @@
require('./lib2/web.inc.php');
// define image paths
$imgpath = "resource2/".$opt['template']['style']."/images/thumb/";
$imgurl_404[1] = $imgpath.'thumb404_1.gif';
$imgurl_404[2] = $imgpath.'thumb404_2.gif';
$imgurl_intern[1] = $imgpath.'thumbintern_1.gif';
$imgurl_intern[2] = $imgpath.'thumbintern_2.gif';
$imgurl_extern[1] = $imgpath.'thumbextern_1.gif';
$imgurl_extern[2] = $imgpath.'thumbextern_2.gif';
$imgurl_spoiler[1] = $imgpath.'thumbspoiler_1.gif';
$imgurl_spoiler[2] = $imgpath.'thumbspoiler_2.gif';
$imgurl_format[1] = $imgpath.'thumbunknown_1.gif';
$imgurl_format[2] = $imgpath.'thumbunknown_2.gif';
$login->verify();
$uuid = isset($_REQUEST['uuid']) ? $_REQUEST['uuid'] : '';
$debug = isset($_REQUEST['debug']) ? $_REQUEST['debug']+0 : 0;
$showspoiler = isset($_REQUEST['showspoiler']) ? $_REQUEST['showspoiler']+0 : 0;
$default_object_type = isset($_REQUEST['type']) && ($_REQUEST['type'] == 1 || $_REQUEST['type'] == 2) ? $_REQUEST['type'] + 0 : 1;
if (($opt['debug'] & DEBUG_DEVELOPER) != DEBUG_DEVELOPER)
$debug = 0;
@@ -41,41 +29,49 @@
if ($debug == 1)
die('Debug: line ' . __LINE__);
else
$tpl->redirect($imgurl_extern[$r['object_type']]);
$tpl->redirect(thumbpath('extern', 1));
}
}
else if ($r['object_type'] == 2)
elseif ($r['object_type'] == 2)
{
if (sql_value("SELECT COUNT(*) FROM `caches` INNER JOIN `cache_status` ON `caches`.`status`=`cache_status`.`id` WHERE `caches`.`cache_id`='&1' AND (`cache_status`.`allow_user_view`=1 OR `caches`.`user_id`='&2' OR '&3')", 0, $r['object_id'], $login->userid, $login->hasAdminPriv(ADMIN_USER) ? 1 : 0) == 0)
{
if ($debug == 1)
die('Debug: line ' . __LINE__);
else
$tpl->redirect($imgurl_extern[$r['object_type']]);
$tpl->redirect(thumbpath('extern', 2));
}
}
else
{
if ($debug == 1)
die('Debug: line ' . __LINE__);
else
$tpl->redirect(thumbpath('intern', $default_object_type));
}
if ($r['local'] == 0)
if ($debug == 1)
die('Debug: line ' . __LINE__);
else
$tpl->redirect($imgurl_extern[$r['object_type']]);
$tpl->redirect(thumbpath('extern', $r['object_type']));
if (($r['spoiler'] == 1) && ($showspoiler != 1))
if ($debug == 1)
die('Debug: line ' . __LINE__);
else
$tpl->redirect($imgurl_spoiler[$r['object_type']]);
$tpl->redirect(thumbpath('spoiler', $r['object_type']));
$imgurl = $r['url'];
$urlparts = mb_split('/', $imgurl);
if (!file_exists($opt['logic']['pictures']['dir'] . '/' . $urlparts[count($urlparts) - 1]))
if ($debug == 1)
die('Debug: line ' . __LINE__);
else
$tpl->redirect($imgurl_intern[$r['object_type']]);
$tpl->redirect(thumbpath('intern', $r['object_type']));
// thumb neu erstellen?
// generate new thumb?
$bGenerate = false;
if (strtotime($r['thumb_last_generated']) < strtotime($r['last_modified']))
$bGenerate = true;
@@ -85,15 +81,13 @@
if ($bGenerate)
{
// Bild erstellen
if ($r['unknown_format'] == 1)
if ($debug == 1)
die('Debug: line ' . __LINE__);
else
$tpl->redirect($imgurl_format[$r['object_type']]);
$tpl->redirect(thumbpath('format', $r['object_type']));
// ok, mal kucken ob das Dateiformat unterstützt wird
// ok, let's see if the file format is supported
$filename = $urlparts[count($urlparts) - 1];
$filenameparts = mb_split('\\.', $filename);
$extension = mb_strtolower($filenameparts[count($filenameparts) - 1]);
@@ -105,7 +99,7 @@
if ($debug == 1)
die('Debug: line ' . __LINE__);
else
$tpl->redirect($imgurl_format[$r['object_type']]);
$tpl->redirect(thumbpath('format', $r['object_type']));
}
if ($extension == 'jpeg') $extension = 'jpg';
@@ -136,7 +130,7 @@
if ($debug == 1)
die('Debug: line ' . __LINE__);
else
$tpl->redirect($imgurl_format[$r['object_type']]);
$tpl->redirect(thumbpath('format', $r['object_type']));
}
$imheight = imagesy($im);
@@ -174,11 +168,11 @@
$thumbheight = $imheight;
}
// Thumb erstellen und speichern
// Create and save thumb
$thumbimage = imagecreatetruecolor($thumbwidth, $thumbheight);
imagecopyresampled($thumbimage, $im, 0, 0, 0, 0, $thumbwidth, $thumbheight, $imwidth, $imheight);
// verzeichnis erstellen
// Create directory
if (!file_exists($opt['logic']['pictures']['thumb_dir'] . '/' . mb_substr($filename, 0, 1)))
mkdir($opt['logic']['pictures']['thumb_dir'] . '/' . mb_substr($filename, 0, 1));
if (!file_exists($opt['logic']['pictures']['thumb_dir'] . '/' . mb_substr($filename, 0, 1) . '/' . mb_substr($filename, 1, 1)))
@@ -225,6 +219,32 @@
if ($debug == 1)
die('Debug: line ' . __LINE__);
else
$tpl->redirect($imgurl_404[$r['object_type']]);
$tpl->redirect(thumbpath('404', $default_object_type));
}
function thumbpath($name, $object_type)
{
global $opt, $default_object_type;
if (!in_array($name, array('404', 'intern', 'extern', 'spoiler', 'unknown'))
|| ($object_type != 1 && $object_type != 2))
{
if ($debug == 1)
die('Debug: line ' . __LINE__);
else
{
$name = 'intern';
$object_type = $default_object_type;
}
}
$imgdir = 'resource2/'.$opt['template']['style'].'/images/thumb/';
$filename = 'thumb'.$name.'_'.$object_type.'.gif';
$thumbpath = $imgdir . strtolower($opt['template']['locale']) . '/'. $filename;
if (!file_exists($thumbpath))
$thumbpath = $imgdir.'en/'.$filename;
return $thumbpath;
}
?>

0 comments on commit 92f1ff6

Please sign in to comment.
You can’t perform that action at this time.