65.9K
CodeProject 正在变化。 阅读更多。
Home

房地产网站

starIconstarIcon
emptyStarIcon
starIcon
emptyStarIconemptyStarIcon

2.54/5 (21投票s)

2004年4月15日

3分钟阅读

viewsIcon

197654

完整的、可运行的房地产经纪人或业主自售网站。

Sample Image - home.gif

引言

一个免费的完整的房地产经纪人或业主自售网站。

完整的代码下载可在以下地址获得:

房地产网站 (http://www.real-estate-website.org/)

或从 http://sourceforge.net/projects/real-estate-web/

摘要

完全基于 Web 的管理,从管理员登录设置站点颜色、标题和布局。包括用户注册、房源创建、可打印的房源格式、带自动缩略图创建的图像上传、用户管理和站点统计。使用 WYSIWYG 编辑器创建、编辑和更新网站页面。包括一个带有摊销表的抵押贷款计算器。如果您希望将房地产网站设置为业主自售网站,用户还可以自动注册以创建自己的房源。所有代码都是免费的开源,根据 GPL 协议发布。

详细说明

房地产网站 使用 ASP (Active Server Pages) 和 Microsoft MS Access 数据库。该软件包具有许多功能,需要以下组件才能正常运行。

  • IIS 5 或更高版本
  • ASP 3.0 或更高版本
  • Server Objects 的 ASP Mail
  • Server Objects 的 ASP Image
  • Persits 上传
  • 对 1 个文件夹的读/写/删除权限
  • 数据库位于 Web 根目录之外(强烈推荐)

将文件复制到您的网站后,您可以使用默认用户名和密码登录。您将看到如下所示的屏幕。

Real Estate Website Main Settings

从这个屏幕上,您可以设置您网站的主要设置。主页文本、站点颜色、网址、标题、邮件服务器、支持电子邮件、站点字体等。这些设置允许您自定义网站的外观和感觉,使其与众不同。许多这些更改都是使用一个“命令”文件完成的,我认为这使事情更简单。

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
...继续

还可以设置用户可以上传的图像数量的限制

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

非常重要的一步是将默认密码和电子邮件地址更改为您的。

Real Estate Website Change Password

现在您的主要站点设置已完成,并且您已更改密码和电子邮件,是时候设置可用的城市了。在主菜单上点击“城市列表”。

Real Estate Website Admin Login

此屏幕允许您在站点上添加、编辑或禁用/启用城市。

Real Estate Website Edit City

现在,您还可以向站点添加任何其他页面,这些页面可以通过基于 Web 的界面添加、编辑、删除、激活/停用和排序。

Real Estate Website Site Pages

编辑页面

Real Estate Website Edit Pages

添加房屋列表

现在您可以开始向 房地产网站 添加待售房屋了。

1. 上传图片

Real Estate Website Images

上传的图像会自动调整为适当的大小(不能太大),并且还会自动创建缩略图图像。这是自动调整大小的示例,同时保持纵横比,这花了我一点时间才弄好。(使用我试图避免的生疏的数学技能)

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. 您还可以在线进行一些简单的图像编辑。

Real Estate Website Edit Images

3. 现在访问“房屋设置”屏幕以开始创建您的第一个房屋列表。

Real Estate Website Home Setup

从这个屏幕上,您可以描述房屋,并选择它可能具有的常见选项,您也可以在这里选择您的图像。

Real Estate Webiste Edit Home Listing

已完成的房屋列表

缩略图显示在右侧,全尺寸图像在页面加载时预加载,当您单击图像时,它会替换页面上的主图像,因此非常容易快速浏览所有图片。

一旦您的房屋上线,您就可以通过网站的“用户点击”部分观看并查看有多少用户访问了该页面。

用户点击记录

	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

该网站还包括更多功能。

  • 房屋列表的打印格式功能,用于可打印的小册子
  • 用户注册功能,如果您将其设置为业主自售网站,用户可以在几分钟内注册并开始列出自己的房屋,包括电子邮件验证和“忘记密码”重置电子邮件功能。
  • 联系表单,因此您可以直接通过网站上的表单联系。
  • 抵押贷款摊销计算器

完整的代码下载可在以下地址获得:

房地产网站 (http://www.real-estate-website.org)

 

© . All rights reserved.