Also Mädels! 😉
Nachdem mir jetzt keiner von Euch geholfen hat, habe ich mich an Stanislas Rolland den Autor der extension gewand. Dieser sagte dass evtl. eine Inkompatibilität zwischen dem sr_guestbook und der neuen ve_guestbook version vorliegt.
Also mal die sr_guestbook extension ausgeschaltet und tada.... :o
Das Captcha wird angezeigt. 🙂
Toll aber was ist mit meinem rtehtmlarea? Is weg! Shit.
Also nochmals mit Stanislas Rolland gemailt und ihm dies mitgeteilt. Allerdings hat er sich nicht für meine Bedürfnisse schnell genug gemeldet
(mmmhhhh wie war das mit dem Zeitunterschied zwischen Kanada und Deutschland :o )
OK auf jeden fall habe ich dann die Eigeninitiative ergriffen und folgende Datei /typo3conf/ext/sr_guestbook/pi1/class.ux_tx_veguestbook_pi1.php
editiert und diese schaut wie folgt aus (Änderungen mit ----> Pfeilen)
<?php
/***************************************************************
* Copyright notice
*
* (c) 2004 Udo von Eynern (udo@voneynern.de)
* (c) 2005 Stanislas Rolland (stanislas.rolland@fructifor.com)
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
require_once(t3lib_extMgm::extPath('ve_guestbook').'pi1/class.tx_veguestbook_pi1.php');
require_once(t3lib_extMgm::extPath('rtehtmlarea').'pi2/class.tx_rtehtmlarea_pi2.php');
/**
* Plugin 'guestbook' for the 've_guestbook' extension
* Extended by Stanislas Rolland for frontend htmlArea RTE on entry field
*
* @author Udo von Eynern <udo@voneynern.de>
* @coauthor Stanislas Rolland <stanislas.rolland@fructifor.com>
* @package TYPO3
* @subpackage ve_guestbook
*/
class ux_tx_veguestbook_pi1 extends tx_veguestbook_pi1 {
/**
* Start adding fields for the RTE API
*/
var $RTEObj;
var $strEntryField;
var $docLarge = 0;
var $RTEcounter = 0;
var $formName;
var $additionalJS_initial = ''; // Initial JavaScript to be printed before the form (should be in head, but cannot due to IE6 timing bug)
var $additionalJS_pre = array(); // Additional JavaScript to be printed before the form
var $additionalJS_post = array(); // Additional JavaScript to be printed after the form
var $additionalJS_submit = array(); // Additional JavaScript to be executed on submit
var $PA = array(
'itemFormElName' => '',
'itemFormElValue' => '',
);
var $specConf = array();
var $thisConfig = array();
var $RTEtypeVal = 'text';
var $thePidValue;
/**
* End adding fields for the RTE API
*/
/**
* Fills in the markerArray with data for a guestbook entry
*
* @param array $row: result row for a news item
* @return array $markerArray: filled marker array
*/
function getItemMarkerArray($row) {
$localConf = $this->conf['entryDisplay.'];
$this->local_cObj->start($row,'tx_veguestbook_entries');
$markerArray['###GUESTBOOK_UID###'] = $row['uid'];
$markerArray['###GUESTBOOK_FIRSTNAME###'] = $this->cutDown($row['firstname']);
$markerArray['###GUESTBOOK_SURNAME###'] = $this->cutDown($row['surname']);
if (!empty($row['place'])) {
$markerArray['###GUESTBOOK_FROM###'] = $this->pi_getLL('list_from_place');
$markerArray['###GUESTBOOK_PLACE###'] = $this->cutDown($row['place']);
}
else {
$markerArray['###GUESTBOOK_FROM###'] = '';
$markerArray['###GUESTBOOK_PLACE###'] = '';
}
$substituteArray = array('firstname', 'surname', 'email', 'homepage', 'place', 'entry', 'entrycomment', 'submit');
foreach ($substituteArray AS $marker) {
$markerArray['###FORM_'.strtoupper($marker).'###'] = $this->pi_getLL('form_'.$marker);
}
if (!empty($row['email'])) {
$markerArray["###GUESTBOOK_EMAIL_URL###"] = htmlspecialchars($this->get_url('', $row['email']));
if (!empty($this->config['email_subst'])) {
$markerArray["###GUESTBOOK_EMAIL###"] = str_replace('@', $this->config['email_subst'], trim($row['email']));
}
else {
$markerArray["###GUESTBOOK_EMAIL###"] = trim($row['email']);
}
}
if (!empty($row['homepage']) && $row['homepage'] != 'http://') {
$markerArray["###GUESTBOOK_HOMEPAGE###"] = htmlspecialchars($this->get_url('', $row['homepage']));
}
$markerArray['###GUESTBOOK_DATE###'] = $this->local_cObj->stdWrap($row['crdate'], $this->conf['datetime_stdWrap.']);
$markerArray['###GUESTBOOK_ONLYTIME###'] = $this->local_cObj->stdWrap($row['crdate'], $this->conf['date_stdWrap.']);
$markerArray['###GUESTBOOK_ONLYDATE###'] = $this->local_cObj->stdWrap($row['crdate'], $this->conf['time_stdWrap.']);
if(!$this->RTEObj) $this->RTEObj = t3lib_div::makeInstance('tx_rtehtmlarea_pi2');
if(!$this->RTEObj->isAvailable()) {
$row['entry'] = $this->cutDown(stripslashes($row['entry']));
$row['entrycomment'] = stripslashes($row['entrycomment']);
}
if ($this->code == 'TEASER') {
if($this->RTEObj->isAvailable()) {
$words = split(' ', $this->formatStr($this->local_cObj->stdWrap($row['entry'],$lConf['content_stdWrap.'])));
} else {
$words = split(' ', $row['entry']);
}
if (is_array($words) && count($words)>0 && strlen($row['entry'])>$this->config['teasercut']) {
foreach ($words AS $word) {
if (strlen($teaser) <= $this->config['teasercut']) {
$teaser .= $word.' ';
}
}
$markerArray['###GUESTBOOK_ENTRY###'] = $teaser.'[...]';
} else {
if($this->RTEObj->isAvailable()) {
$markerArray['###GUESTBOOK_ENTRY###'] = $this->formatStr($this->local_cObj->stdWrap($row['entry'],$lConf['content_stdWrap.']));
} else {
$markerArray['###GUESTBOOK_ENTRY###'] = $row['entry'];
}
}
} else {
if($this->RTEObj->isAvailable()) {
$markerArray['###GUESTBOOK_ENTRY###'] = $this->formatStr($this->local_cObj->stdWrap($row['entry'],$lConf['content_stdWrap.']));
} else {
$markerArray['###GUESTBOOK_ENTRY###'] = nl2br($row['entry']);
}
}
$markerArray['###GUESTBOOK_ENTRY###'] = $this->substituteEmoticons($markerArray['###GUESTBOOK_ENTRY###']);
$markerArray['###GUESTBOOK_ENTRYCOMMENT###'] = $this->substituteEmoticons($this->formatStr($this->local_cObj->stdWrap($row['entrycomment'],$lConf['content_stdWrap.'])));
// Adds hook for processing of extra item markers
if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ve_guestbook']['extraItemMarkerHook'])) {
foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ve_guestbook']['extraItemMarkerHook'] as $_classRef) {
$_procObj = & t3lib_div::getUserObj($_classRef);
$markerArray = $_procObj->extraItemMarkerProcessor($markerArray, $row, $this->config, $this);
}
}
return $markerArray;
}
/**
* Generating the form for new guestbook entries
*
* @return string $content : the form (HTML)
*/
function displayForm() {
if (is_array($this->LOCAL_LANG) && count($this->LOCAL_LANG)>0)
{
$form = $this->cObj->getSubpart($this->templateCode, '###TEMPLATE_FORM###');
$substituteArray = array('firstname', 'surname', 'email', 'homepage', 'place', 'entry', 'submit', ----Änderung --->'captcha_response');
foreach ($substituteArray AS $marker) {
$markerArray['###FORM_'.strtoupper($marker).'###'] = $this->pi_getLL('form_'.$marker);
}
$markerArray['###PID###'] = $GLOBALS["TSFE"]->id;
$url = $this->getUrl($GLOBALS["TSFE"]->id);
$markerArray['###ACTION_URL###'] = $url;
//<Stanislas Rolland: Use _POST instead of GPvar>
//$this->postvars = t3lib_div::GPVar('tx_veguestbook_pi1');
$this->postvars = t3lib_div::_POST('tx_veguestbook_pi1');
//</Stanislas Rolland: Use _POST instead of GPvar>
/**
* Start setting the RTE markers
*/
if(!$this->RTEObj) $this->RTEObj = t3lib_div::makeInstance('tx_rtehtmlarea_pi2');
if($this->RTEObj->isAvailable()) {
$this->RTEcounter++;
$this->formName = 'guestbook-form';
$this->strEntryField = 'entry';
$this->PA['itemFormElName'] = 'tx_veguestbook_pi1[entry]';
$this->PA['itemFormElValue'] = $this->postvars[$this->strEntryField];
$this->thePidValue = $GLOBALS['TSFE']->id;
$RTEItem = $this->RTEObj->drawRTE($this,$this->strEntryTable,$this->strEntryField,$row=array(), $this->PA, $this->specConf, $this->thisConfig, $this->RTEtypeVal, '', $this->thePidValue);
$markerArray['###ADDITIONALJS_PRE###'] = $this->additionalJS_initial.'
<script type="text/javascript">'. implode(chr(10), $this->additionalJS_pre).'
</script>';
$markerArray['###ADDITIONALJS_POST###'] = '
<script type="text/javascript">'. implode(chr(10), $this->additionalJS_post).'
</script>';
$markerArray['###ADDITIONALJS_SUBMIT###'] = implode(';', $this->additionalJS_submit);
$markerArray['###FORM_RTE_ENTRY###'] = $RTEItem;
}
/**
* End setting the RTE markers
*/
if ($this->postvars['submitted'] == 1) {
if (isset($this->postvars['homepage'])) {
if (!strstr($this->postvars['homepage'], 'http://') && !empty($this->postvars['homepage'])) {
$this->postvars['homepage'] = 'http://'.$this->postvars['homepage'];
}
}
foreach($this->postvars as $k => $v) {
$markerArray['###VALUE_'.strtoupper($k).'###'] = stripslashes($v);
}
$error = $this->checkForm();
if (!empty($error)) {
$markerArray['###FORM_ERROR###'] = $this->pi_getLL('form_error');
$markerArray['###FORM_ERROR_FIELDS###'] = $error;
}
else {
$db_fields = array('firstname', 'surname', 'email', 'homepage', 'place', 'entry');
$saveData['uid'] = '';
$saveData['pid'] = $this->config['pid_list'];
$saveData['tstamp'] = time();
$saveData['crdate'] = time();
$saveData['deleted'] = '0';
$saveData['sys_language_uid'] = $this->sys_language_uid;
$saveData['remote_addr'] = $_SERVER['REMOTE_ADDR'];
if ($this->for_tt_news){
$saveData['uid_tt_news']=$this->tt_news['tx_ttnews[tt_news]'];
}
if ($this->config['manual_backend_release'] == 1) {
$saveData['hidden'] = '1';
}
else {
$saveData['hidden'] = '0';
}
foreach ($this->postvars AS $k => $v)
{
if (in_array($k, $db_fields)) {
if ($this->config['strip_tags']) {
$v = strip_tags($v);
}
$saveData[$k] = $v;
}
}
/**
* Start processing the RTE-edited entry
*/
if($this->RTEObj->isAvailable()) {
$pageTSConfig = $GLOBALS['TSFE']->getPagesTSconfig();
$RTEsetup = $pageTSConfig['RTE.'];
$this->thisConfig = $RTEsetup['default.'];
$this->thisConfig = $this->thisConfig['FE.'];
$saveData[$this->strEntryField] = $this->RTEObj->transformContent('db',$saveData[$this->strEntryField],$this->strEntryTable,$this->strEntryField,$saveData,$this->specConf,$this->thisConfig,'',$this->thePidValue);
}
/**
* End processing the RTE-edited entry
*/
$insert = $GLOBALS['TYPO3_DB']->exec_INSERTquery($this->strEntryTable, $saveData);
if ($insert) {
if (!empty($this->config['notify_mail'])) {
$this->sendNotificationMail($this->config['notify_mail']);
}
if (!empty($this->postvars['email']) && $this->config['feedback_mail']) {
$this->sendFeedbackMail($this->postvars['email']);
}
if ($this->for_tt_news) {
$altGoto = $this->pi_linkTP_keepPIvars_url ($overrulePIvars=array(), $cache=1, $clearAnyway=1, $this->config['redirect_page']);
}
if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ve_guestbook']['postEntryInsertedHook'])) {
foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ve_guestbook']['postEntryInsertedHook'] as $_classRef) {
$_procObj = & t3lib_div::getUserObj($_classRef);
$_procObj->postEntryInsertedProcessor($this);
}
}
header("Location: ".t3lib_div::getIndpEnv('TYPO3_REQUEST_DIR').($altGoto?$altGoto:$this->cObj->getTypoLink_URL($this->config['redirect_page'])));
}
}
}
// Pre-fill form data if FE user in logged in
if (!$this->postvars && $GLOBALS['TSFE']->loginUser) {
$surname_pos = strpos($GLOBALS['TSFE']->fe_user->user['name'], ' ');
$markerArray['###VALUE_FIRSTNAME###'] = substr($GLOBALS['TSFE']->fe_user->user['name'], 0, $surname_pos);
$markerArray['###VALUE_SURNAME###'] = substr($GLOBALS['TSFE']->fe_user->user['name'], ($surname_pos+1));
$markerArray['###VALUE_EMAIL###'] = $GLOBALS['TSFE']->fe_user->user['email'];
$markerArray['###VALUE_HOMEPAGE###'] = $GLOBALS['TSFE']->fe_user->user['www'];
$markerArray['###VALUE_PLACE###'] = $GLOBALS['TSFE']->fe_user->user['city'];
}
$markerArray = $this->markObligationFields($markerArray);
Änderung -------->if (is_object($this->freeCap)) {
$markerArray = array_merge($markerArray, $this->freeCap->makeCaptcha());
} else {
$template = $this->cObj->substituteSubpart($template,'###CAPTCHA_INSERT###','');
}
// Adds hook for processing of extra item markers
if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ve_guestbook']['extraItemMarkerHook'])) {
foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ve_guestbook']['extraItemMarkerHook'] as $_classRef) {
$_procObj = & t3lib_div::getUserObj($_classRef);
$markerArray = $_procObj->extraItemMarkerProcessor($markerArray, $row, $this->config, $this);
}
}
$form = $this->cObj->substituteMarkerArrayCached($form, $markerArray, array(), array());
$form = ereg_replace('###[A-Za-z_1234567890]+###', '', $form);
return $form;
}
}
/**
* Format string with nl2br and htmlspecialchars()
*/
function formatStr($str) {
if (is_array($this->conf["general_stdWrap."])) {
$str = $this->local_cObj->stdWrap($str,$this->conf["general_stdWrap."]);
}
return $str;
}
}
if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/sr_guestbook/pi1/class.ux_tx_veguestbook_pi1.php"]) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/sr_guestbook/pi1/class.ux_tx_veguestbook_pi1.php"]);
}
Änderung ---> if (is_object($this->freeCap) && !$this->freeCap->checkWord($this->postvars['captcha_response'])) {
$error .= '<li>'.ucfirst($this->pi_getLL('form_captcha_response'))." (".$this->pi_getLL('form_invalid_field').")</li>\n";
}
?>
Nach der Änderung habe ich dann die Originaldatei ersetzt und schwups schon haben wir ein Gästebuch mit sr_freecap und rtehtmlarea! 😃
Das ist eine feine Sache!
Achso zu erwähnen wäre noch, dass das Template der sr_guestbook extension genommen werden sollte, damit das rtehtmlarea richtig angezeigt wird. Die Captcha Marker können einfach aus dem Template vom ve_guestbook genommen/kopiert werden, da das sr_guestbook Template keine Captcha Marker enthält. So ich hoffe dass ich hiermit helfen konnte/kann! 😃
Ich habe die Änderungen an Stanislas Rolland gemailt. Ich denke er wird somit sr_guestbook in kommender Zeit nochmal updaten.
Viele Grüße
Markus