Juhuuu!! Ich Habe Es!!! Viiiiiiiiiielen Dank!!!
Falls es mal jemand braucht, hier der gesamt code:
PHP-Code:
<?php
/***************************************************************
* Copyright notice
*
* (c) 2008 matin <office@matin.at>
* 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!
***************************************************************/
require_once(PATH_tslib.'class.tslib_pibase.php');
/**
* Plugin 'TP Plugin' for the 'tp_test' extension.
*
* @author matin <office@matin.at>
* @package TYPO3
* @subpackage tx_tptest
*/
class tx_tptest_pi1 extends tslib_pibase {
var $prefixId = 'tx_tptest_pi1'; // Same as class name
var $scriptRelPath = 'pi1/class.tx_tptest_pi1.php'; // Path to this script relative to the extension dir.
var $extKey = 'tp_test'; // The extension key.
var $pi_checkCHash = true;
var $template;
var $id;
/**
* The main method of the PlugIn
*
* @param string $content: The PlugIn content
* @param array $conf: The PlugIn configuration
* @return The content that is displayed on the website
*/
function main($content,$conf) {
$this->conf=$conf;
$this->pi_setPiVarDefaults();
$this->pi_loadLL();
#ein paar Vorbelegungen
$this->id=$GLOBALS['TSFE']->id;
$this->template=$this->cObj->fileResource('EXT:tp_test/template.html');
#welche Ansicht?
if($this->piVars['item']) {
$content = $this->detailView();
} else {
$content = $this->listView();
}
return $this->pi_wrapInBaseClass($content);
}
function listView() {
#unser Subpart
$subpart=$this->cObj->getSubpart($this->template,'###LISTVIEW###');
#eine einzelne Reihe
$singlerow=$this->cObj->getSubpart($subpart,'###ROW###');
#Datensätze holen
$res=$GLOBALS['TYPO3_DB']->exec_SELECTquery(
'*', #select
'tx_tptest', #from
'hidden=0 and deleted=0 and pid='.$this->id, #where
$groupBy='',
$orderBy='',
$limit=$this->piVars['pointer']*3 . ',3');
if($res) {
$liste='';
# while($row=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
while( $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$markerArray['###LINK###']=$this->pi_linkTP($row['title'],array($this->prefixId.'[item]'=> $row['uid']), $cache=1);
$markerArray['###LINKTEXT###']=$this->pi_linkTP($this->pi_getLL('weiterlesen'),array($this->prefixId.'[item]'=> $row['uid']), $cache=1);
$markerArray['###TEXT###']=$this->pi_RTEcssText($row['text']);
$config = array();
$config['file'] = 'uploads/tx_tptest/'.$row['image'];
$config['file.']['maxW'] = '140';
$config['altText'] = $row['title'];
$config['titleText'] = $row['title'];
$img = $this->cObj->IMAGE($config);
$markerArray['###IMAGE###']=$img;
//Image als Link zu Detailseite:
$config1 = array();
$config1['file'] = 'uploads/tx_tptest/'.$row['image'];
$config1['file.']['maxW'] = '40';
$img1 = $this->cObj->IMAGE($config1);
$markerArray['###LINKIMAGE###']=$this->pi_linkTP($img1,array($this->prefixId.'[item]'=> $row['uid']), $cache=1);
//weitere Tags im Link hinzufügen
$link = $this->pi_linkTP(
$row['title'],
$overrulePIvars=array($this->prefixId.'[item]'=> $row['uid']), $cache=1,
$clearAnyway=0,
$altPageId=0
);
$params = array(
'class' => "classxy",
'title' => $row['title'],
'target' => "_blank",
'ref' => 'nofollow'
);
$markerArray['###PDF###'] = $this->cObj->addParams($link,$params);
$liste .= $this->cObj->substituteMarkerArrayCached($singlerow,$markerArray);
}
$subpartArray['###ROW###']=$liste;
#Pagebrowser
$res=$GLOBALS['TYPO3_DB']->exec_SELECTquery(
'count(*)', #select
'tx_tptest', #from
'hidden=0 and deleted=0 and pid='.$this->id);
$row = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
$count = $row[0];
$this->internal['res_count'] = $count;
$this->internal['results_at_a_time'] = 3;
$this->internal['maxPages'] = 2;
$markerArray['###BROWSERESULTS###']=$this->pi_list_browseresults();
} else {
return $this->pi_getLL('nodata');
}
return $this->cObj->substituteMarkerArrayCached($subpart,$markerArray,$subpartArray,array());
}