# Inventur der Shopware-Grafiken

**URL:** https://forum.shopware.com/t/inventur-der-shopware-grafiken/1979
**Category:** Shopware 3.5
**Tags:** general
**Created:** [27. Februar 2011 um 12:10 UTC](https://forum.shopware.com/t/inventur-der-shopware-grafiken/1979 "2011-02-27T12:10:41Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![avenger](https://avatars.discourse-cdn.com/v4/letter/a/9de0a6/32.png) [@avenger](https://forum.shopware.com/u/avenger)
#### Post date: [27. Februar 2011 um 12:10 UTC](https://forum.shopware.com/t/inventur-der-shopware-grafiken/1979/1 "2011-02-27T12:10:41Z")

</div>

Um einen Überblick über die in Shopware verwendeten Grafiken zu erhalten, habe ich ein kleines Programm entwickelt, das diese Grafiken auflistet. Ist sicher allgemein ganz hilfreich um zu sehen, was man wo für eigene Designs ändern muss. Den folgenden Code als „graphics\_list.php“ in der Shop-Root speichern, und dann mit „http://www.mein\_shop.de/graphics\_list.php“ starten. Das Programm prüft zunächst, ob im Verzeichnis „templates/\_local/frontend/\_resources/images/“ Grafiken enthalten sind. Wenn ja, wird dieses Verzeichnis analysiert, sonst „templates/\_default/frontend/\_resources/images/“. HTH [code]\<?php /\*  
Copyright 2011: Avenger, [entwicklung@powertemplate.de](mailto:entwicklung@powertemplate.de)  
\*/  
$graphics\_dir0 = „templates/#/frontend/\_resources/images/“;  
$graphics\_dir = str\_replace(’#’,’\_local’,$graphics\_dir0);  
if (!is\_file($graphics\_dir.‚sprite\_blog.gif‘))  
{  
$graphics\_dir = str\_replace(’#’,’\_default’,$graphics\_dir0);  
}  
$graphics\_dir\_1=$graphics\_dir.’/’;  
$html\_header=’

**Unterverzeichnis „%s“** | ‚; $html\_entry=‘ | **%s** | %s | %s |  
‚; $html=$last\_dir=‘’; $files=my\_glob($graphics\_dir,’{\*.gif,\*.jpg,\*.png}’,-1,GLOB\_BRACE); foreach ($files as $file) { $file\_short=str\_replace($graphics\_dir\_1,’’,str\_replace(’\’,’/’,$file)); if (strpos($file\_short,’/’)!==false) { $this\_dir=dirname($file\_short); if ($last\_dir\<\>$this\_dir) { $last\_dir=$this\_dir; $html.=sprintf($html\_header,$this\_dir); } } $file\_info=getimagesize($file); $width=$file\_info[‚0‘]; $height=$file\_info[‚1‘]; $size=$width.’ x '.$height; $html.=sprintf($html\_entry, basename($file\_short), ’ ![]()‚, $size); } $html=‘  
.image img {  
max-width:400px;  
}

.header {  
background-color:red;  
color:white;  
font-weight:bold;  
}

| Vorhandene Grafiken im Verzeichnis „’.$graphics\_dir.’“ (’.sizeof($files).’ Stück) |  
| **Grafik-Name** | **Grafik-Bild** | **Grafik-Maße  
B x H (Pixel)** |  
‚.$html.‘

‚; echo $html; function my\_glob($path, $pattern = ‚\*‘, $depth = 0, $flags = 0) { $matches = array(); $folders = array(rtrim($path, DIRECTORY\_SEPARATOR)); while ($folder = array\_shift($folders)) { $matches = array\_merge($matches, glob($folder.DIRECTORY\_SEPARATOR.$pattern, $flags)); if($depth != 0) { $moreFolders = glob($folder.DIRECTORY\_SEPARATOR.‘\*’, GLOB\_ONLYDIR); $depth = ($depth \< -1) ? -1: $depth + count($moreFolders) - 2; $folders = array\_merge($folders, $moreFolders); } } return $matches; } ?\>[/code]

---

<div class="post-metadata">

### Author: ![ottscho](https://avatars.discourse-cdn.com/v4/letter/o/7ba0ec/32.png) [@ottscho](https://forum.shopware.com/u/ottscho)
#### Post date: [28. Februar 2011 um 09:11 UTC](https://forum.shopware.com/t/inventur-der-shopware-grafiken/1979/2 "2011-02-28T09:11:20Z")

</div>

Moin, schönes Sache 😉 Beim Bild-Pfad ist noch ein Fehler: [code]

![]() |[/code]

---

<div class="post-metadata">

### Author: ![avenger](https://avatars.discourse-cdn.com/v4/letter/a/9de0a6/32.png) [@avenger](https://forum.shopware.com/u/avenger)
#### Post date: [28. Februar 2011 um 10:10 UTC](https://forum.shopware.com/t/inventur-der-shopware-grafiken/1979/3 "2011-02-28T10:10:12Z")

</div>

[quote=„ottscho“]Moin, schönes Sache 😉 Beim Bild-Pfad ist noch ein Fehler: [code]

![]() |[/code][/quote] Komisch, ist bei mir OK…

---

<div class="post-metadata">

### Author: ![radox1](https://avatars.discourse-cdn.com/v4/letter/r/e19b73/32.png) [@radox1](https://forum.shopware.com/u/radox1)
#### Post date: [28. Februar 2011 um 12:26 UTC](https://forum.shopware.com/t/inventur-der-shopware-grafiken/1979/4 "2011-02-28T12:26:12Z")

</div>

Nettes Tool, Danke. :thumbup:

---

<div class="post-metadata">

### Author: ![Stefan\_Hamann](https://avatars.discourse-cdn.com/v4/letter/s/5e9695/32.png) [@Stefan\_Hamann](https://forum.shopware.com/u/Stefan_Hamann)
#### Post date: [4. März 2011 um 07:37 UTC](https://forum.shopware.com/t/inventur-der-shopware-grafiken/1979/5 "2011-03-04T07:37:55Z")

</div>

Passend zum Thema: [http://www.shopware.de/wiki/\_detail\_664.html](http://www.shopware.de/wiki/%5C_detail%5C_664.html)
