00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00066 function user_reverseString($content,$conf) {
00067 $content = strrev($content);
00068 if ($conf['uppercase']) {
00069 $content=strtoupper($content);
00070 }
00071 return $content;
00072 }
00073
00092 function user_printTime($content,$conf) {
00093 return '<font color="red">Dynamic time: '.date('H:i:s').'</font><br />';
00094 }
00095
00096
00097
00102 class user_various {
00103 var $cObj;
00104
00113 function reverseString($content,$conf) {
00114 $content = strrev($content);
00115 if ($conf['uppercase']) {
00116 $content=$this->cObj->caseshift($content,'upper');
00117 }
00118 if ($conf['typolink']) {
00119 $content=$this->cObj->getTypoLink($content,$conf['typolink']);
00120 }
00121 return $content;
00122 }
00123
00143 function listContentRecordsOnPage($content,$conf) {
00144 $query = $GLOBALS['TYPO3_DB']->SELECTquery(
00145 'header',
00146 'tt_content',
00147 'pid='.intval($GLOBALS['TSFE']->id).$this->cObj->enableFields('tt_content'),
00148 '',
00149 'sorting'.($conf['reverseOrder'] ? ' DESC' : '')
00150 );
00151 $output = 'This is the query: <strong>'.$query.'</strong><br /><br />';
00152 return $output.$this->selectThem($query);
00153 }
00154
00162 function selectThem($query) {
00163 $res = $GLOBALS['TYPO3_DB']->sql(TYPO3_db,$query);
00164 $output=array();
00165 while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
00166 $output[]=$row['header'];
00167 }
00168 return implode($output,'<br />');
00169 }
00170 }
00171
00172 ?>