[TYPO3-ttnews] xml feed icon -- improvement (bug?)

Rico Moorman rico at buyways.nl
Thu Jan 19 16:35:33 CET 2006


Dear list,


While installing, testing and using your tt_news extension for typo3 I 
discovered something (maybe a little bug ... maybe intended behaviour) 
which caused a validation error (feed output didnt validate because 
width and height tags didnt have a value set).


I am running typo3 on a development machine here with typo3 installed 
not in the webserver root but in a subfolder of the websiteroot.

 From the machine itself its located below 
/home/rico/public_html/dvl/subfolder
 From within the network its accessible via 
http://myhostname/~rico/dvl/subfolder
(extended debuginfo is included below ...)

well while setting up an rss feed on the site I discovered that the 
image-width and height were empty (thats why it also failes upon validation)
furthermore the link to the image was incorrect

### SCHNIPP ###
<link>http://localhost/~rico/dvl/subfolder/</link>
<description>Het laatste nieuws</description>
<language>nl</language>
<image>
  <title>Antennebureau.nl: Laatste Nieuws</title>
  <url>http://localhost/fileadmin/tt_news_article.gif</url>
  <link>http://localhost/~rico/dvl/subfolder/</link>
  <width/>
  <height/>
  <description>Het laatste nieuws</description>
</image>
<generator>TYPO3 - get.content.right</generator>
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
### SCHNIPP ###

after I was going to the source of tt_news ... class.tx_ttnews.php ... I 
found the responsible lines at 2324-2327
2324        $markerArray['###IMG###'] = 
t3lib_div::getIndpEnv('TYPO3_REQUEST_HOST') . '/' . 
$this->conf['displayXML.']['xmlIcon'];
2325        $imgFile = t3lib_div::getIndpEnv('TYPO3_DOCUMENT_ROOT') . 
'/' . $this->conf['displayXML.']['xmlIcon'];
2326        $imgSize = is_file($imgFile)?getimagesize($imgFile):
2327        '';

first I set a new variable within the script $siteSubFolder = 
'dvl/subfolder';
then changing line 2325 .....MENT_ROOT') . '/' . $siteSubFolder . 
$this->con.....
with this fix the image width and height were shown correctly

after I applied that I still had to fix the imagelinkurl
so ... line 2324         $markerArray['###IMG###'] = 
t3lib_div::getIndpEnv('TYPO3_SITE_URL') . 
$this->conf['displayXML.']['xmlIcon'];

well that fixed everything for me an I got the following feed after that

### SCHNIPP ###
<link>http://localhost/~rico/dvl/subfolder/</link>
<description>Het laatste nieuws</description>
<language>nl</language>
<image>
  <title>mijnsite.nl: Laatste Nieuws</title>
  <url>
   http://localhost/~rico/dvl/subfolder/fileadmin/tt_news_article.gif
  </url>
  <link>http://localhost/~rico/dvl/subfolder/</link>
  <width>18</width>
  <height>16</height>
  <description>Het laatste nieuws</description>
</image>
<generator>TYPO3 - get.content.right</generator>
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
### SCHNIPP ###

I hope this can help the further improvement of the news extension and 
typo3 ... and ... while its a hotfix - quick and dirty - I hope you can 
make up whether its a bug and how to fix it in a new release on the 
extension repository

anyway ... keep up the great work!

best regards

Rico Moorman


### DEBUG SYSTEM INFORMATION - START ###
HTTP_HOST           : localhost
TYPO3_HOST_ONLY     : localhost
TYPO3_PORT          :
PATH_INFO           :
QUERY_STRING        : TYPO3_INSTALL[type]=phpinfo
REQUEST_URI         : 
/~rico/dvl/subfolder/typo3/install/index.php?TYPO3_INSTALL[type]=phpinfo
HTTP_REFERER        : 
http://localhost/~rico/dvl/subfolder/typo3/install/index.php?
TYPO3_REQUEST_HOST  : http://localhost
TYPO3_REQUEST_URL   : 
http://localhost/~rico/dvl/subfolder/typo3/install/index.php?TYPO3_INSTALL[type]=phpinfo
TYPO3_REQUEST_SCRIPT: 
http://localhost/~rico/dvl/subfolder/typo3/install/index.php
TYPO3_REQUEST_DIR   : http://localhost/~rico/dvl/subfolder/typo3/install/
TYPO3_SITE_URL      : http://localhost/~rico/dvl/subfolder/
TYPO3_SITE_SCRIPT   : typo3/install/index.php?TYPO3_INSTALL[type]=phpinfo
TYPO3_SSL           :
SCRIPT_NAME         : /~rico/dvl/subfolder/typo3/install/index.php
TYPO3_DOCUMENT_ROOT : /home/rico/public_html
SCRIPT_FILENAME     : 
/home/rico/public_html/dvl/subfolder/typo3/install/index.php
REMOTE_ADDR         : 127.0.0.1
REMOTE_HOST         :
HTTP_USER_AGENT     : Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.10) 
Gecko/20050925 Firefox/1.0.4 (Debian package 1.0.4-2sarge5)
HTTP_ACCEPT_LANGUAGE: en-us,en;q=0.5
CONST: PHP_OS       : Linux
CONST: TYPO3_OS     :
CONST: PATH_thisScri: 
/home/rico/public_html/dvl/subfolder/typo3/install/index.php
CONST: php_sapi_name: apache2handler
OTHER: TYPO3_VERSION: 3.8.1
OTHER: PHP_VERSION  : 4.4.0-0.dotdeb.0
imagecreatefromgif(): 1
imagecreatefrompng(): 1
imagecreatefromjpeg(: 1
imagegif()          : 1
imagepng()          : 1
imagejpeg()         : 1
imagettftext()      : 1
OTHER: IMAGE_TYPES  : 31
OTHER: memory_limit : 32M
SERVER: SERVER_PORT : 80
SERVER: SERVER_SOFTW: Apache/2.0.54 (Debian GNU/Linux) mod_python/3.1.3 
Python/2.3.5 PHP/4.4.0-0.dotdeb.0 mod_perl/1.999.21 Perl/v5.8.4
SERVER: GATEWAY_INTE: CGI/1.1
SERVER: SCRIPT_NAME : /~rico/dvl/subfolder/typo3/install/index.php
SERVER: PATH_TRANSLA: 
/home/rico/public_html/dvl/subfolder/typo3/install/index.php
T3CV_GFX: image_proc: 1
T3CV_GFX: gdlib     : 1
T3CV_GFX: gdlib_png : 0
T3CV_GFX: gdlib_2   : 0
T3CV_GFX: im        : 1
T3CV_GFX: im_path   : /usr/bin/
T3CV_GFX: im_path_lz: /usr/bin/
T3CV_GFX: im_version: im6
T3CV_GFX: im_negate_: 0
T3CV_GFX: im_imvMask: 1
T3CV_GFX: im_combine: composite
### DEBUG SYSTEM INFORMATION - END ###



More information about the TYPO3-project-tt-news mailing list