conf=$conf; $this->pi_setPiVarDefaults(); $this->pi_loadLL(); $this->pi_USER_INT_obj=1; $content = $this->cObj->fileResource("EXT:".$this->extKey."/pi1/template.html"); $content = $this->cObj->getSubpart($content, '###TEMPLATE_GUESTBOOK###'); $messaggio = t3lib_div::_POST($this->prefixId); if (isset($messaggio["submit"])) { $content = "Il tuo messaggio è stato registrato, grazie.
".$content; $this->salva($messaggio); } $markerArray["###GUESTBOOK_ACTION###"] = "index.php?id=".$GLOBALS['TSFE']->id; $markerArray["###GUESTBOOK_PID###"] = $this->conf["pid"]; $markerArray["###GUESTBOOK_TSTAMP###"] = time(); $markerArray["###LABEL_NOME###"] = $this->pi_getLL("nome"); $markerArray["###LABEL_MESSAGGIO###"] = $this->pi_getLL("messaggio"); $markerArray["###LABEL_AUTORE###"] = $this->pi_getLL("autore"); $markerArray["###LABEL_SUBMIT###"] = $this->pi_getLL("submit"); $content = $this->cObj->substituteMarkerArray($content, $markerArray); $content = $this->listaMessaggi($content); return $this->pi_wrapInBaseClass($content); } function salva($messaggio) { unset($messaggio["submit"]); $GLOBALS['TYPO3_DB']->exec_INSERTquery('user_guestbook_messaggi', $messaggio); } function listaMessaggi($content) { $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('nome, messaggio', 'user_guestbook_messaggi', 'pid="'.$this->conf["pid"].'" '.$this->cObj->enableFields('user_guestbook_messaggi'), '', 'crdate DESC'); $lista = ""; if ($GLOBALS['TYPO3_DB']->sql_num_rows($res)>0) { $rowTemplate = $this->cObj->getSubpart($content, '###TEMPLATE_MESSAGGIO###'); while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { $markerArray["###GUESTBOOK_NOME###"] = $row["nome"]; $markerArray["###GUESTBOOK_MESSAGGIO###"] = $row["messaggio"]; $lista .= $this->cObj->substituteMarkerArray($rowTemplate, $markerArray); } } return $this->cObj->substituteSubpart($content, '###TEMPLATE_MESSAGGIO###', $lista, 0,0); } } if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/user_guestbook/pi1/class.user_guestbook_pi1.php']) { include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/user_guestbook/pi1/class.user_guestbook_pi1.php']); } ?>