LATEST VERSION:
http://jonroig.com/freecode/openautoclassifieds/
PLEASE READ THIS ENTIRE FILE BEFORE INSTALLING OPENAUTOCLASSIFIEDS
(Thus, you will avoid my wrath when you ask a question answered in this FAQ)
SUPPORT AND NEWS:
http://jonroig.com/freecode/openrealty/bbs/bbbb.php3
I DO NOT HAVE TIME TO ANSWER QUESTIONS VIA EMAIL!
Please post all comments, questions, etc... to the message board and I will respond as quickly as possible. Also, you might try reading through the posts -- your question may be answered already.
USING AND INSTALLING OPENAUTOCLASIFIEDS:
1. Download OpenAutoClassifieds. 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!
REQUIRED TO RUN OPENAUTOCLASIFIEDS:
1. MySQL
2. PHP 4.0 (If you're curious about what version you have, run the phpinfo.php script which comes with this release)
3. Apache Web Server for Linux (Others may be possible, but have not been tested)
AN EXPLANATION OF EACH FILE AND WHAT IT DOES:
logout.php -- this is ends your session, so you can log in as another user. Handy for troubleshooting problems.
emailpass.php -- if a user puts in the wrong password, they need their password sent to their email address
carview.php -- the main vehicle viewing script. views both multiple listings and single listings
accountedit.php -- allows users to edit their own accounts
common.php -- shared file that hosts many of the global settings
addagent.php -- allow users to add agent listings
agentadmin.php -- allow users to administer their listings
agent_image.php -- pulls the image of an agent out of the database
browse.php -- sets up the various ways to search the database
agentdisplay.php -- displays information about a given agent
friendmail.php -- allows users to email information about a listing to a friend
image.php -- pulls an image of the house out of the database
index.php -- the main index page. includes a sample of how to integrate featured listings
openautoclassifieds_readme.html -- this file.
admin/admin.php -- the main administrator tool. allows a single user to edit all properties
admin/agenteditor.php -- allows the main administrator access to all agent data
admin/configurator.php -- the main setup tool. should automatically set up openrealty
admin/upgradasaurus.php -- upgrades an older version of openrealty up to the newest
admin/phpinfo.php -- when in doubt, run phpinfo.php to reveal details about your system and setup
images/nophoto.gif -- the example "no photo available" image
templates/user_bottom.html -- bottom part of the sample template
templates/user_top.html -- top part of the sample template
CONFIGURING THE FILES:
(you're on your own if you want to change aesthetic elements)
File: What to change:
There is only one file that needs to be modified:
common.php:
------------------------------------------------------
//common include file
//mysql database setup
$user = "database_user";
$password = "database_password";
$db = "openautoclassifieds";
$server = "localhost";
//OPENREALTY ADMIN PASS AND LOGIN
//DEFAULTS TO MYSQL DATABASE USER/PASS
$openadmin = "$user";
$openpassword = "$password";
//SITE INFORMATION
//use city and state? 'Y' or 'N'
global $use_city_state;
$use_city_state = "Y";
//used mostly for the email a friend function...
//but may come in handy elsewhere.
$baseurl = "http://www.yoursite.com";
$yourname = "Your Name";
$youremail = "you@youremail address";
//number of listings to list at once:
$listings_per_page = 10;
//AGENT ADMINISTRATION
//use linefeed in description fields 'Y' or 'N'
$linefeeds = "Y";
//maximum number of imges for a given agent
$max_agent_images =1;
//how large can an agent image be? (n bytes)
$max_agent_upload = 1000000;
//INDIVIDUAL VEHICLE LISTING OPTIONS
//use email-a-friend option? 'Y' or 'N'
$friendmail = "Y";
//maximum numer of images for one vehicle
$max_images = 6;
//max size of vehicle images (in bytes)
$max_prop_upload = 1000000;
//available options for vehicles
//each option separated by a ||
//currently supports up to 10 options
$vehiclefeatureoptions = "Cruise Control||Air Conditioning||Power Steering||Power Brakes||Power Windows||Power Locks||Power Seats||Security Remote";
//the master list of states
$stateslist = "Alabama||Alaska||Arizona||Arkansas||California||Colorado||Connecticut||Delaware||District of Columbia||Florida||Georgia||Hawaii||Idaho||Illinois||Indiana||Iowa||Kansas||Kentucky||Louisiana||Maine||Maryland||Massachusetts||Michigan||Minnesota||Mississippi||Missouri||Montana||Nebraska||Nevada||New Hampshire||New Jersey||New Mexico||New York||North Carolina||North Dakota||Ohio||Oklahoma||Oregon||Pennsylvania||Rhode Island||South Carolina||South Dakota||Tennessee||Texas||Utah||Vermont||Virginia||Washington||West Virginia||Wisconsin||Wyoming";
//the master list of car types
$cartypeslist = "Sports||Sedan||4x4||SUV||Family||Van||Truck||Pickup||Motorcycle||Station Wagon";
//the master list of car makes
$carmakeslist = "Acura||Alfa Romeo||Audi||BMW||Bentley||Buick||Cadillac||Chevrolet||Chrysler||Daewoo||Daihatsu||Daimler||Datsun||DeLorean||DeSoto||Dodge||Eagle||Ferrari||Fiat||Ford||Geo||Honda||Hyundai||Infiniti||Isuzu||Jaguar||Jeep||Kia||Lamborghini||Lexus||Lincoln||Lotus||MG||Maserati||Mazda||Mercedes-Benz||Mercury||Mitsubishi||Nissan||Oldsmobile||Plymouth||Pontiac||Porsche||Renault||Rolls Royce||Saab||Saturn||Singer||Sterling||Studebaker||Subaru||Suzuki||Toyota||Triumph||Volkswagen||Volvo||Yugo||-----||Other";
------------------------------------------------------
CONFIGURING THE DATABASE:
(If you're looking for a true primer on mySQL, this probably isn't the place)
1. Create the database using this mySQL command from within the mySQL command line interface:
CREATE DATABASE realestate_db;
... this was impossible to automate, as some hosting services restrict the naming of databases.
2. Make sure your common.php file is configured correctly (as defined above)
3. Run the configurator by going to http://yoururl.com/configurator.php
It should take care of all the configuration for you, and create a sample listing.
if not, you can do this by hand by typing "mysql realestate_db < ./admin/configurator.sql" (without the quotes, of course). It is highly recommended that you remove configurator.php, configurator.sql, and upgradasaurus.php from your site when not in use.
Also, sometimes, if you're using a program like phpMyAdmin, you need to add the lines one at a time... sometimes with a ; after each line as well. Play around with it...
FREQUENTLY ASKED QUESTIONS:
* I'm alose running OpenRealty. Can I the two programs share user databases?
Absolutely. You've gotta do it by hand, but just add the vehicles table to whatever database you're using for OpenRealty. They can share images, agents, etc...
* Where can I go for help with this?
Drop by our discussion forums at http://jonroig.com/freecode/openrealty/bbs/bbbb.php3 for help with any issues. I also post new developments there. As I work quite a bit at a fulltime job, please DO NOT email me with questions -- I will not have time to answer them.
* Can you redesign this program to work as a general classifieds ads program?
I get this one a lot. Over the long run, that might be a plan... but I've seen a lot of inexperienced programmers use this script as a base for all kinds of odd things -- it's actually pretty cool. If you get stuck, just post on the message board and I'm sure someone will help you. 'Course, if you do come up with something interesting, it'd be cool if you'd contribute your work to the opensource community and release it under the GPL.
* Is this program really free?
It sure is. I started by building a RealEstate listings program (http://jonroig.com/freecode/openrealty/) and ended up with a much more popular program than I'd anticipated. It's become a calling card, of sorts...
* Are you planning further revisions on this program?
I am currently planning to do one further revision on this to convert the code over to Object Oriented Programming standards. Users of the most current version won't notice any difference, I'm just going to make the code a bit prettier.
* Is it possible to add more than one picture to a listing?
Yes! You can put HTML into your preview description and full description. Just link to images from there like you'd link to any other images.
* There are a whole bunch of fields I don't care about --. can I get rid of them?
If you leave those fields blank, no information will appear. As a user, you'd never know they were even there. Play around with it to see how it works.
* I want to customize OpenAutoListings -- what advice do you have?
Make a copy first. I've tried to make OpenAutoListings really easy to play with, if you're so inclined. 'Course, I am also available to do various types of custom coding as well, so if you need those kinds of services, send me email. That said, if you're familiar with HTML, take a shot at customizing it yourself. I've documented a big chunk of the code, so it shouldn't be too hard to figure out what various pieces do. Although several people have suggested that I integrate some kind of template system into OpenAutoListings, I decided against this. The user really only sees a handful of actual pages, so it seemed kind of silly. In browse.php and propview.php, I've marked the placement of the header and footer parts of the HTML. Happy hacking!
* No offense, but I don't like your browse.php page. How can I link to specific queries within the database?
None taken. Feel free to experiment with code you appropriate from that page -- it's there as an example. Here are some cut and paste examples of how to structure searches:
* I have multiple agents running on one computer. How do I logout?
Just add a link in your template to logout.php. That should close out the session...
* Is there a version that works with PHP3?
NO! UPGRADE TO THE NEW VERSION!!!! AGGGGGHHHHHGGHGH (sorry -- I get this question constantly.) It's not like PHP4 is new or anything, and it's not like it's not a stable program.
SQL COMMANDS FOR BUILDING THE REQUIRED TABLES:
use these if you have trouble with the configurator:
------------------------------------------------------
CREATE TABLE agent_tbl_Files (id_files tinyint(3) unsigned NOT NULL auto_increment, bin_data longblob NOT NULL,description tinytext NOT NULL,filename varchar(50) NOT NULL,filesize varchar(50) NOT NULL,filetype varchar(50) NOT NULL,agentnum int(11) DEFAULT '0' NOT NULL,owner int(11) DEFAULT '0' NOT NULL,PRIMARY KEY (id_files));
CREATE TABLE agents (id int(11) NOT NULL auto_increment,agent varchar(30),agentpass varchar(10),agenturl varchar(70),agentemail varchar(70),notes text NOT NULL,agentphone varchar(30) NOT NULL,agentcell varchar(30) NOT NULL,agentfax varchar(30) NOT NULL,PRIMARY KEY (id));
CREATE TABLE tbl_Files (id_files tinyint(3) unsigned NOT NULL auto_increment,bin_data longblob NOT NULL,description tinytext NOT NULL,filename varchar(50) NOT NULL,filesize varchar(50) NOT NULL,filetype varchar(50) NOT NULL,owner varchar(30) NOT NULL,prop_num int(11) DEFAULT '0' NOT NULL,PRIMARY KEY (id_files));
CREATE TABLE vehicles (id int(11) NOT NULL auto_increment,title varchar(250),city varchar(50),state varchar(20),zip varchar(20),price int(11),fulldesc text NOT NULL,type varchar(20),featured char(1),dateposted date,agent varchar(30), notes mediumtext NOT NULL,owner int(11) DEFAULT '0' NOT NULL,model varchar(30) NOT NULL, make varchar(30) NOT NULL,year year(4) DEFAULT '0000' NOT NULL,drivetrain varchar(30) NOT NULL,transmission varchar(30) NOT NULL,body varchar(30) NOT NULL,doors int(11) DEFAULT '0' NOT NULL,features text NOT NULL,stereo varchar(30) NOT NULL,color varchar(30) NOT NULL,miles int(11) DEFAULT '0' NOT NULL,opt1 char(1) DEFAULT 'N' NOT NULL,opt2 char(1) DEFAULT 'N' NOT NULL,opt3 char(1) DEFAULT 'N' NOT NULL,opt4 char(1) DEFAULT 'N' NOT NULL,opt5 char(1) DEFAULT 'N' NOT NULL,opt6 char(1) DEFAULT 'N' NOT NULL,opt7 char(1) DEFAULT 'N' NOT NULL,opt8 char(1) DEFAULT 'N' NOT NULL,opt9 char(1) DEFAULT 'N' NOT NULL,opt10 char(1) DEFAULT 'N' NOT NULL,PRIMARY KEY (id));
------------------------------------------------------