Hallo zusammen,
ich möchte gerne eine - bereits lauffähige Datenbank(abfrage) ins Typo3 einpfelgen. Hatte ich mir so einfach vorgestellt
Ich habe also mit dem Wizzard ein Plugin erstellt, dass auch im BE angezeigt wird und dort auch mit Daten befüllt werden kann.
Erstellt ist eine Tabelle mit drei Spalten für Name, PLZ, Ort.
Das Formular hat ein Suchfeld, in welches die PLZ eingegeben werden soll. Nach Klick auf Submit werden die Adressen im gesuchten PLZ ausgegeben.
Eigentlich ganz einfach - außer man ist der Laie schlechthin, was die Extensionprogrammierung angeht.
Ich denke ich brauche für dieses kleine Ding auch kein seperates Template.
Kann mir jemand sagen, wo und wie ich eine Query in das Ding einbaue und die Ausgabe unter das Formular liste?
Vielen Dank im Voraus,
Andrea
<?php
/***************************************************************
* Copyright notice
*
* (c) 2005 Andrea ()
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* Plugin 'plugin.beispiel' for the 'user_beispiel' extension.
*
* @author Andrea <>
*/
require_once(PATH_tslib.'class.tslib_pibase.php');
class user_bivmetal_pi1 extends tslib_pibase {
var $prefixId = 'user_beispiel_pi1'; // Same as class name
var $scriptRelPath = 'pi1/class.user_beispiel_pi1.php'; // Path to this script relative to the extension dir.
var $extKey = 'user_beispiel'; // The extension key.
var $pi_checkCHash = TRUE;
/**
* [Put your description here]
*/
function main($content,$conf) {
$this->conf=$conf;
$this->pi_setPiVarDefaults();
$this->pi_loadLL();
$content='
<strong>Sie suchen einen xxx in Ihrer Nähe?</strong><BR>
<p>Tragen Sie einfach die gewünschte Postleitzahl, oder auch nur die erste Zahl oder die
ersten beiden Zahlen ein und betätigen den Submit - Button. Schon erhalten Sie die gewünschte Information.</p>
<h3>This is a form:</h3>
<form action="'.$this->pi_getPageLink($GLOBALS['TSFE']->id).'" method="POST">
<input type="hidden" name="no_cache" value="1">
<input type="text" name="'.$this->prefixId.'[plz]" value="'.htmlspecialchars($this->piVars['$_POST["plz"]']).'">
<input type="submit" name="'.$this->prefixId.'[submit_button]" value="'.htmlspecialchars($this->pi_getLL('submit_button_label')).'">
</form>
<BR>
<p>You can click here to '.$this->pi_linkToPage('get to this page again',$GLOBALS['TSFE']->id).'</p>
';
return $this->pi_wrapInBaseClass($content);
}
}
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/user_beispiel/pi1/class.user_beispiel_pi1.php']) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/user_beispiel/pi1/class.user_beispiel_pi1.php']);
}
?>
:o :o :o :o :o