diff -uNr --strip-trailing-cr FR-2.8/CHANGELOG FR-2.8.3/CHANGELOG --- FR-2.8/CHANGELOG 2003-07-30 15:10:40.000000000 -0700 +++ FR-2.8.3/CHANGELOG 2003-08-13 14:31:06.000000000 -0700 @@ -1,4 +1,24 @@ -Changes in FR-2.8 (7/30/2003 +Changes in FR-2.8.3 (8/13/2003) +**** +Patrick Fleming +Added NetPBM options to thumbnail.php +Updated admin/convert.php to use ImageMagick and NetPBM tools +The convert.php script is not perfect, but works pretty well. +Content was moved from the index.php to files included from content/ + + +Changes in FR-2.8.2 (8/9/2003) (Not publicly released) +**** +Patrick Fleming +Added ImageMagick options to the thumbnail.php file + +Changes in FR-2.8.1 (8/6/2003) (This was not publicly released) +**** +Patrick Fleming +Minor fix to index.php to fix noimage results + + +Changes in FR-2.8 (7/30/2003) **** Patrick Fleming Moved navigation code from admin.php to a function in includes/func.php diff -uNr --strip-trailing-cr FR-2.8/CHANGELOG~ FR-2.8.3/CHANGELOG~ --- FR-2.8/CHANGELOG~ 1969-12-31 17:00:00.000000000 -0700 +++ FR-2.8.3/CHANGELOG~ 2003-08-13 14:27:18.000000000 -0700 @@ -0,0 +1,151 @@ +Changes in FR-2.8.3 (8/13/2003) +**** +Patrick Fleming +Added NetPBM options to thumbnail.php +Updated admin/convert.php to use ImageMagick and NetPBM tools +The convert.php script is not perfect, but works pretty well. + +Changes in FR-2.8.2 (8/9/2003) (Not publicly released) +**** +Patrick Fleming +Added ImageMagick options to the thumbnail.php file + +Changes in FR-2.8.1 (8/6/2003) (This was not publicly released) +**** +Patrick Fleming +Minor fix to index.php to fix noimage results + + +Changes in FR-2.8 (7/30/2003) +**** +Patrick Fleming +Moved navigation code from admin.php to a function in includes/func.php +includes/func.php uses $_GET[]; +Updated common.php for PHP< 4.1 users +Added navigation code to agentadmin.php + + + +Changes in FR-2.7-pre7.2 (7/29/2003) +**** +Patrick Fleming +Moved the states dropdown to an external file templates/states.php +Fixed upload bug (that no-one reported) for the image files in admin.php +and in agentadmin.php + +Changes in FR-2.7-pre7.1 +**** +Modified this file (CHANGELOG) to properly credit Tom Anderson for changes in +admin.php. Tom created the code to use a drop down menu for agents. + + +**** +Patrick Fleming +Minor bug fix in admin.php +Changed the behavior of upgradeasaurus2.7.php to set thumbnails to '' instead of 'NULL' + + +Changes in FR-2.7-pre6 +**** +Patrick Fleming +Modified agentadmin.php /admin/admin.php and /includes/thumbnail.php +to do some file checking on image uploads. + +Changes in FR-2.7-pre5 +**** +Patrick Fleming +Fixed missing $table_prefix in /admin/agenteditor.php +Deleted thumbnail.php since it didn't do anything +Added thumbnail.php to includes directory - changes throughout to integrate + thumbnail/preview images. +Modified the configurator.sql, configurator.php, upgradasaurus2.7.php + due to changes to the db. +Added admin/convert.php to pull images from an existing db, create thumbs/previews + and add back into the db. + +Changes in FR-2.7-pre4 +**** +Patrick Fleming +Minor code fix in admin/adminfeatures.php passed $table_prefix to +show_features() function. + + +Changes in FR-2.7-pre3 +**** +Patrick Fleming +Cleaned up code. Added $table_prefix to user created functions. Removed the +reference in common.php to files needing modification for proper $table_prefix +functionality. Removed $table_prefix from includes/features.php and from +propview.php where it was seperately defined. + +Changes in FR-2.7-pre2 +**** +Patrick Fleming +Modification to common.php to add $install_path variable. This was neccesary +for proper functionality of the includes directory. Added/defined $table_prefix +variable in several pages. + + +Changes in FR-2.7-pre1 +**** +Patrick Fleming +Major overhaul of the configurator.php file to include Tom Anderson's features +code in new installs. Included a new file, upgradasaurus2.7.php, to allow an +existing 2.6 installation to upgrade to this version with feature code. +Added $table_prefix variable in common.php and in all files to allow use in an +existing db for those unfortunate enough to be stuff with one db by their host. + + +Changes in FR-2.6-2.1 +**** +Patrick Fleming +Minor change to admin.php to show agent name related to listing +Added includes directory. +Code at the bottom of common.php *should* pull in any includes/*.php file +Added field for database that allows an agent to enter a title eg. Broker, Agent, CRS, etc. + + + +**** +Tom Anderson + $link code moved into includes/func.php- removes the extra code + at the top of each file to open the db. + features.php file -- moved from top directory to includes by Patrick Fleming + Added drop down selection for agents into admin.php. + + + + +**** + +January 16, 2003 +Changes in FR-2.6-2 from OR 2.6-1 +**** +Patrick Fleming +Included license.txt file +Added this changelog file to package +Including the map view fix for Yahoo maps +Added $limit to queries in index.php +Minor bug fixes in admin.php and agentadmin.php +**** + +Ideas by: John Matson 2003 +Added additional fields to agentadmin.php: Allows an agent to quickly glance +to see whether a propery is featured, and which status is assigned in the db. +~line 911 +Added 'Held' status with changes made to browse.php, index.php and propview.php +Added the same views to admin/admin.php ~line 866 +**** + +Ideas By: Jake Ortman 2003 +Edit common.php adding No Image selection for featured code. +Added $limit to common.php limits featured properties listed on index.php +Added checking for $noimage in index.php ~line 39 +**** + +Changed the name to FreeRealty to avoid confusion with Jon Roig's ongoing +project. FreeRealty is a fork of Jon Roig's original Open Realty project +http://jonroig.com + +FreeRealty can currently be downloaded from http://www.rwcinc.net/freerealty + diff -uNr --strip-trailing-cr FR-2.8/README FR-2.8.3/README --- FR-2.8/README 2003-02-04 09:56:18.000000000 -0700 +++ FR-2.8.3/README 2003-08-13 14:35:28.000000000 -0700 @@ -1,8 +1,8 @@ -Free Realty version 2.6-2 Copyright RWC Inc. 2003 +Free Realty version 2.6-2 through 2.8.3 Copyright RWC Inc. 2003 Open Realty version 2.6 Copyright Jon Roig 2002 - Free Realty 2.6-2 is free software; you can redistribute it and/or modify + Free Realty 2.8.3 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. @@ -13,6 +13,6 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with Free Realty 2.6-2; if not, write to the Free Software + along with Free Realty 2.8.3; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA diff -uNr --strip-trailing-cr FR-2.8/admin/convert.php FR-2.8.3/admin/convert.php --- FR-2.8/admin/convert.php 2003-03-24 10:22:02.000000000 -0700 +++ FR-2.8.3/admin/convert.php 2003-08-13 14:21:26.000000000 -0700 @@ -1,14 +1,22 @@ +
+ This process is CPU intensive, you may need to hit refresh to get all images converted +
"; -$result = mysql_query($sql,$link); -while ($image_row= mysql_fetch_array($result)) +$sql_result = mysql_query($sql,$link); +while ($image_row= mysql_fetch_array($sql_result)) { -/* - ob_start(); - - echo ""; - $data = ob_get_contents(); - ob_end_clean(); */ -// echo "Result ".$data; - -//Build some temporary storage- since I have figured out how to do this with variables +//Build some temporary storage- since I haven't figured out how to do this with variables $imagename = "$image_row[filename]"; $thumbname = "thumb_$imagename"; $fp = fopen("/tmp/$imagename", "w"); @@ -42,7 +45,6 @@ //Let's get some image info $imagedata = getimagesize("/tmp/$imagename"); -// $imagedata = getimagesize($image_row[bin_data]); $imagewidth = $imagedata[0]; $imageheight = $imagedata[1]; $imagetype = $imagedata[2]; @@ -54,37 +56,43 @@ $dest_height = $shrinkage * $imageheight; $dest_width = $config[thumbnail_width]; - if ($imagetype == '2') //Jpeg processing + if ($imagetype == '2' && $image_style == 'gd') //Jpeg processing { $src_img = imagecreatefromjpeg("/tmp/$imagename"); -/* if (function_exists(imagecreatetruecolor)){ - $dst_img = imagecreatetruecolor($dest_width,$dest_height);} - else { echo "using older functions- image may not be ideal"; */ - $dst_img = imagecreate($dest_width,$dest_height); -/* } - if (function_exists(imagecopyresampled)) { - imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $dest_width,$dest_height, $imagewidth, $imageheight); } - else { echo "Using older functions- images may not appear ideal"; */ - imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $dest_width,$dest_height, $imagewidth, $imageheight); -// } - imagejpeg($dst_img, "/tmp/$thumbname", $quality); - imagedestroy($src_img); - imagedestroy($dst_img); - } - elseif ($imagetype == '3') + $dst_img = @imagecreatetruecolor($dest_width, $dest_height); + if (!$dst_img) //Test to see if gd2 is working- if not use gd1 functions + { + $dst_img = imagecreate($dest_width,$dest_height); + } + $result = @imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $dest_width,$dest_height, + $imagewidth, $imageheight); + if (!$result) + { + $result = imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $dest_width,$dest_height, + $imagewidth, $imageheight); + } + $result; //Actually do the work + imagejpeg($dst_img, "/tmp/$thumbname", $quality); + imagedestroy($src_img); + imagedestroy($dst_img); + } + elseif ($imagetype == '3' && $image_style == 'gd') { $src_img = imagecreatefrompng("/tmp/$imagename"); - /* if (function_exists(imagecreatetruecolor)) - { $dst_img = imagecreatetruecolor($dest_width,$dest_height); } - else { */ - $dst_img = imagecreate($dest_width, $dest_height); -/* } - if (function_exists(imagecopyresampled)) { - imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $dest_width, $dest_height, $imagewidth, $imageheight); } - else { */ - imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $dest_width,$dest_height, $imagewidth, $imageheight); -// } + $dst_img = @imagecreatetruecolor($dest_width, $dest_height); + if (!$dst_img) //Check to see if gd2 worked + { + $dst_img = imagecreate($dest_width, $dest_height); + } + $result = @imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $dest_width,$dest_height, + $imagewidth, $imageheight); + if (!$result) //Check to see if gd2 worked + { + $result = imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $dest_width,$dest_height, + $imagewidth, $imageheight); + } + $result; imagepng($dst_img,"/tmp/$thumbname", $quality); imagedestroy($src_img); imagedestroy($dst_img); @@ -92,19 +100,64 @@ } - - $fp = fopen("/tmp/$thumbname" , "r"); - $thumb_size= filesize("/tmp/$thumbname"); - $thumb = addslashes(fread($fp, $thumb_size)); - fclose($fp); - $query = "UPDATE ".$table_prefix."tbl_Files set thumb='$thumb', thumb_size='$thumb_size', thumb_filetype='$image_row[filetype]' where id_files = '$image_row[id_files]'"; - if (!mysql_query($query,$link)) { echo "Failed to update ".mysql_error(); } - echo "Affected rows ".mysql_affected_rows()."
"; - //$listing = `ls -l /tmp`; +//Begin ImageMagick section + elseif ($image_style == 'im' && ($imagetype >='1' && $imagetype <='14' )) + { + $fpoint = fopen("/tmp/$thumbname", "w" ); + $data = fopen("/tmp/$imagename", "r"); + $modify_size = $dest_width."x".$dest_height; + fwrite ($fpoint, $data); + fclose($fpoint); + exec("convert /tmp/$imagename -resize $config[thumbnail_width] /tmp/$thumbname"); + } + +//End ImageMagick section +//Begin the NetPBM section + elseif ($image_style == 'np' && ($imagetype >= '1' && $imagetype <= '3')) + { + $fpoint = fopen("/tmp/$thumbname", "w" ); + $data = fopen("/tmp/$imagename", "r"); + fwrite ($fpoint, $data); + fclose($fpoint); + //I know this can be done better with redirects, but this works. + if ($imagetype == '1') + { + exec("giftopnm /tmp/$imagename | pnmscale -width=$dest_width >/tmp/temp_$thumname"); + } + else + { + exec("anytopnm /tmp/$imagename | pnmscale -width=$dest_width >/tmp/temp_$thumbname "); + } + exec("pnmtojpeg /tmp/temp_$thumbname >/tmp/$thumbname "); + unlink("/tmp/temp_$thumbname"); + } + + else //Some of these images just don't seem to work with the libraries + { + $fpoint = fopen("/tmp/$thumbname", "w" ); + $data = fopen("/tmp/$imagename", "r"); + fwrite ($fpoint, $data); + fclose($fpoint); + } + + +//This section actually updates the database + $fp = fopen("/tmp/$thumbname" , "r"); + $thumb_size= filesize("/tmp/$thumbname"); + $thumb = addslashes(fread($fp, $thumb_size)); + fclose($fp); + $query = "UPDATE ".$table_prefix."tbl_Files set thumb='$thumb', thumb_size='$thumb_size', + thumb_filetype='$image_row[filetype]' where id_files = '$image_row[id_files]'"; + if (!mysql_query($query,$link)) + { + echo "Failed to update ".mysql_error(); + } + echo "Affected rows ".mysql_affected_rows()."
"; +//$listing = `ls -l /tmp`; // $listing = nl2br($listing); // echo $listing; - unlink ("/tmp/$thumbname"); - unlink ("/tmp/$imagename"); + unlink ("/tmp/$thumbname"); + unlink ("/tmp/$imagename"); } //echo ""; @@ -112,4 +165,7 @@ ?> +
+ Please review all images to verify the conversion +
diff -uNr --strip-trailing-cr FR-2.8/agentadmin.php FR-2.8.3/agentadmin.php --- FR-2.8/agentadmin.php 2003-07-30 12:43:36.000000000 -0700 +++ FR-2.8.3/agentadmin.php 2003-08-13 11:21:20.000000000 -0700 @@ -116,7 +116,9 @@ $binFile_type = strtolower($binFile_type); if ($binFile_type != "image/jpg" && $binFile_type != "image/jpeg" && $binFile_type != "image/gif" && $binFile_type != "image/png" && - $binFile_type != "image/bmp" && $binFile_type != "image/pjpeg") + $binFile_type != "image/bmp" && $binFile_type != "image/pjpeg" +// && $binFile_type != "image/tiff" + ) { echo "Invalid file type- File will not be uploaded"; } @@ -299,7 +301,7 @@ Geneva,Swiss,SunSans-Regular\">"; //select images connected to a given listing - $query = "SELECT filename,id_files,prop_num,owner, thumb,thumb_size,thumb_filetype FROM " + $query = "SELECT filename,id_files,prop_num,owner, thumb,thumb_size,thumb_filetype, description FROM " .$table_prefix."tbl_Files WHERE prop_num = '$propnum'"; $result = mysql_query("$query",$link); $num_images = 0; diff -uNr --strip-trailing-cr FR-2.8/agentadmin.php~ FR-2.8.3/agentadmin.php~ --- FR-2.8/agentadmin.php~ 1969-12-31 17:00:00.000000000 -0700 +++ FR-2.8.3/agentadmin.php~ 2003-08-13 11:21:22.000000000 -0700 @@ -0,0 +1,708 @@ +
+ Please enter your user name and password:

"; + print "Login Name:

"; + print "Password:

+

"; + print "

Enter your address to get your password emailed to you: +

"; + include("./templates/user_bottom.html"); + exit; + + } +elseif ($agentname != "" OR $current_user != "") + { + $sql = "SELECT id FROM ".$table_prefix."agents WHERE agent='$agentname' + and agentpass='$agentpassword'"; + + $result = mysql_query($sql) + or die("Couldn't execute query."); + + $num = mysql_numrows($result); + if ($num == 1) + { + session_register("agentname"); + session_register("agentpassword"); + echo "\r\n"; + print "\r\n"; + session_register("current_user"); + session_register("agent"); + session_register("agenturl"); + session_register("agentemail"); + //COLLECT INFORMATION ABOUT THE CURRENT USER + $result = mysql_query("SELECT * FROM ".$table_prefix."agents WHERE agent='$agentname';",$link); + while ($a_row =mysql_fetch_array ($result) ) + { + $current_user = $a_row[id]; + $agent = $a_row[agent]; + $agenturl = $a_row[agenturl]; + $agentemail = $a_row[agentemail]; + } + print "\r\n\r\n"; + } + else if ($num == 0) + { + include("./templates/user_top.html"); + echo 'That login/password combination is incorrect.

'; + print "

+ Please enter your user name and password:

"; + print "Login Name:

"; + print "Password:

+

"; + print "

Enter your address to get your password emailed to you: +

"; + include("./templates/user_bottom.html"); + exit; + } + } + + + + + + + //print the header + print "\r\n"; + include("./templates/agent_top.html"); + //ERRORS AND STATUS DISPLAY IN THE BOX + //DELETE A RECORD + if ($delete != "") + { + $query = "DELETE FROM ".$table_prefix."homes WHERE ((id = '$delete') AND (owner = + $current_user))"; + if (!mysql_query ($query, $link) ) + { + die (mysql_error()); + } + print "Listing #$delete has been removed..."; + $query = "DELETE FROM ".$table_prefix."tbl_Files WHERE ((prop_num = '$delete') AND + (owner = '$current_user'))"; + if (!mysql_query ($query, $link) ) + { + die (mysql_error()); + } + print "Images for property #$delete have also been removed..."; + } + + + //DELETE AN IMAGE + if ($deleteimage != "") + { + $query = "DELETE FROM ".$table_prefix."tbl_Files WHERE ((id_files = $deleteimage) AND + (owner='$current_user'))"; + if (!mysql_query ($query, $link) ) + { + die (mysql_error()); + } + print "$filename has been removed..."; + } + + if ($action == "upload") + { + //Highly experimental and quite a bit of 'ugly' code if I do say so myself- Patrick + if (isset($binFile) && $binFile != "none") + { + //Changes 7-29-2003 changed or operand to and operand (|| to && in the following lines + //to fix the behavior. + $binFile_type = strtolower($binFile_type); + if ($binFile_type != "image/jpg" && $binFile_type != "image/jpeg" && + $binFile_type != "image/gif" && $binFile_type != "image/png" && + $binFile_type != "image/bmp" && $binFile_type != "image/pjpeg" && + $binFile_type != "image/tiff" ) + { + echo "Invalid file type- File will not be uploaded"; + } + else + { + $data = addslashes(fread(fopen($binFile, "r"), filesize($binFile))); + $strDescription = addslashes(nl2br($txtDescription)); + if (isset($thumbnails) && $thumbnails=="y") + { + $thdb="y"; + make_thumb($binFile,$binFile_name); + $fp = fopen("/tmp/$thumbname" , "r"); + $thumb_size= filesize("/tmp/$thumbname"); + $thumb = addslashes(fread($fp, $thumb_size)); + } + $sql = " INSERT INTO ".$table_prefix."tbl_Files "; + $sql .= "(description, bin_data, filename, filesize, filetype, owner, prop_num "; + if ($thdb =='y') + { + $sql .= " , thumb, thumb_size, thumb_filetype "; + } + $sql .= " ) "; + $sql .= " VALUES ('$strDescription', '$data', "; + $sql .= " '$binFile_name', '$binFile_size', '$binFile_type', '$current_user', + '$propnum'"; + if ($thdb =='y') + { + $sql .= " , '$thumb', '$thumb_size', '$binFile_type' "; + } + $sql .=" ) "; + if (!mysql_query ($sql, $link) ) + { + die (mysql_error()); + } + echo "Your image has been added ($binFile_name)."; + if ($thdb =='y') + { + unlink("/tmp/$thumbname"); //Delete the temp file now that we've had our way with it. + $thdb = 'n'; + } + } + } + } + //MODIFY A RECORD + if ($modify != "") + { + print "editing field $modify..."; + //add slashes to input so things don't get messed up in mySQL + $title = addslashes($title); + $address = addslashes($address); + $city = addslashes($city); + $previewdesc = addslashes($previewdesc); + $fulldesc = addslashes($fulldesc); + $neighborhood = addslashes($neighborhood); + $notes = addslashes($notes); + + //strip extra characters out of the price + $price = ereg_replace("[^[:alnum:]]","",$price); + $proptax = ereg_replace("[^[:alnum:]]","",$proptax); + + //formats the description text, if necessary + if ($linefeeds == "Y") + { + $previewdesc = ereg_replace("(\r\n|\n|\r)", "
", $previewdesc); + $fulldesc = ereg_replace("(\r\n|\n|\r)", "
", $fulldesc); + } + + $query = "UPDATE ".$table_prefix."homes SET title = '$title', address = '$address', + city = '$city', state = '$state', zip = '$zip', price = '$price', + previewdesc = '$previewdesc', fulldesc = '$fulldesc', type = '$type', + imageloc = '$imageloc', beds ='$beds', baths='$baths', status='$status', + featured='$featured', mls='$mls', neighborhood='$neighborhood', agent='$agent', + agenturl='$agenturl', agentemail='$agentemail', notes = '$notes', owner = '$current_user', + yearbuilt= '$yearbuilt', sqfeet = '$sqfeet', lotsize= '$lotsize', numfloors = '$numfloors', + garagesize = '$garagesize', proptax = '$proptax', country = '$country', + virtualtour = '$virtualtour', dateavailable = '$dateavailable', heat = '$heat', + style = '$style', onmarket = '$onmarket' WHERE ((id='$modify') AND + (owner = $current_user))"; + + if (!mysql_query ($query, $link) ) + { + die (mysql_error()); + } + + // Update the features + mysql_query("delete from ".$table_prefix."homes_features where ref_homes = $modify", $link); + foreach ($features as $key) + { + $sql = "insert into ".$table_prefix."homes_features (ref_homes, ref_features) values + ($modify, $key)"; + mysql_query($sql, $link); + } + + print "Listing #$modify has been updated..."; + } + + //ADD A RECORD + if ($action=="add") + { + $dberror = ""; + //add slashes to input so things don't get mangled in mySQL + $title = addslashes($title); + $address = addslashes($address); + $city = addslashes($city); + $previewdesc = addslashes($previewdesc); + $fulldesc = addslashes($fulldesc); + $neighborhood = addslashes($neighborhood); + //strip extra characters out of the price + $price = ereg_replace("[^[:alnum:]]","",$price); + $proptax = ereg_replace("[^[:alnum:]]","",$proptax); + if ($linefeeds == "Y") + { + $previewdesc = ereg_replace("(\r\n|\n|\r)", "
", $previewdesc); + $fulldesc = ereg_replace("(\r\n|\n|\r)", "
", $fulldesc); + } + $query = "INSERT INTO ".$table_prefix."homes (title, address, city, state, zip, price, + previewdesc, fulldesc, type, imageloc, beds, baths, status, featured, mls, neighborhood, + agent, agenturl, agentemail, notes, owner, yearbuilt, sqfeet, lotsize, numfloors, garagesize, + proptax, country, virtualtour, dateavailable, heat, style, onmarket) values ('$title', + '$address', '$city', '$state', '$zip', '$price', '$previewdesc', '$fulldesc', '$type', + '$imageloc', '$beds', '$baths', '$status', '$featured','$mls', '$neighborhood', '$agent', + '$agenturl', '$agentemail', '$notes', '$current_user', '$yearbuilt', '$sqfeet', '$lotsize', + '$numfloors', '$garagesize', '$proptax', '$country', '$virtualtour', '$dateavailable', + '$heat', '$style', '$onmarket')"; + + if (!mysql_query ($query, $link) ) + { + die (mysql_error()); + } + $modify = mysql_insert_id($link); + foreach ($features as $key) + { + $sql = "insert into ".$table_prefix."homes_features (ref_homes, ref_features) values + ($modify, $key)"; + mysql_query($sql, $link); + } + + print "Your listing has been added..."; + } + + //THUS ENDS THE STATUS AREA... +?> + + +

+ +Preview Listing
"; + $result = mysql_query("SELECT * FROM ".$table_prefix."homes WHERE ((id='$edit') AND + (owner = '$current_user'));",$link); + while ($a_row =mysql_fetch_array ($result) ) + { + $propnum = $a_row[id]; + //strip slashes so input appears correctly + $a_row[title] = stripslashes ($a_row[title]); + $a_row[address] = stripslashes($a_row[address]); + $a_row[city] = stripslashes($a_row[city]); + $a_row[previewdesc] = stripslashes($a_row[previewdesc]); + $a_row[fulldesc] = stripslashes($a_row[fulldesc]); + $a_row[neighborhood] = stripslashes($a_row[neighborhood]); + $a_row[notes] = stripslashes($a_row[notes]); + + //format description fields appropriately + if ($linefeeds == "Y") + { + $a_row[previewdesc] = ereg_replace("
", "\r\n", $a_row[previewdesc]); + $a_row[fulldesc] = ereg_replace("
", "\r\n", $a_row[fulldesc]); + } + + print "

"; + print "
"; + print "
"; + + //select images connected to a given listing + $query = "SELECT filename,id_files,prop_num,owner, thumb,thumb_size,thumb_filetype, description FROM " + .$table_prefix."tbl_Files WHERE prop_num = '$propnum'"; + $result = mysql_query("$query",$link); + $num_images = 0; + while ($image_row =mysql_fetch_array ($result) ) + { + echo "

\n"; + echo "$image_row[filename]
\n"; + echo "$image_row[thumb_filetype] (Size $image_row[thumb_size])

\n"; + echo "Click to Enlarge
"; + echo stripslashes($image_row[description]) . "

\n"; + echo "delete image


"; + $num_images++; + } + + print "
"; + print ""; + print ""; + print ""; + print ""; + if ($use_country == "Y") + { + print ""; + } + + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + + if ($agent_feature == "Y") + { + print ""; + } + else + { + print " "; + } + + if ($show_tour == "Y") + { + print ""; + } + print ""; + print ""; + print ""; + print ""; + print "
title:
address:
city:
State: "; + //moved the state selections to an external file + include ("./templates/states.php"); + print "
country:
zip:
neighborhood: "; + print "
price: .00
date available:
preview description: +
full description:
Type: "; + print " "; + Print "
style:
beds:
baths:
number of floors:
square feet:
garage size:
heat:
annual prop tax:
Also on sales market: +
Status:
featured:"; + print "
virtual tour url:
agent: $a_row[agent]
Notes:
(Not visible to users)
+
"; + print "
Please mark whichever features apply:"; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print "
"; + print "HOME FEATURES"; + print ""; + print "COMMUNITY FEATURES"; + print "
"; + + show_features(true, $edit, true, $table_prefix); + print "
"; + print "

"; + print ""; + if ($num_images < $max_images) + { + print "

Manage Images

"; + print"

"; + print""; + print""; + print""; + print""; + print""; + print""; + print""; + print""; + print""; + print""; + print""; + print""; + print""; + print""; + print""; + print"
Title:
File:
"; + print"
"; + print "
"; + } + else + { + print "
Maximum number of images added
"; + } + } + } +elseif ($action == "addlisting") + //add a listing to the directory + { + //retrieve some information about the user + print "
"; + print "Add Listing"; + print "

"; + print "

"; + print ""; + print ""; + print ""; + print " + "; + + include("./templates/states.php"); + + print ""; + + if ($use_country == "Y") + { + print ""; + } + + print ""; + print ""; + print ""; + + print ""; + print ""; + print ""; + + + print ""; + + + print ""; + print ""; + print ""; + + print ""; + + print ""; + + print ""; + + print ""; + + print ""; + + print ""; + + + //can agents make a listing into a featured listing? + + if ($agent_feature == "Y") + { + print ""; + } + + print ""; + + if ($show_tour == "Y") + { + print ""; + } + + print ""; + + + print ""; + + + print ""; + print ""; + print "
title: +
address: +
city:
country:
zip:
neighborhood: "; + + print "
price: .00
date available:
preview description:
full description:
Type: "; + print " "; + + Print "
style:
beds:
baths:
number of floors:
square feet:
garage size:
heat:
annual prop tax:
Also on sales market:
Status:
featured:
mls:
virtual tour url:
Agent: $agent
Notes:
(Not visible to users)
"; + + //define features + print "Please mark whichever features apply:"; + + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print "
"; + print "HOME FEATURES"; + print ""; + print "COMMUNITY FEATURES"; + print "
"; +show_features(true, null, true, $table_prefix); + + print "
"; + + + print "

"; + print "

"; + print "

Once you add a listing, you may attach images.

"; + } + + else + //show all listings + { + $result = mysql_query("SELECT * FROM ".$table_prefix."homes WHERE owner = '$current_user'",$link); + + $num_rows = mysql_num_rows($result); + Print "
There are currently $num_rows properties listed.
"; + + + + + if ($cur_page == "") {$cur_page = 0;} + $page_num = $cur_page + 1; + $total_num_page = ceil($num_rows/$properties_per_page); + + print "
"; + nav_jump($cur_page, $total_num_page, $page_num, 'agentadmin.php', top); + + print "
"; + + $limit_str = "LIMIT ". $cur_page * $properties_per_page .",$properties_per_page"; + + $result = mysql_query("SELECT * FROM ".$table_prefix."homes WHERE owner = '$current_user' $limit_str",$link); + + while ($a_row =mysql_fetch_array ($result) ) + { + + //strip slashes so input appears correctly + $a_row[title] = stripslashes ($a_row[title]); + $a_row[address] = stripslashes($a_row[address]); + $a_row[city] = stripslashes($a_row[city]); + $a_row[previewdesc] = stripslashes($a_row[previewdesc]); + $a_row[fulldesc] = stripslashes($a_row[fulldesc]); + $a_row[neighborhood] = stripslashes($a_row[neighborhood]); + + print "

"; + print ""; + print ""; + print "
listing number: $a_row[id] modify listingdelete listing
"; + + + //select images connected to a given listing + $count = 0; + $query = "SELECT id_files,prop_num,owner,thumb,thumb_size,thumb_filetype FROM ".$table_prefix."tbl_Files WHERE prop_num = $a_row[id] LIMIT 1"; + $output = mysql_query("$query",$link); + while ($image_row =mysql_fetch_array ($output) ) + { + + echo "
"; + $count++; + + + } + print ""; + + if ($count == 0) + { + print ""; + } + + print "
$a_row[title]

$a_row[previewdesc]

Status:   $a_row[status]
Featured:  $a_row[featured]
\r\n\r\n"; + } + nav_jump($cur_page, $total_num_page, $page_num, 'agentadmin.php', bottom); + } + + //print the footer + print"\r\n\r\n"; + include("./templates/user_bottom.html"); + + //gots to close the mysql connection + mysql_close($link); +?> diff -uNr --strip-trailing-cr FR-2.8/common.php FR-2.8.3/common.php --- FR-2.8/common.php 2003-07-30 14:35:06.000000000 -0700 +++ FR-2.8.3/common.php 2003-08-13 14:37:28.000000000 -0700 @@ -1,11 +1,12 @@ 4.1 uses super globals. //Uncomment these if you have php <4.1 //This is needed for some functions to work properly //global $HTTP_SERVER_VARS['QUERY_STRING']; - //mysql database setup $table_prefix="demo"; $user = "demo_user"; diff -uNr --strip-trailing-cr FR-2.8/content/agent_feature.php FR-2.8.3/content/agent_feature.php --- FR-2.8/content/agent_feature.php 1969-12-31 17:00:00.000000000 -0700 +++ FR-2.8.3/content/agent_feature.php 2003-08-13 11:21:20.000000000 -0700 @@ -0,0 +1,15 @@ +"; +$query = "select * from ".$table_prefix."agents order by priority,id;"; +$result = mysql_query($query,$link); +while ($a_row = mysql_fetch_array($result)) + { + $image_query = "select * from ".$table_prefix."agent_tbl_Files where agentnum = '$a_row[id]';"; + $image_result = mysql_query("$image_query", $link); + while ($image_row = mysql_fetch_array($image_result)) + { + echo "
\"$a_row[agent]\"
"; + } + echo "$a_row[agent] $a_row[agenttitle]


"; + } +?> diff -uNr --strip-trailing-cr FR-2.8/content/featured.php FR-2.8.3/content/featured.php --- FR-2.8/content/featured.php 1969-12-31 17:00:00.000000000 -0700 +++ FR-2.8.3/content/featured.php 2003-08-13 11:21:20.000000000 -0700 @@ -0,0 +1,50 @@ + +
+ + +Featured Listings: + + +$a_row[title]
"; + //select images connected to a given listing + $query = "SELECT * FROM ".$table_prefix."tbl_Files WHERE prop_num = $a_row[id] LIMIT 1"; + $output = mysql_query("$query",$link); + $count = 0; + while ($image_row =mysql_fetch_array ($output) ) + { + print "\"Photo\"
"; + $count++; + } + if($count == 0) + { + print "\"View
"; + } + print "$a_row[beds] beds/$a_row[baths] baths
\$$a_row[price]

"; + } +//END OF EXAMPLE +?> +

+ + diff -uNr --strip-trailing-cr FR-2.8/content/main.php FR-2.8.3/content/main.php --- FR-2.8/content/main.php 1969-12-31 17:00:00.000000000 -0700 +++ FR-2.8.3/content/main.php 2003-08-13 14:34:40.000000000 -0700 @@ -0,0 +1,116 @@ +
+ Welcome to Free Realty 2.8.3 + This is a testing release, use it at your own risk. Please help with testing and submit bug + reports. +
+As of version 2.8.3 this content is now in a file named content/main.php. index.php is more of a template/framework than the file with everything in it. Note that there are also two other files here named agent_feature.php and featured.php. agent_feature.php is code to list all agents. featured.php is the code to list featured property on the index.php (or any other) page. +

+ +

+ Browse Listings | + Mailing List +

Free Realty web site +
If you use Free Realty please let us know so we can put you on the + live sites page. +
+

So easy, even a real estate agent can do it! +Free Realty, based on Jon Roig's original Open Realty +is a free, open source real estate listing manager. +Intended to be both easy to install and easy to administer, OpenRealty uses PHP to drive a mySQL backend, thus creating a tool which is +fast and flexible.

+

While the basic version of Free Realty can be downloaded for free, members may be available to customize it for your specific needs. Feel free to contact the mailing list for developers +



+If you are interested in upgrading an existing Free Realty v2.6 install please use the +upgradasaurus2.7.php file. Note: this will modify your database it is highly recommended that +you backup your database using mysqldump. This version allows multiple installs on the same +database using the $prefix_table variable set in common.php. +

+

Features:

+ +

Of course, Free Realty is written entirely in PHP, which makes it easy to customize and revise to match the look of your website.

+


+

Installation Instructions | +Mailing List
+

Version 2.7

+

+ 
+
+ +

+

+

Version 2.6 update (3-18-01):

+ + +

Version 2.5.1 update (2-28-01):

+SUMMARY OF BUGFIXES FOR THIS VERSION: + + +PLANNED FOR NEXT VERSION: + + + +

Version 2.5 update (2-20-01):

+SUMMARY OF BUGFIXES FOR THIS VERSION: + + + + +

+ + Binary files FR-2.8/includes/bgmc.jpg and FR-2.8.3/includes/bgmc.jpg differ diff -uNr --strip-trailing-cr FR-2.8/includes/thumbnail.php FR-2.8.3/includes/thumbnail.php --- FR-2.8/includes/thumbnail.php 2003-05-09 15:21:26.000000000 -0700 +++ FR-2.8.3/includes/thumbnail.php 2003-08-13 14:53:58.000000000 -0700 @@ -1,9 +1,13 @@ ='1' && $imagetype <='14' )) + { $thumbname = "thumb_$binFile_name" ; - $fpoint = fopen("/tmp/$thumbname", "w"); + $fpoint = fopen("/tmp/$thumbname", "w" ); $data = fread(fopen($binFile, "r"), filesize($binFile)); -// echo "$binFile"; -// echo "$data"; - fwrite($fpoint, $data); + $modify_size = $dest_width."x".$dest_height; + fwrite ($fpoint, $data); fclose($fpoint); -// echo `ls -lh /tmp`; - + exec("convert /tmp/$thumbname -resize $modify_size /tmp/$thumbname"); + } + +//End ImageMagick section +//Begin the NetPBM section + elseif ($image_style == 'np' && ($imagetype >= '1' && $imagetype <= '14')) + { + $thumbname = "thumb_$binFile_name" ; + $fpoint = fopen("/tmp/$thumbname", "w" ); + $data = fread(fopen($binFile, "r"), filesize($binFile)); + fwrite ($fpoint, $data); + fclose($fpoint); + //I know this can be done better with redirects, but this works. + exec("anytopnm /tmp/$thumbname | pnmscale -width=$dest_width >/tmp/temp_$thumbname "); + exec("pnmtojpeg /tmp/temp_$thumbname >/tmp/$thumbname "); + if (file_exists("/tmp/temp_$thumbname")) + { + unlink("/tmp/temp_$thumbname"); + } +// exec("anytopnm /tmp/$thumbname > /tmp/$thumbname "); + //Still working } + elseif ($image_style=='gd' && ($imagetype == '1' || $imagetype == '4' || $imagetype == '5' || $imagetype == '6' || $imagetype == '7' || $imagetype == '8' || $imagetype == '9' || $imagetype == '10' || $imagetype == '11' || $imagetype == '12' || $imagetype == '13' || $imagetype == '14')) + { + + $thumbname = "thumb_$binFile_name" ; + $fpoint = fopen("/tmp/$thumbname", "w"); + $data = fread(fopen($binFile, "r"), filesize($binFile)); + fwrite($fpoint, $data); + fclose($fpoint); + + } + else { //What are they trying to pull? + //This *should* be handled by the calling file. But if not, this defaults to an invalid type echo "This file does not appear to be a valid image file, I cannot convert it" ; $thumbname = "null"; $fpoint = fopen("/tmp/$thumbname", "w"); fclose($fpoint); } - } ?> diff -uNr --strip-trailing-cr FR-2.8/includes/thumbnail.php.orig FR-2.8.3/includes/thumbnail.php.orig --- FR-2.8/includes/thumbnail.php.orig 2003-04-17 09:47:02.000000000 -0700 +++ FR-2.8.3/includes/thumbnail.php.orig 1969-12-31 17:00:00.000000000 -0700 @@ -1,60 +0,0 @@ - $config[thumbnail_width]) - { - $shrinkage = $config[thumbnail_width]/$imagewidth; - } - $dest_height = $shrinkage * $imageheight; - $dest_width = $config[thumbnail_width]; - - // Now to specific image processing - if ($imagetype == '2') //Jpeg processing - { - $thumbname = "thumb_$binFile_name" ; - $src_img = imagecreatefromjpeg("$binFile"); - $dst_img = imagecreate($dest_width,$dest_height); - imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $dest_width,$dest_height, $imagewidth, $imageheight); - imagejpeg($dst_img,"/tmp/$thumbname",$quality); - imagedestroy($src_img); - imagedestroy($dst_img); - return $thumb; - - } - - - elseif ($imagetype == '3') - { - - $thumbname = "thumb_$binFile_name" ; - $src_img = imagecreatefrompng("$binFile"); - $dst_img = imagecreate($dest_width,$dest_height); - imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $dest_width,$dest_height, $imagewidth, $imageheight); - imagepng($dst_img,"/tmp/$thumbname",$quality); - imagedestroy($src_img); - imagedestroy($dst_img); - - } - - - - - } - -?> diff -uNr --strip-trailing-cr FR-2.8/index.php FR-2.8.3/index.php --- FR-2.8/index.php 2003-07-29 20:27:10.000000000 -0700 +++ FR-2.8.3/index.php 2003-08-13 11:21:20.000000000 -0700 @@ -9,185 +9,24 @@ -
- - -
- - -Featured Listings: - - -"; - print "$a_row[title]
"; - //select images connected to a given listing - $query = "SELECT * FROM ".$table_prefix."tbl_Files WHERE prop_num = $a_row[id] LIMIT 1"; - $output = mysql_query("$query",$link); - - - $count = 0; - while ($image_row =mysql_fetch_array ($output) ) - { - - - print "\"Photo\"
"; - $count++; - } - - - if ($count == 0) - { - print "\"View
"; - } - - - print "$a_row[beds] beds/$a_row[baths] baths
"; - print "\$$a_row[price]
"; - print "

"; - - - - } -//END OF EXAMPLE + -

-
- - -
-Welcome to Free Realty 2.7 prerelease 7.2, a minor number release -This is a testing release, use it at your own risk. Please help with testing and submit bug reports. -
- -

- -

Browse Listings | Mailing List -
-
Free Realty web site -
If you use Free Realty please let us know so we can put you on the live sites page. -
-

So easy, even a real estate agent can do it! Free Realty, based on Jon Roig's original -Open Realty is a free, open source real estate listing manager. -Intended to be both easy to install and easy to administer, OpenRealty uses PHP to drive a mySQL backend, thus creating a tool which is -fast and flexible.

-

While the basic version of Free Realty can be downloaded for free, members may be available to customize it for your -specific needs. Feel free to contact the mailing list for developers

-
-
-If you are interested in upgrading an existing Free Realty v2.6 install please use the upgradasaurus2.7.php file. Note: this will modify your database it is highly recommended that you backup your database using mysqldump. This version allows multiple installs on the same database using the $prefix_table variable set in common.php. -

- - - -

Features:

-
    -
  • Allows visitors to look through your real estate listings 24 hours a day, 7 days a week, 365.25 days a year. -
  • Easily keep your property listings updated -- no HTML coding required to add, delete, or modify listings. -
  • Built-in image manager -- upload photos via your web browser, either when creating new listings or modifying an existing one. If photos are not uploaded for a property, a "photo not available" image will be automatically displayed for the listing. -
  • Automagically interfaces with Yahoo Maps -- potential customers will always know exactly where to find your property. -
  • MySQL database backend -- free and fast, mySQL is standard with most hosting plans. -
  • Secure -- no one but you can change your listings. -
  • Viral Marketing -- visitors can email listings to their friends right from OpenRealty. -
  • Easy to install -- just edit a single configuration file. -
  • Showcase specific properties -- built-in featured listing manager allows you to place special offerings right on your front page. -
  • Flexible search -- browse properties according to whatever criteria you like. -
  • Easy setup -- configurator tool makes Free Realty easy to install. -
-

Of course, Free Realty is written entirely in PHP, which makes it easy to customize and revise to match the look of your website.

-


-

Installation Instructions | Mailing List
-

Version 2.7

-

 
- 		
- - + -

-

-

Version 2.6 update (3-18-01):

-
    -
  • Changed the authentication scheme. Should now be compatible with a variety of servers, including IIS and NT-based machines. -
  • Like version 2.5x, this is not a major upgrade -- no need to do anything if you're happy with the last version -
  • Users of version 2.5x shouldn't need to do anything to do the database if they do want to upgrade. -
- -

Version 2.5.1 update (2-28-01):

- SUMMARY OF BUGFIXES FOR THIS VERSION: -
    -
  • Not a major upgrade -- no need to do anything if you're happy with the last version -
  • Numerous minor tweaks in the agent admin interface and interface improvements -
  • Moved the size of uploads to the common.php file -
  • Added ability to sort searches... might get an upgrade in the future... - -
- - PLANNED FOR NEXT VERSION: -
    -
  • Reworking of code to make it easier to modify and extend OpenRealty in the future -
  • I'm investigating the use of auto-thumbnailing capabilities in PHP, but am not sure if that'll go in the next version. -
  • ???? Let me know what you're looking for - -
- - -

Version 2.5 update (2-20-01):

- SUMMARY OF BUGFIXES FOR THIS VERSION: -
    -
  • Completely new, database-driven image management system -
  • Ability to handle several agents at once and an admin mode to -
  • Improved interface -
  • Template-driven HTML pages -
  • More feature fields -- including square footage and property size -
- -
    -
  • Closed mySQL connections at the end of every page. This seems important for scalablilty. -
  • Change of 'localhost' to a variable defined in the common.php file.(Way more flexible. Default will still be localhost. -
  • Addition of limits to how many pictures a property can have or an agent can post. Defined in the common.php shared file. -
  • Ability to recognize returns in the comment fields -- so, the agent won't have to worry about an HTML at all. -
  • New image management solves all the jpg/png/gif problems. -
  • The code strips out decimal points when searching by price. Interface changes to help control user input. -
  • Select listing for Washington, DC in 'states' list -
  • Stashed admin tools in their own directory -
  • Lots of little bug fixes and corrections -
- - -

-

- \r\n"; diff -uNr --strip-trailing-cr FR-2.8/openrealty_readme.html FR-2.8.3/openrealty_readme.html --- FR-2.8/openrealty_readme.html 2003-06-03 22:28:14.000000000 -0700 +++ FR-2.8.3/openrealty_readme.html 2003-08-13 14:43:06.000000000 -0700 @@ -27,13 +27,19 @@ Please post all comments, questions, etc... to the mailing list and we will respond as quickly as possible. Also, you might try reading through the posts -- your question may be answered already.


- USING AND INSTALLING OPENREALTY:

- 1. Download OpenRealty. Unzip the file.
- 2. Create a new folder on your server.
- 3. Configure and set parameters (explained below).
- 4. Upload the contents of the zip file to your server.
- 5. Create and configure your mySQL tables (also explained below).
- 6. That's it!
+

    USING AND INSTALLING OPENREALTY: +
  1. Download OpenRealty. Unzip the file. +
  2. Create a new folder on your server. +
  3. Configure and set parameters (explained below). +
  4. Upload the contents of the zip file to your server. +
  5. Create and configure your mySQL tables (also explained below). +
    • Highly recommended +
    • Remove configurator.sql, configurator.php, upgradeasaurus.php, + upgradeasaurus2.7.php, phpinfo.php, convert.php, convert.sql from the + admin folder. +
    +
  6. That's it! +


REQUIRED TO RUN OPENREALTY:
diff -uNr --strip-trailing-cr FR-2.8/propview.php FR-2.8.3/propview.php --- FR-2.8/propview.php 2003-07-30 14:30:14.000000000 -0700 +++ FR-2.8.3/propview.php 2003-08-13 11:21:20.000000000 -0700 @@ -171,7 +171,7 @@ //is there an image? //select images connected to a given listing $count = 0; - $query = "SELECT filename,id_files,thumb,thumb_size,thumb_filetype FROM ".$table_prefix."tbl_Files WHERE prop_num = $query_data[id]"; + $query = "SELECT filename,id_files,thumb,thumb_size,thumb_filetype,description FROM ".$table_prefix."tbl_Files WHERE prop_num = $query_data[id]"; $result = mysql_query("$query",$link); while ($image_row =mysql_fetch_array ($result) ) {