[Typo3] Cache / No cache

Hervé Inisan typo3 at self-access.com
Thu Jul 28 10:07:51 CEST 2005

> I'm no expert but I've done this.  I have a page with the 
> news plug-in.  The "no cache" option is not checked (i.e. I 
> want the page to cache).  I have a template for that page 
> only with the following line:
> plugin.tt_news = USER_INT
> I have the following in my main template:
> # include the php script
> includeLibs.displayFileLinks =
> fileadmin/scripts/user_itemMarkerArrayFunc.php
> # call user function
> plugin.tt_news.itemMarkerArrayFunc = user_Ratings
> I wrote a function user_Ratings($markerArray, $conf) that 
> increments the number of reads counter in the database.
> What took me a while to figure out is how to only increment 
> the read counter when somebody chooses to view the news item 
> in single view.  Note that this function is called in list 
> view for every news item too.
> $row = $conf['parentObj']->local_cObj->data; // get the data 
> array of the current news record if ('SINGLE' == 
> $conf['parentObj']->config['code'])
> $row['uid'] will have the unique news id.
> I hope that helps!

Thanks Matt for your answer.
Just another question before trying: what happens if the visitor reaches the
single view page directly?
(will the counter be incremented?)

-- Hervé Inisan.

More information about the TYPO3-english mailing list