Zum Inhalt springen

Image Gallery schreiben - typo3.hachmeister.org

Erstellt am 28. September 2005 · 2 Antworten · letzte Antwort am 27. November 2005

Tags: PHP, Frage

d.​ochsenfeld ·

Hallo,
zurzeit beschäftige ich mich im Rahmen eines Vortrages mit dem Thema eine Extension (mit dem Kickstarter als Frontend Plugin) zu schreiben.

Dazu habe ich mir als Tutorial "Image Gallery" als Frontend Plugin von http://typo3.hachmeister.org/Eigene_Frontend_Plugins.137.0.html ausewählt.

Das Tutorial habe ichn nun durchgearbeitet, bekomme allerdings nach dem erstelen einer Seite nur noch den folgenden Fehlertext (egal auf welcher Typo Seite):

class tx_doimagegallery_pi1 extends tslib_pibase { var $prefixId = "tx_doimagegallery_pi1"; var $scriptRelPath = "pi1/class.tx_doimagegallery_pi1.php"; var $extKey = "do_image_gallery"; var $conf; var $templateCode; var $columns; /** * Image gallery Frontend Plugin */ function main($content,$conf) { $this->conf=$conf; $this->pi_setPiVarDefaults(); $this->pi_loadLL(); /** * Get the necessary database rows */ // 001: Database query $query = "SELECT title,image " . "FROM tx_doimagegallery_images " . "WHERE pid=" . $GLOBALS["TSFE"]->id . $this->cObj->enableFields("tx_doimagegallery_images"); // 002: Execute query $res = mysql(TYPO3_db, $query); /* * Generate output */ // 003: Get the template $this->templateCode = $this->cObj->fileResource($this->conf["templateFile"]); // 004: Get the parts out of the template $t = array(); $t["total"] = $this->cObj->getSubpart($this->templateCode, "###GALLERY_TABLE###"); $t["row"] = $this->cObj->getSubpart($t["total"], "###GALLERY_TABLE_ROW###"); $t["item"] = $this->cObj->getSubpart($t["row"], "###GALLERY_TABLE_ITEM###"); // 005: Some values $this->columns = $this->conf["columns"]; $row = mysql_fetch_array($res); $content_table = ""; // 006: For all database rows from the query while ($row) { // 007: Clear content_row $content_row = ""; // 008: Collects items for one row for ($i = 0; $i < $this->columns; $i++) { // 009: Initialise $markerArray $markerArray = array(); if ($row) { // 010: Create one item $img = $this->conf["image."]; $img["file"] = "uploads/tx_doimagegallery/" . $row["image"]; $markerArray["###GALLERY_IMAGE###"] = $this->cObj->IMAGE($img); } else { // 011: Create one dummy icon $markerArray["###GALLERY_IMAGE###"] = " "; } // 012: Add item to $content_row $content_row .= $this->cObj->substituteMarkerArrayCached($t["item"], $markerArray, array(), array()); // 013: Fetch new row from the query $row = mysql_fetch_array($res); } // 014: Create one row $subpartArray = array(); $subpartArray["###CONTENT_ROW###"] = $content_row; $content_table .= $this->cObj->substituteMarkerArrayCached($t["row"], array(), $subpartArray, array()); } // 015: Create the whole table $subpartArray = array(); $subpartArray["###CONTENT###"] = $content_table; $content .= $this->cObj->substituteMarkerArrayCached($t["total"], array(), $subpartArray, array()); // 016: Return the created table return $this->pi_wrapInBaseClass($content); } }

Falls jemand sich dem Problem annimmt, schon einmal vielen Dank im Voraus!

woida ·

Das ist keine Fehlermeldung; das ist dein PHP-Code, der nicht durch den Interpreter kommt.
Steht der Code in einer *.php Datei und hast du ihn zwischen den PHP-Tags?

<?php
....
?>
d.​ochsenfeld ·

Danke, nachdem ich mich besser in Typo3 eingearbeitet habe und alles noch einmal neu versucht habe bin ich auch deutlich weiter gekommen. An dieser Stelle schonmal vielen Dank für den Hinweis!

Die Extension habe ich jetzt laut Tutorial fertiggestellt.
Ich habe jetzt eine Seite mit dem Inhaltsmodul "Image Gallery" erstellt"
Auf dieser habe ich einen neuen Datensatz angelegt (also ein Bild ausgewählt).
Rufe ich jetzt diese Seite auf erscheint folgender Text auf der Seite:

NO entry in the $TCA-array for the table "tx_imagegallery_images". This means that the function enableFields() is called with an invalid table name as argument.

Ich hoffe mir kann jemand weiterhelfen!

Mit freundlichem Gruß