Zum Inhalt springen

tt_content / html parser

Erstellt am 23. Oktober 2015 · 1 Antwort · letzte Antwort am 23. Oktober 2015

Tags: Frage

3dxO ·

Hallo,

wie kann ich das ausgelesene bodytext so wie von Typo3 parsen lassen?
Folgendes funktioniert hier fast. Links und eventuell noch andere Elemente werden nicht erzeugt. Da steht dann z.B. <link 17> anstatt des korrekten html-<a>-tags.

Kann mir da jemand weiterhelfen? Ich bin schon auf t3lib_pasrehtml_proc gestoßen, aber das kann ich nicht finden.

require_once(PATH_t3lib.‘class.t3lib_parsehtml_proc.php’); gibt mir wohl einen Fatal Error, zumindest kommt steht im Fenster "Server Error"

btw, ich bin in einer Version 7.0.2 unterwegs...

LG, 3dxO

class typoExtensions {
	public $cObj;
	public function getElement($content,$conf) 
	{
		$pidList = array(1,54,55,56,57,58,61,63,64,65,67,1);
		$pid = $pidList[date('n')-1];
				
		$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery( 
			'bodytext',         // SELECT ...  
			'tt_content',     // FROM ...  
			'pid="'.$pid.'" AND colPos = '.$conf['row'].'',    // WHERE...  
			'',            // GROUP BY...  
			'sorting',    // ORDER BY...  
			''            // LIMIT ... 
		);  
	
		while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)){ 
			$output = $row['bodytext']; 
		}  
		return '<div id="'.$conf['divID'].'" class="'.$conf['divCLASS'].'">'.$output.'</div>';
	}
}
3dxO ·

Oh große Freude! 😃

es funktioniert:

<?php
class typoExtensions {
	public $cObj;
	public function getElement($content,$conf) 
	{
		$pidList = array(1,54,55,56,57,58,61,63,64,65,67,1);
		$pid = $pidList[date('n')-1];
				
		$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery( 
			'*',         // SELECT ...  
			'tt_content',     // FROM ...  
			'pid="'.$pid.'" AND colPos = '.$conf['row'].'',    // WHERE...  
			'',            // GROUP BY...  
			'sorting',    // ORDER BY...  
			''            // LIMIT ... 
		);  
		
		$output = $uid = '';
		while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)){ 
			$output = $row['bodytext']; 
			$uid = $row['uid'];
		} 
		
		$tt_content_conf = array('tables' => 'tt_content','source' => $uid,'dontCheckPid' => 1);
		$output  = $this->cObj->RECORDS($tt_content_conf); 
		
		return '<div id="'.$conf['divID'].'" class="'.$conf['divCLASS'].'">'.$output.'</div>';
	}
}
?>