By rfiertek on
I've been grinding thru this code for hours trying to find the thing that is causing the "unexpected $end" condition. I split up the long file into shorter bits and ran them through, until this shorter bit also got this error. All brackets are closed, all ";" are there, etc. The only thing I can think of is that I ought not to have a closing "?>" but when I pull it out I get the unexpected "<" error as the last "div" is parsed.
Maybe someone else can spot the obvious error I just cannot see...
Thanks,
Rob
<?php
if ( arg(1) == 'node' && is_numeric(arg(2)) ) { $nid = arg(2); } // Set nid variable, back arguments down one number once off rb4
// Pull most recent revision of moderated fields
$count = db_result(db_query('SELECT COUNT(vid) FROM {content_type_restaurant} WHERE nid = %d AND field_moderation_results_value = %d', $node->nid, 1));
if ( $count > 0 ) {
$result = db_result(db_query('SELECT MAX(vid) FROM {content_type_restaurant} WHERE nid = %d AND field_moderation_results_value = %d', $node->nid, 1));
$result1 = 'SELECT * FROM {content_type_restaurant} WHERE vid = %d';
$query1 = db_query(db_rewrite_sql($result1), $result);
global $ress;
$ress = array();
while ($row = db_fetch_array($query1)) $ress[] = $row;
}
// Set general name based on taxonomy id
$sel = $ress[0]['field_rest_lo01_m_value'];
$genname = db_result(db_query('SELECT name FROM {term_data} WHERE tid = %d', $sel));
$ress[0]['field_rest_lo01_m_value'] = $genname;
?>
<b>START OF RIGHT HAND BOX</b>
<div class="moderated-field-label-general-name-box"><?php print $ress[0]['field_rest_lo01_m_value']; ?></div> <!-- rest name gen -->
<div class="field-item"><?php print $node->field_rest_location[0]['view']; ?></div>
<div class="moderated-field-label"><b>Neighborhood: </b><?php print $ress[0]['field_totalneigh_value']; ?></div>
<div class="moderated-field-label"><b>Email: </b><?php print $node->field_rest_lo12_email[0]['view']; ?></div>
<br/>
<?php
if ( $ress[0]['field_totalcostlow_value'] != '' && $ress[0]['field_totalcostlow_value'] != NULL ) { ?>
<div class="moderated-field-label"><b>Cost: </b>
<?php print "$" . $ress[0]['field_totalcostlow_value'] . " to $" . $ress[0]['field_totalcosthigh_value']; ?></div>
<?php } ?>
<div class="moderated-field-label"><?php
if ( $ress[0]['field_totalhours_value'] != '' && $ress[0]['field_totalhours_value'] != NULL ) { ?>
<b>Hours: </b><?php print $ress[0]['field_totalhours_value'] . " - "; } ?>
<b>Closed </b> <?php if ( $ress[0]['field_totalholiday_value'] != '' && $ress[0]['field_totalholiday_value'] != NULL ) { print $ress[0]['field_totalholiday_value'] . " - " . $ress[0]['field_rest_td54_m_value']; ?> <!-- holiday and comments -->
</div>
<div class="moderated-field-label"><b>Reservations: </b>
<?php print $node->field_rest_td55_reservations[0]['view'] . " - " . $ress[0]['field_rest_td56_m_value']; ?></div> <!-- reservations and comments -->
<div class="moderated-field-label"><b>Attire: </b>
<?php print $node->field_rest_td57_attire[0]['view'] . " - " . $ress[0]['field_rest_td58_m_value']; ?></div> <!-- attire and comments -->
<div class="moderated-field-label"><b>Payment: </b>
<?php print $ress[0]['field_totalpayment_value'] . " - " . $ress[0]['field_rest_td60_m_value']; ?></div> <!-- payments comments -->
<br/>
<div class="field-item"><?php print $node->field_rest_lo15_web_url[0]['view'] . " " . " " . $node->field_rest_lo16_web_menu_url[0]['view']; ?></div>
<br/>
Comments
Can you copy 'n' paste the
Can you copy 'n' paste the error you're getting?
You need a closing curly
You need a closing curly brace on line 47 of your if statement: http://pastebin.com/XnTk5WY1
mea culpa
I had said all braces were there, but somehow (SOMEHOW!) I still managed to miss a brace!!
Let this be a lesson, one can never be too much of a dumbass.
Thank you.
That is ...
... inspirational. :-)