ja mehr ich mich mit dem Script auseinander setze, desto eher scheint mir dieser Code dafür verantwortlich zu sein:
if ($singlePid > 0)
$l2s = $this->pi_list_linkSingle($linkvar, $row[0], $cache=FALSE, $mergeArr=array(), $urlOnly=FALSE, $altPageId=$singlePid);
$userMarkers["###LINK2SHOW###"] = $l2s;
Zur Sicherheit hier das ganze Script class.tx_thmailformplus_pi2.php
<?php
/***************************************************************
* Copyright notice
*
* (c) 2007 Kurt Kunig <kurt.kunig@gmx.de>
* 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 'Mailformplus list' for the 'th_mailformplus' extension.
*
* @author Kurt Kunig <kurt.kunig@gmx.de>
* @package TYPO3
* @subpackage tx_thmailformplus
*/
class tx_thmailformplus_pi2 extends tslib_pibase {
var $prefixId = 'tx_thmailformplus_pi2'; // Same as class name
var $scriptRelPath = 'pi2/class.tx_thmailformplus_pi2.php'; // Path to this script relative to the extension dir.
var $extKey = 'th_mailformplus'; // The extension key.
/**
* 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
*/
// public Definitions of variables:
var $template;
var $template_ref;
var $res;
var $strListLink;
var $sourcePagePID;
var $TR_EVENODD = array('', '<tr class="tr-odd">', '<tr class="tr-even">');
function main($content,$conf) {
$this->conf=$conf;
$this->pi_setPiVarDefaults();
$this->pi_loadLL();
$this->pi_USER_INT_obj=1; // Configuring so caching is not expected. This value means that no cHash params are ever set. We do this, because it's a USER_INT object!
$this->pi_initPIflexForm();
$this->strListLink = trim($conf["linkVars"]);
$this->sourcePagePID = trim($conf["sourcePagePID"]);
$this->langFile = '';
if (isset($conf['langFile']) && $conf['langFile'] != '') {
$this->langFile = $conf['langFile'];
}
$mailformplus_id = $this->cObj->data['pages'];
# default: display the form from the page where the plugin is inserted
if (!$mailformplus_id) $mailformplus_id = $this->cObj->data['pid'];
# Initializing the query parameters:
$query = "SELECT * FROM tx_thmailformplus_main WHERE pid IN (".$mailformplus_id.") LIMIT 0,1";
$this->res = $GLOBALS['TYPO3_DB']->sql(TYPO3_db, $query);
if (mysql_error()) debug(array(mysql_error(),$query));
$this->internal["currentTable"] = "tx_thmailformplus_main";
$this->internal["currentRow"] = mysql_fetch_array($this->res);
$singlePid = intval($this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'singlepid', 'sDEFAULT'));
$showAs = intval($this->pi_getFFvalue($this->cObj->data['pi_flexform'], "contenttype", 'sDEFAULT'));
$this->template = $this->cObj->fileResource($conf["template"]);
parse_str($_SERVER['QUERY_STRING']);
if ($showAs == 0) {
$this->template = $this->cObj->getSubpart($this->template, "###MFP_LIST###");
$content .= $this->create_list($singlePid);
} else {
$this->template = $this->cObj->getSubpart($this->template, "###MFP_SINGLE###");
$content = $this->create_single($tx_thmailformplus_pi2['showUid']);
}
$langMarkers = $this->substituteLangMarkers($content);
$content = $this->cObj->substituteMarkerArray($content,$langMarkers);
return $this->pi_wrapInBaseClass($content);
}
/*function sanitizeValues($markerArray) {
$allowedTags = $this->conf['allowedTags'];
$sanitizedArray = array();
if (function_exists('t3lib_div::removeXSS')) {
foreach ($markerArray as $key => $value) {
$value = strip_tags($value,$allowedTags);
$sanitizedArray[$key] = t3lib_div::removeXSS($value);
}
} else {
require_once(t3lib_extMgm::extPath('th_mailformplus')."RemoveXSS.php");
foreach ($markerArray as $key => $value) {
$value = strip_tags($value,$allowedTags);
$sanitizedArray[$key] = RemoveXSS::RemoveXSS($value);
}
}
return $sanitizedArray;
}*/
/******************************************************************
* Creating the single view of uid document
*****************************************************************/
function create_single($uid2Show='') {
if (!$uid2Show) return;
$single = '';
$query = 'SELECT * FROM tx_thmailformplus_log WHERE uid='.strval($uid2Show);
$this->res = $GLOBALS['TYPO3_DB']->sql(TYPO3_db, $query);
if (mysql_error()) debug(array(mysql_error(),$query));
$this->template_ref = $this->cObj->getSubpart($this->template, "###MFPSINGLEVIEW###");
$single .= $this->subst_markers(-1);
$single = $this->cObj->substituteSubpart ($this->template, "###MFPSINGLEVIEW###", $single);
return $single;
}
/******************************************************************
* Creating the list of all (resp. $maxRows) mailformplus-entries
*****************************************************************/
function create_list($singlePid) {
$this->template_ref = $this->cObj->getSubpart($this->template, "###MFPLISTE###");
$maxRows = intval($this->pi_getFFvalue($this->cObj->data['pi_flexform'], "maxrows", 'sDEFAULT'));
if ($maxRows <= 0) $limits = '';
else $limits = ' LIMIT 0,' . strval($maxRows) . ';';
$where = '';
if (intval($this->sourcePagePID > 0)) $where = " WHERE pid = $this->sourcePagePID ";
$query = 'SELECT * FROM tx_thmailformplus_log' . $where . ' ORDER BY logdate DESC ' . $limits;
$this->res = $GLOBALS['TYPO3_DB']->sql(TYPO3_db, $query);
if (mysql_error()) debug(array(mysql_error(),$query));
$list = '';
$list .= $this->subst_markers($singlePid);
$list = $this->cObj->substituteSubpart ($this->template, "###MFPLISTE###", $list);
return $list;
}
/**************************************************************
* All existing and possible field markers are generated:
****************************************************************/
function subst_markers($singlePid) {
$s = '';
$marker = array();
$linkvar = $this->strListLink;
if ($linkvar == '') $linkvar = 'X';
$switcher = 1;
while ($row = mysql_fetch_row ($this->res)) {
$x = explode(chr(10), $row[2], 2);
$y = explode(';', $x[0]);
$z = str_replace (';','',$x[1]); // in $x[1] the message content is in
$z = str_replace ('\\','',$z);
$z = str_replace (chr(13),'<br />',$z); // replace CRLF with "<br />"
$z = explode('~', $z);
$i = 0;
foreach ($y as $value){
$mark = strtoupper('###VALUE_' . $value . '###');
if(strstr($this->template_ref,$mark)) {
$userMarkers[$mark] = $z[$i];
}
else {
$autoMarkers[$value] = $z[$i];
}
$i++;
}
$sendingtime = date("d.m.y H:i", $row[3]);
$userMarkers["###VALUE_DATE###"] = $sendingtime;
if ($singlePid > 0)
$l2s = $this->pi_list_linkSingle($linkvar, $row[0], $cache=FALSE, $mergeArr=array(), $urlOnly=FALSE, $altPageId=$singlePid);
$userMarkers["###LINK2SHOW###"] = $l2s;
$userMarkers["###GO_BACK###"] = '<a href="'.$_SERVER['HTTP_REFERER'].'">'.$this->pi_getLL('back', $alt='Hui', $hsc=FALSE).'</a>';
#$userMarkers = $this->sanitizeValues($userMarkers);
$s .= $this->cObj->substituteMarkerArrayCached ($this->template_ref, $userMarkers);
if ($this->cObj->getSubpart($s,'###FIELD_REPEAT###')) {
foreach($autoMarkers as $fieldname=>$value) {
$repeatCode = $this->cObj->getSubpart($s,'###FIELD_REPEAT###');
if (trim($GLOBALS['TSFE']->sL('LLL:'.$this->langFile.':'.$fieldname)) != '') {
$markerArray['###title###'] = trim($GLOBALS['TSFE']->sL('LLL:'.$this->langFile.':'.$fieldname));
$markerArray['###TITLE###'] = trim($GLOBALS['TSFE']->sL('LLL:'.$this->langFile.':'.$fieldname));
} else {
$markerArray['###title###'] = $fieldname;
$markerArray['###TITLE###'] = $fieldname;
}
$markerArray['###value###'] = $value;
$markerArray['###VALUE###'] = $value;
#$markerArray = $this->sanitizeValues($markerArray);
$subpart .= $this->cObj->substituteMarkerArray($repeatCode,$markerArray);
}
$s = $this->cObj->substituteSubpart ($s, '###FIELD_REPEAT###',$subpart);
}
}
return $s;
}
/**
* finds markers (###LLL:[markername]###) in given template Code
* @param string $templCode the template code in which the markers should be searched for
* @return array the found language markers with translation text
*/
function substituteLangMarkers($templCode) {
global $LANG;
$langMarkers = array();
if ($this->langFile != '') {
$aLLMarkerList = array();
preg_match_all('/###LLL:.+?###/Ssm', $templCode, $aLLMarkerList);
if (debug == 1) {
print "Found language markers: <br>";
print_r($aLLMarkerList);
}
foreach($aLLMarkerList[0] as $LLMarker){
$llKey = strtolower(substr($LLMarker,7,strlen($LLMarker)-10));
$langMarkers['###LLL:'.$llKey.'###'] = trim($GLOBALS['TSFE']->sL('LLL:'.$this->langFile.':'.$llKey));
}
}
return $langMarkers;
}
}
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/th_mailformplus/pi2/class.tx_thmailformplus_pi2.php']) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/th_mailformplus/pi2/class.tx_thmailformplus_pi2.php']);
}
?>
LG, Alex