[TYPO3] toi_rating problem

Piotr Burda pburda at narty.pl
Wed Mar 28 08:35:35 CEST 2007


Hi

I`ve tried to use toi_rating in my own extension, i`ve made all steps 
from readme file but it does not work, here is the code from my 
extension with some code from toi_rating:

...
  function singleView($content,$conf)        {
                 $this->conf=$conf;
                 $this->pi_setPiVarDefaults();
                 $this->pi_loadLL();

//toi_rating if START
                  if(t3lib_extMgm::isLoaded('toi_rating')) {
 
require_once(t3lib_extMgm::extPath('toi_rating').'api/class.tx_toirating_api.php');
                  }
                  $showRating = '';
                  if(t3lib_extMgm::isLoaded('toi_rating')) {
                                       $table_name     = 
'tx_pbnartyvideobig_base';               // define the table of the records
                                       $table_uid      = 
$this->internal['currentRow']['uid']; // define the uid of the record, 
which should be rated
                                      $temp_ratingAPI = 
t3lib_div::makeInstanceClassName('tx_toirating_api');
                                      $ratingAPI      = new 
$temp_ratingAPI($table_name,$table_uid);
                                      $showRating     = $ratingAPI->main();
                  }
// END if


                         // This sets the title of the page for use in 
indexed search results:
                 if ($this->internal['currentRow']['title']) 
$GLOBALS['TSFE']->indexedDocTitle=$this->internal['currentRow']['title'];

...


and here the code to show the results:

...
<tr>
                                         <td 
nowrap'.$this->pi_classParam('singleView-HCell').'>Ocena:</td>
                                         <td 
valign="top">'.$showRating.'</td>
                                 </tr>
...

in my template, the static template from toi_rating is also included

Waiting for help

Piotr


More information about the TYPO3-english mailing list