Hi Stefan
Hmmmm... ich versuchs mal:
aber die Übergabe an die View schlägt fehl.
Wie weit "kommen" denn deine Daten? Ein gutes Tool für diesen Zweck ist "JDump", da kannst du vom Controller bis zum Model Variblen-Inhalte in einem Popup anzeigen lassen. JDump findest du unter extensions.joomla.org
Ich hab gesehen, dass du in deinem Model Prozeduralen Code drinn hast. Das Model ist normalerweise eine Klasse, die die JModel Klasse erbt und erweitert, und eigentlich solche Funktionen wie in deinem Include-Files enthalten sollte.
Apropos: Im Include-File "holst" du dir eine Referenz auf das Datenbank-Objekt, benutzt aber die nativen PHP-MySQL Funktionen.
Mach mal folgendes in dein Model-File:
Code:
defined('_JEXEC') or die('No direct Acces!');
jimport( 'joomla.application.component.model' );
class TabModelShowentry extends JModel {
//Namenskonvention für die Model-Klasse: [Komponentenname]Model[ViewName]
function __construct(){
parent::__construct();
}
function contact($id) {
if ((int)$id >0) {
$this->id = $id; // Assume the ID given is legit. No checks are performed.
}else {
return false;
}
// Referenz auf das Joomla Datenbank-Object instanzieren und Kontakt holen:
$db =& JFactory::getDBO();
$query = "SELECT * FROM #__deineKontaktTabelle AS contact WHERE contact.id=$this->id";
$db->setQuery($query);
$contact = $db->loadObject(); // da ist nun der Kontakt als Object drinn
if ($contact) {
// Fill in variables from database
$contact->firstname = stripslashes( $contact->firstname );
$this->lastname = stripslashes( $contact->lastname );
// plus die anderen Routinen....
////////////////////
// Create other variables
$contact->fullname = $contact->lastname . ", " . $contact->firstname;
return $contact;
else {
return false;
}
}
}
Und in der View in die Funktion display() machst du dann:
Code:
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport( 'joomla.application.component.view');
class TabViewShowentry extends JView {
function display($tpl = null) {
$model =& $this->getModel();
$contact = $model->contact(JRequest::getInt('id', 0);
if ($contact) {
$this->assignRef('contact', $contact);
}else {
$this->assignRef('check', '1');
}
parent::display($tpl);
}
}
(im default.php der View müsstest du nun was in $this->contact oder aber in $this->check haben)
Ich hoffe das ist einigermassen brauchbar und hat nicht allzuviele Schreipfähler drinn. Feedback erwünscht

(Tabellenname musst du noch in der DB-Query anpassen)
Vielleicht hilft dir das Tutorial dazu auf --ALTER LINK WURDE ENTFERNT-- falls du es nicht schon durch hast, mich hat's jedenfalls weitergebracht.
Cheers
Roger