Bilder für Erklärtexte in eigene Ordner ausgelagert

This commit is contained in:
Matthias Grief
2024-12-08 17:07:18 +01:00
committed by Eric Blommel
parent ad09024f48
commit b81068b701
21 changed files with 4 additions and 4 deletions

View File

@@ -136,7 +136,7 @@ class TopicData
if (!isset($article)) {
$article = "Kein Erklärtext vorhanden";
}
$article = str_replace('$TOPICPATH', Config::getTopicDirectory($subjectId, $topicId), $article);
$article = str_replace('$TOPICPATH', Config::getTopicDirectory($subjectId, $topicId) . "images", $article);
$result->article = $article;
@@ -232,7 +232,7 @@ class TopicData
*/
public function addImage(string $name, string $tmp_name): bool
{
$imageDirectory = Config::getTopicDirectory($this->getSubjectId() , $this->getId()) . "";
$imageDirectory = Config::getTopicDirectory($this->getSubjectId() , $this->getId()) . "images/";
if(!is_dir($imageDirectory)) {
if(!mkdir($imageDirectory)) {
@@ -248,13 +248,13 @@ class TopicData
}
/**
* Löscht eine downloadbare Datei des Themas
* Löscht ein Bild des Themas
* @param string $name Dateiname
* @return bool true, wenn erfolgreich, sonst false
*/
public function deleteImage(string $name): bool
{
if(!unlink(Config::getTopicDirectory($this->getSubjectId() , $this->getId()) . "$name")) {
if(!unlink(Config::getTopicDirectory($this->getSubjectId() , $this->getId()) . "images/$name")) {
return false;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

View File

Before

Width:  |  Height:  |  Size: 130 KiB

After

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

View File

Before

Width:  |  Height:  |  Size: 297 KiB

After

Width:  |  Height:  |  Size: 297 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

View File

Before

Width:  |  Height:  |  Size: 297 KiB

After

Width:  |  Height:  |  Size: 297 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB