-
Notifications
You must be signed in to change notification settings - Fork 199
MODx Parse Error after Evo 1.1 Upgrade #768
Description
I've got another custom snippet that seems to be breaking after my 1.1 upgrade. Here is the error message
and the custom PHP code in the snippet
`<?php
$features = $modx->getTemplateVar('GetProperties','',1);
$features = $features['value'];
$features_arr = explode("||",$features);
//$ids = rtrim(join(',',$features_arr),",");
$ids = rtrim(join(',',preg_replace('/\D/', '',$features_arr)),",");
$query = "SELECT * FROM mls_listings where MLSNumber IN($ids) ORDER BY ListPrice DESC";
//$query = "SELECT * FROM mls_listings WHERE REPLACE(MLSNumber, 'OM', '') IN ($ids) ORDER BY ListPrice DESC";
$result = mysql_query($query);
if (!$result){
if ($onHome)
echo '';
return;
}
$numb = 0;
while ($row = mysql_fetch_assoc($result)){
$numb ++;
if ($onHome && $numb>3) break;
$price = (int)$row['ListPrice'];
$price_str = '';
$i=0;
while ((int)$price){
if ((int) $price && $i % 3 == 0 && $i) $price_str = ','. $price_str;
$i++;
$price_str = ($price % 10) . $price_str;
$price /=10;
}
$query2 = "SELECT * FROM mls_listings_images where UniqueIdent = '{$row["UniqueIdent"]}' ORDER BY ImageNo LIMIT 1";
$result2 = mysql_query($query2);
$row2 = mysql_fetch_assoc($result2);
$src = $row2['LocalLocation'];
$src = str_replace ('/****/****/public_html/soriahkanji.com/' , '' , $src);
$params['HouseNo']=$row['HouseNo'];
$params['StreetName']=$row['StreetName'];
$params['StreetType']=$row['StreetType'];
$params['ListPrice']= $price_str;
$params['TotalBedroom']=$row['TotalBedroom'];
$params['TotalBaths']=$row['TotalBaths'];
$params['PostalCode']=$row['PostalCode'];
$params['City']=$row['City'];
$params['ListingID']=$row['ListingID'];
$params['MLSNumber']=$row['MLSNumber'];
$params['PublicRemarks']=$row['C_Remarks'];
$params['image_src']=$src;
// $params['']=$row[''];
// $params['']=$row[''];
// $params['']=$row[''];
$output.=$modx->parseChunk('FeaturedPropertiesTpl', $params, '[+', '+]');
}
echo $output;
?>`

