Need help with PHP Parse error - Joomla! Forum - community, help and support
i receive error when going page trying edit. in case wondering trying ad captcha jfeedback form.
parse error: syntax error, unexpected t_string, expecting ',' or ';' in /home/themodst/public_html/components/com_jfeedback/views/jfeedback/tmpl/default.php on line 103
here code:
parse error: syntax error, unexpected t_string, expecting ',' or ';' in /home/themodst/public_html/components/com_jfeedback/views/jfeedback/tmpl/default.php on line 103
here code:
code: select all
<?php // no direct access
defined('_jexec') or die('restricted access'); ?>
<?php
$config =& jcomponenthelper::getparams( 'com_jfeedback' );
$showauthor = $config->get( 'showauthor' );
$showdate = $config->get( 'showdate' );
$permission = $config->get( 'permission' );
$the = $config->get( 'the' );
$tmex = $config->get( 'tmex' );
$tauthor = $config->get( 'tauthor' );
$tdate = $config->get( 'tdate' );
$tfeedback = $config->get( 'tfeedback' );
$has_said = $config->get( 'has_said' );
$numfeed = $config->get( 'numfeed' );
$name = $config->get( 'name' );
$intro = $config->get( 'intro' );
$namey = $config->get( 'namey' );
$introy = $config->get( 'introy' );
if ( $namey == '1' ) { echo '
<div class="componentheading" id="jfheading">';echo $name;echo '</div>
<br>';}
if ( $introy == '1' ) { echo '
<p class="jfeedbackintro" style="opacity:.75;;">';echo $intro;echo '</p><br><br>';
}
if ( $_post['insfeedback'] != '' && $_post['insdate'] != '' && $_post['insauthor'] != '' )
{ echo '<h2 style="color:red">feedback added</h2><br><br>';}
?>
<?
// load id
$dboid =& jfactory::getdbo();
$queryid = "select id #__jfeedback order id desc";
$dboid->setquery( $queryid );
$id =& $dboid->loadresultarray();
// right number of entries
$outputid = array_slice($id, 0, $numfeed);
// recursive write
while (list($key,$v_id) = each($outputid)){
$dbo =& jfactory::getdbo();
$queryauthorv_id = "select author #__jfeedback id =".$v_id.';';
$querydatev_id = "select data #__jfeedback id =".$v_id.';';
$queryfeedbackv_id = "select feedback #__jfeedback id =".$v_id.';';
$dbo->setquery( $queryauthorv_id );
$author =& $dbo->loadresultarray();
$dbo->setquery( $querydatev_id );
$date =& $dbo->loadresultarray();
$dbo->setquery( $queryfeedbackv_id );
$feedback =& $dbo->loadresultarray();
// if session
if ( $showauthor == 1 && $showdate == 1 ){
echo "<div class='jfeedback' id='jf".$v_id."'>";
echo "<div class='jfeedbacktitle' id='jftitle".$v_id."'>";
echo '<b>'.$author[0].'</b>';
echo ', '.$the.' ';
echo '<b>'.$date[0].'</b>';
echo ' '.$has_said.':<br>';
echo '</div>';
echo $feedback[0];
echo '</div><br>';
echo "<hr style='width:100%' size='2' /><br>";
}
if ( $showauthor == 1 && $showdate == 0 ){
echo "<div class='jfeedback' id='jf".$v_id."'>";
echo "<div class='jfeedbacktitle' id='jftitle".$v_id."'>";
echo '<b>'.$author[0].'</b>';
echo ' '.$has_said.':<br>';
echo '</div>';
echo $feedback[0];
echo '</div><br>';
echo "<hr style='width:100%' size='2' /><br>";
}
if ( $showauthor == 0 && $showdate == 1 ){
echo "<div class='jfeedback' id='jf".$v_id."'>";
echo "<div class='jfeedbacktitle' id='jftitle".$v_id."'>";
echo '<b>'.$date[0].'</b>';
echo ':<br>';
echo '</div>';
echo $feedback[0];
echo '</div><br>';
echo "<hr style='width:100%' size='2' /><br>";
}
if ( $showauthor == 0 && $showdate == 0 ){
echo "<div class='jfeedback' id='jf".$v_id."'>";
echo $feedback[0];
echo '</div><br>';
echo "<hr style='width:100%' size='2' /><br>";
}
}
?>
<?php
if ( $permission == 1 ) { echo '
<br><div class="leaveus">'.$tmex.'</div><br><br>
<form action="" method="post" name="form" id="form">
'.$tauthor.':<br>
<input class="text_area" type="text" name="insauthor" id="insauthor" size="32" maxlength="250" value="" /><br>
'.$tdate.':<br>
<input class="text_area" type="text" name="insdate" id="insdate" size="32" maxlength="250" value="" /><br>
'.$tfeedback.':<br>
<textarea class="text_area" type="text" name="insfeedback" id="insfeedback" rows="8" cols="20" value="" ></textarea>
<br>
require_once('recaptchalib.php');
$publickey = "..."; // got signup page
echo recaptcha_get_html($publickey);
<br>
require_once('recaptchalib.php');
$privatekey = "...";
$resp = recaptcha_check_answer ($privatekey,
$_server["remote_addr"],
$_post["recaptcha_challenge_field"],
$_post["recaptcha_response_field"]);
if (!$resp->is_valid) {
die ("the recaptcha wasn't entered correctly. go , try again." .
"(recaptcha said: " . $resp->error . ")");
}
<br>
<input type="submit" name="submit" id="submit" size="32" maxlength="250" value="submit" />
</form>';}
?>
<?php
if ( $_post['insfeedback'] != '' && $_post['insdate'] != '' && $_post['insauthor'] != '' )
{
$database =& jfactory::getdbo();
$user = new stdclass;
$user->id = null;
$user->feedback = $_post['insfeedback'];
$user->data = $_post['insdate'];
$user->author = $_post['insauthor'];
if (!$database->insertobject( '#__jfeedback', $user, 'id' )) {
echo $database->stderr();
};
}
?>
you need wrap php code in <?php ?> blocks:
instead of
do everywhere inserted php code (just replace 1 @ time - line numbers in warning correspond next block fix).
edit: please scrub key post, in case...
code: select all
<br>
<?php
require_once('recaptchalib.php');
$publickey = "*************"; // got signup page
echo recaptcha_get_html($publickey);
?>
<br>
instead of
code: select all
<br>
require_once('recaptchalib.php');
$publickey = "*************"; // got signup page
echo recaptcha_get_html($publickey);
<br>
do everywhere inserted php code (just replace 1 @ time - line numbers in warning correspond next block fix).
edit: please scrub key post, in case...
Comments
Post a Comment