Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Real Estate Website

0.00/5 (No votes)
20 Apr 2005 1  
Complete ready to run real estate agent, or for-sale-by-owner website.

Sample Image - home.gif

Introduction

A FREE complete real estate agent, or for sale by owner website.

The complete code download is available at

Real Estate Website (http://www.real-estate-website.org/)

or from http://sourceforge.net/projects/real-estate-web/

Summary

 Completely web-based administration, set site colors, titles and layout all from the administrator login. Includes user signup, listing creation, printable listing format, image uploads with automatic thumbnail creation, user management, and site statistics. Create, edit, and update pages to the site with a WYSIWYG editor. Includes a mortgage calculator with Amortization table. Users can also sign up automatically to create their own listings if you wish to set Real-Estate-Website up as a for-sale-by-owner site. All code is free and open-source released under the GPL.

Details

Real Estate Website uses ASP (Active Server Pages) and Microsoft MS Access database. The package has many features, and requires the following components to run properly.

  • IIS 5 or higher
  • ASP 3.0 or higher
  • ASP Mail by Server Objects
  • ASP Image by Server Objects
  • Persits Upload
  • Read/Write/Delete permission on 1 folder
  • Database located outside of the web root (highly recommended)

Once the files are copied to your website, you then login with the default username and password. You will see a screen like the one below.

Real Estate Website Main Settings

From this screen you can setup your site's main settings. The homepage text, the site colors, url, title, mail server, support email, site font, etc. These settings allow you to customize the look and feel of the site to make it distinct. Many of these changes are made using one "command" file, which I thought made things simpler.

ID = Request("ID")
response.write "ID = " & id & "
"
homepage_text = PreSubmit(request.form("homepage_text")) site_color = PreSubmit2(request.form("site_color")) site_title = PreSubmit2(request.form("site_title")) site_title_color = PreSubmit2(request.form("site_title_color")) site_font = PreSubmit2(request.form("site_font")) email_server = PreSubmit2(request.form("email_server")) support_email = PreSubmit2(request.form("support_email")) site_slogan = PreSubmit2(request.form("site_slogan")) site_slogan_color = PreSubmit2(request.form("site_slogan_color")) site_url = PreSubmit2(request.form("site_url")) site_keywords = PreSubmit2(request.form("site_keywords")) 'user settings useractive = request.querystring("useractive") isadmin = request.querystring("isadmin") 'Clear hits data clearhits = request.querystring("clearhits") 'city addcity = PreSubmit2(request.form("addcity")) city = PreSubmit2(request.form("city")) cityactive = PreSubmit2(request.querystring("cityactive")) cityid = PreSubmit2(request.querystring("cityid")) 'editing city cid = PreSubmit2(request.form("cid")) editcity = request.form("editcity") 'delete city deletecity = request.querystring("deletecity") 'clearhits if clearhits <> "" then mySQL = "DELETE FROM accesslog1;" whtConn.execute(mySQL) redirect = "hits.asp?message=cleared" end if 'set homepage text if homepage_text <> "" then mySQL = "UPDATE tblSettings SET homepage_text = '" & homepage_text & "' WHERE ID = " & id & ";" whtConn.execute(mySQL) redirect = "settings.asp" end if if site_url <> "" then mySQL = "UPDATE tblSettings SET site_url = '" & site_url & "' WHERE ID = " & id & ";" whtConn.execute(mySQL) redirect = "settings.asp" end if '*****colors and fonts if site_font <> "" then mySQL = "UPDATE tblSettings SET site_font = '" & site_font & "' WHERE ID = " & id & ";" whtConn.execute(mySQL) redirect = "settings.asp" end if
...continues

Can also set a limit on the number of images a user can upload:

filepath = server.mappath("\userfiles\" & LoginID)
Set myFso = Server.CreateObject("Scripting.FileSystemObject")
Set Myfolder = Myfso.GetFolder(filepath & "\imagelist")
Dim imagecount, allowedimages, uploadlimit
imagecount = 0
For Each myFile in MyFolder.Files
	imagecount = imagecount + 1
Next
Set myFso = Nothing
Set myFolder = Nothing
allowedimages = session("imagecount")
if imagecount >= allowedimages then
	uploadlimit = 1
end if

Very important step is to change the default password and email address to your own.

Real Estate Website Change Password

Now that your main site settings are complete, and you've changed the password and email, time to setup what cities are available. On the main menu click on City List.

Real Estate Website Admin Login

This screen lets you add, edit, or disable/enable cities on the site.

Real Estate Website Edit City

Now you can also add any additional pages to the site, these can be added, edited, deleted, activated/de-activated, and ordered from the web-based interface.

Real Estate Website Site Pages

Edit the pages

Real Estate Website Edit Pages

 Add Home Listings

Now you are ready to begin adding homes-to-sell to the real estate website.

1. Upload Images

Real Estate Website Images

Uploaded images are automatically resized to proper sizes (can't be to big) and a thumbnail size images is also automatically created also. Here is a sample of the automaic resizing, while keeping aspect ratio, this took me a little bit to get just right. (using rusty math skills I try to avoid)

Set Image = Server.CreateObject("AspImage.Image")
Image.AutoSize = false
Set FSO = Server.CreateObject("Scripting.FileSystemObject")
Image.LoadImage userimage2

Set FSO = Nothing

  intXsizeMain = Image.MaxX
  intYsizeMain = Image.MaxY

if intYsizeMain > 300 then
	  targetY = 300
	  findsize1 = intYsizeMain - targetY
	  findsize2 = findsize1 / intYsizeMain
	  findsize3 = (1 - findsize2)
	  intXSizeNew = (intXsizeMain * findsize3) 
	  Image.ResizeR intXSizeNew, targetY

	Image.FileName = userimage2
	Image.SaveImage
end if
Set Image = nothing

2. You can also do some simple image editing online.

Real Estate Website Edit Images

3. Now visit the Home Setup Screen to start creating your first home listing.

Real Estate Website Home Setup

From this screen you can describe the house, and choose what common options it may have, you also choose your images here.

Real Estate Webiste Edit Home Listing

Finished home listing

The thumbnails appear on the right side, the full size image is pre-loaded when the page loads, when you click on the the image is replaces the main image on the page, so it's very easy to browse quickly through all the pictures.

Once your home is up, you can then watch and see how many users visit the page with the User Hits section of the website.

Logging of user hits:

	Dim logRS, remote_addr
	'Open Recordset

	remote_addr = Request.ServerVariables("Remote_Addr")

	'place your IP here if you do not want to log hits from it.
	if remote_addr <> "192.168.1.1" then

		Set logrs = Server.CreateObject("ADODB.RecordSet")
		logRS.Open "AccessLog1", whtConn, 1, 3

		'run update
		logRS.AddNew

		logRS("logQuery_String")= Request.queryString("hID")
		logRS("logRemote_Addr")= remote_addr
		logRS("logForm_String")= Request.form("hID")

		'update and close record
		logRS.Update
		logRS.Close
		Set logRS = Nothing

	end if

Real Estate Website User Hits

The site includes many more features.

  • Print format function for the home listing, for printable brochures
  • User Signup function, if you set this up as a for-sale-by-owner site, users can signup and begin listing their own home within minutes, includes an email verification, and "forgot password" reset email function.
  • Contact form, so you can be contacted directly from a form on the website.
  • Mortgage ammoritization calculator

The complete code download is available at

Real Estate Website (http://www.real-estate-website.org)

 

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here