You are on page 1of 16

Web: http://www.phpmyrealty.com/guide.

html#11

Users' Guide and Documentation


Thank you for choosing phpMyRealty, the number one solution for PHP/MySQL real estate software. Please read the following guide carefully to understand the basics of performing your first installation and managing your new web site. Please note: This guide is for version 3.2.x+

Contents
I. Script Installation and Post Installation Tasks 1. Installation a. Requirements b. Installation 2. Post Installation Tasks a. Languages b. Templates c. Web Configuration Panel II. Administrator's Guide 1. Managing Administrators a. Adding/Editing/Removing Administrators b. Setting Administrator's Permissions 2. System Configuration a. Web Configuration Panel b. Ban e-mails 3. Managing Types, Locations etc. 4. Managing Agents / Users a. Approving New/Updated Agents

b. Adding New Agent c. Updating / Removing Agent 5. Managing Listings a. Approving New/Updated Listings b. Adding New Listing c. Updating / Removing Listing d. Photo Gallery Management e. Featured Listings f. Featured Agents g. 2checkout Account Configuration

I. Script Installation and Post Installation Tasks. 1. Installation. a. Requirements.


PMR was written to use the PHP server-side scripting language powered by a MySQL database backend. These are multiplatform applications and this makes PMR a multiplatform web application too. It can run on UNIX or Windows servers. The main requirements to operate PMR can be reviewed on the Product Requirements page.

b. Installation.
First you will need to UNZIP the package you received via email after purchasing. Then upload the files to your webserver, you will need an FTP client application to do that. Transfer php scripts as text and images as binary files (most of the modern clients process the file types automatically). Please note that encoded files located in the /includes/functions/Zend/ or /includes/functions/ionCube folder must be uploaded in BINARY mode. The files to upload in BINARY mode are:

auth.php packages.php graph.php zip.php

If these files are not uploaded in BINARY mode, you will receive an error about corruption, 0 bytes loaded, or something similar along with "zip.php" being referenced in the error. After you have the files and folders uploaded you need to change some folder permissions. These are: /banners /gallery /images

/photos /upload /video Please, change permissions to chmod 755 or rwxr-xr-x, this will allow the php user to read/write these folders. Usually there is no need to change the permissions on the windows hosting. In some cases you may need to chmod 777, use this if the script can not upload images or video files. After you have the above things done you need to edit the main configuration file config.php which is located in the script root folder. It includes the most important script configuration settings which can not be controlled via web based configuration panel for the security purposes. Once the software has been unzipped and uploaded, it is now time to edit the config.php file located in the root directory. Directions are included in the config.php file. You must follow the steps located in the file, including entering in your license key, domain name, installation directory, mail settings, PATH information, etc. There are also optional values included in the config.php file for added flexibility. < br/> Now you can run the script, just open the URL you set in config.php in your browser. If no errors reported you can press the Administrator link and login to your super administrator account using login: admin, password: admin. When in admin you can change your super administrator password and change the configuration of the script using the Web Configuration Panel. The other thing to edit in the Configuration Panel is your Google Maps Key, you can obtain it from here: http://www.google.com/apis/maps/signup.html Actually this is all you need to do to install and run the script for the first time. If you do the UPGRADE from the previous versions please, make sure to backup your scripts and database before doing anything, this is the most important - not to lose your data. The upgrade instructions are usually provided with the upgrading package.

2. Post Installation Tasks


After you have installed the PMR script onto your server you can customize it to suit your needs. PMR is a multi-template and multi-language script this means each visitor can select the language or template he/she wants to use and it will be remembered in the user cookies or session variables to be used during next visits to your website.

a. Languages.
Language files are stored in the /languages directory. These are simple php files which include a lot of variables. They are easy to edit, just some amateur knowledge of php syntax is required. If you want to add more languages for the users to choose from just create files based on the default one (english.lng.php) and name them like language.lng.php where

"language" is a the name of the language. The other important thing when creating language files is a file codepage you used while created them, so make sure to edit texts in the codepage you are about to use with this language. It is important to use one and the same codepage for all the language files you use, so we recommend UTF-8 as the default codepage. You must also add the new language to the settings.php file located in the /languages directory. An example is below. Let's say you wish to add "Chinese" as a language to the software. You would change: $installed_languages = array( 'english' => 'name', 'french' => 'name2', 'german' => 'name3', 'italian' => 'name4', 'russian' => 'name5', 'spanish' => 'name6', 'bulgarian' => 'name7', 'croatian' => 'name8', 'georgian' => 'name9', 'greek' => 'name10', 'portuguese' => 'name11', 'svenska' => 'name12', 'vietnamese' => 'name13' );

to: $installed_languages = array( 'english' => 'name', 'french' => 'name2', 'german' => 'name3', 'italian' => 'name4', 'russian' => 'name5', 'spanish' => 'name6', 'bulgarian' => 'name7', 'croatian' => 'name8', 'georgian' => 'name9', 'greek' => 'name10', 'portuguese' => 'name11', 'svenska' => 'name12', 'vietnamese' => 'name13', 'chinese' => 'name14' ); Please notice there is no comma for the very last language in the list. If you want for 'chinese'

to be the first language (the default language), then you'd place it at the top where english is now and set chinese as your default language in the administration panel under configuration options. Below are some of the most important areas that you will want to edit for different languages to account for cultural variations: // phpMyRealty codepage $lang['Encoding'] = 'utf-8'; // Text Direction $lang['Direction'] = 'ltr'; // Date Format // Please, use "m" for month, "d" for day and "y" for year and // delimit it with "-" $lang['Date_Format'] = 'm-d-y'; The above variables control the codepage which is going to be used with this language, text direction and the date format used for this region.

b. Templates.
PMR allows several templates to be used on one site so users can select the template they want. Templates are stored in the /templates folder as folders. Lets see the /default template a default one. PMR templates usually include the following files:

header.php - a general header file for all the pages, it includes all the required meta tags, css and JavaScripts which have to be duplicated into all the new templates. This is a good example of how to create new templates. footer.php - a general footer for all the pages. If you create a new template, please, make sure to add all the required php code like in the default one. style.css - default css file, it includes some classes which cannot be removed, so please, if you create a new template use this css sheet as a default and just change or add new classes and do not remove the default ones. menu.php - default menu module links set. You can add new links into the menu by editing this file, a standard link to add is e.g echo '<li> <a href="' . URL . '/file.php">Menu Item</a><br><br>'; please make sure to include this code into the <ul> ... </ul> tags of the menu.php file. Do not remove or change the existing menu items, most of them are important for the script.

searchform.php - this file controls the Search module you can see on all the pages on the left (for the default template). You can add/remove fields, change the way the form is presented by editing this file. It is mostly php based, but quite easy to understand. searchFormMain.php - this file controls the Search module on the top search of the home page (index.php). tables.php - this script is used to set header and footer for all the tables in the script. These are side boxes and the central frame tables. With this script you can add rounded corners, borders, shades to your central frame table and the side boxes. login.php - user login sidebox. There is also /images folder which is used to store the template images, to call the image in the template you have to use the following link: <img src="<?php echo URL . '/templates/' . $cookie_template . '/images/image.gif'; ?>" alt="0" border="0"> To control the way listing and agents are presented you can edit the tpl files located in the /tpl folder.

gallery.tpl - controls the way gallery images are printed, this is a cell of the html table, no php knowledge required to change this, you can use the following variables in this file:
o o o o o o o

{new} - will print a red square with the 'NEW' mark if this gallery image was added recently (there is a setting in the configuration panel for this) {updated} - will print an 'UPDATED' mark near the image if the image was updated recently. {image} - prints the image which is clickable (a full-size image will appear in the new window) {name} - title of this image {description} - description of this image {date_added} - date when image was added {date_updated} - date when image was updated

property_detailed.tpl - controls the look of the property detailed information page. A simple html table, the variables to edit:
o o o o o

{new} - please, see above gallery.tpl for description {updated} {featured} {link} - generates an URL to the listing {slideshow} - generate a slide show using the Photo Gallery images

o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o

{image} - shows the clickable main image of the listing (will open full-size image in a new window) {mls} - MLS number {title} - Listing title {type} - Property type {type2} - Listing type (sell, rent, buy) {video} - Video Tour Link (for detailed page only) {pdf} - PDF Link (for detailed page only) {style} - Listing Style {description} - Listing Description {lot_size} - Lot Size {dimensions} - Dimensions {bathrooms} - Number of bathrooms {half_bathrooms} - Number of half bathrooms {bedrooms} - Number of bedrooms {location1} - Location level 1 {location2} - Location level 2 {location3} - Location level 3 {address1} - Address Line 1 {address2} - Address Line 2 {price} - Lot Price {currency} - Currency Name {directions} - Directions {year_built} - Year Built {buildings} - Additional Out Buildings {appliances} - Appliances Included {features} - Features list {garage} - Garage Type {garage_cars} - Number of cars {basement} - Basement type {view_realtor} - A link to the agent detailed information page {friend} - Mail to a friend link {date_added} - Date when the listing was added {date_updated} - Date when the listing was updated {ip_added} - IP of the user who added the listing {ip_updated} - IP of the user who updated this listing for the last time {hits} - Number of visitors to this listing

property_search_short.tpl - used to show the table cell with the short listing details in the search results, the variables to edit are similar to property_detailed.php. property_search_short_simple.tpl - used to show the table cell with the short listing details in the search results but with 3 listings per row, the variables to edit are similar to property_detailed.php.

realtor_detailed.tpl - shows the detailed information page of the agent, a simple html table, easy to edit, the variables are:
o o o o o o o o o o o o o o o o o o o o o o o o

{new} {updated} {top} - print 'TOP' mark near the listing if it has 4.5 rating with at least 5 votes. {photo} - agent clickable photo (opens a full-size image in a new window) {first_name} - First Name {last_name} - Last Name {company_name} - Company Name {description} - Agent Description {location} - Agent State/Province {city} - City {address} - Address {zip} - Zip Code {phone} - Phone Number {fax} - Fax {mobile} - Cell Number {email} - email {website} - Website {view_user_listings} - Shows clickable list of agent's listings {map} - google map {date_added} {date_updated} {ip_added} {ip_updated} {hits}

realtor_search_short.tpl - a short agent details for the search table, uses the same variables as realtor_detailed.tpl Please note, that you can also print the name of the variable, for example to print the word 'City' in the tpl you will have to add {@city} variable, so add @ before each variable name to print the variable name and not the value, e.g: {@zip}: {zip} will print: Zip/Postal Code: 10000

c. Web Configuration Panel.

Web Configuration panel is used to configure your script without editing text files. The data is stored in mysql table which makes the script work faster. To get to the Panel you will need to login as super-administrator or as an administrator who have access to configuration. The Panel is located in Administrator -> Configuration Settings -> Configuration Settings You can find the variables descriptions right in the form, so there is no need to describe them here.

II. Administrator's Guide. 1. Managing Administrators.

a. Adding / Editing / Removing Administrators.


PMR is a multi-administrator system, this means there is a way to have an unlimited number of administrators with different privileges. There is a super-user account you cannot remove but can change login and password right after installing the system or as a periodical safety measures. You can access the Administrators Management scripts in your Administrative Section -> Manage Administrators submenu. There are two options to Edit Existing Administrators and Set Privileges. To add new administrator with the desired privileges you will need to click the 'Edit Administrators' submenu, and put a new username and password in the 'Add' subtable. Please, also remember to select a privilege for this administrator, if no privileges are in the list you will have to add one. Please note that new administrators cannot be added without the privilege. Read the next chapter to learn how to Add Privileges.

b. Setting Administrator's Permissions (Privileges).


Before adding new administrators to the fresh installation you will have to add a privilege for an administrator or a group of administrators. To add a privilege, simply go to Administrative Section -> Manage Administrators -> Edit Privileges submenu. You'll be presented with a form which contain a privilege name and the possible options you can allow for this privilege. To submit a new privilege please put a privilege name in the Submit Privilege form and select the options you want this admin to have enabled. It is possible to select several options. The possible options are:

Can Manage Users - allow the administrator to login and have access to the 'Manage Users' menu and all the submenus (Approve New Users, Check Updated Users, Add New User, Update/Remove Users, Send Messages) Can Manage Listings - allow the administrator to login and have access to the 'Manage Listings' menu and all the submenus (Approve New Listings, Check Updated Listings, Edit Listings) Can Manage Photo Gallery - allow to edit the Photo Gallery for each listing, please, use this option with the 'Can Manage Listings' option. Can Manage Types, Locations etc - allow the administrator to login and edit the database content using the submenus located in the 'Manage Types, Locations etc.' menu (Edit Porperty Type, Edit Styles, Edit Locations, Edit Additional Out Buildings, Edit Appliances Included, Edit Features, Edit Basement Types, Edit Garage Types). Can Manage Configuration Settings - allow the administrator to access 'Configuration Settings' menu and it's submenus (Configuration Settings, Database Backup, Ban e-mail Addresses, Statistics). Can Manage Administrators - allow this administrator to add/remove administrators and privileges, can access 'Manage Administrators' menu and 'Edit Administrators', 'Edit Privileges' submenus.

After adding a privilege you can use it by adding a new administrator into the system via 'Edit Administrators' submenu. When a new administrator access the system he/she will be presented with the available options, all other menus will be hidden.

2. System Configuration.

a. Web Configuration Panel.


Web Configuration panel is used to configure your script without editing text configuration files. The data is stored in mysql table which makes the script work faster. To get to the Panel you will need to login as super-administrator or as an administrator who have access to 'Configuration Settings'. The Panel is located in Administrator -> Configuration Settings -> Configuration Settings You can find the variable descriptions right in the form, so there is no need to describe them here.

b. Ban e-mails.

It is possible to deny new user submissions if the definite email was specified. You can use Configuration Settings -> Ban e-mail Addresses menu for this. The interface is simple, to add new email to be blocked just insert the email into the text field and press 'Add', to update existing e-mail just specify a new one in the field, choose the e-mail to edit using the radio button and press 'Update', to remove the block for the definite email just select it using a radio button and press 'Remove'. Initially there was an idea to ban domains if *@domain.com mask is specified, but this may cause some serious limitations for other possible users of this domain, so it was decided to leave it as is.

3. Managing Types, Locations etc.


You can edit some database tables content using 'Manage Types, Locations etc' menu in your Administrative Section. The possible options to edit are:

Edit Property Types - to add/edit 'Property Types', please, do not remove existing property types if there are listings in them, this will corrupt the database integrity. Edit Styles - to add/edit 'Styles' for the listings, please, do not remove existing types if there are listings which use these styles, this may corrupt the database integrity. Edit Locations - this submenu allows the administrator to edit 'State / Province' used for the listings and agents. Please, do not remove existing items which may be used by the listings or agents. Edit Additional Out Buildings - this option let you add/remove 'Additional Out Buildings' options. Edit Appliances Included - use this submenu to edit the 'Appliances Included' options. Edit Features - use this submenu to edit the 'Features' options for the listings. Edit Basement Types - use this submenu to edit the 'Basement Types' options for the listings. Edit Garage Types - use this submenu to edit the 'Garage Types' options for the listings.

The interface to add/edit the above options is pretty simple. To add a new option just select the submenu to edit, put an item name into the text field and press 'Add', to update an existing item just put a new item name into the text field, choose an item to update using a radio button and press 'Update', to remove an item, just select the item to remove using radio button and press 'Remove' button.

4. Managing Agents / Users.

a. Approving New/Updated Agents.

If you have configured the script to let you approve all new/updated user submissions you will need the following submenu to check all the new users and users updated for the last 5 days. Please note that new submissions are not available in the public directory until approved by the administrator. The new submissions approval tool is accessible via Manage Users -> Approve New Users submenu. You are presented with a list of all new submissions waiting for the approval. Just check the listing by pressing the 'Edit' link on the right, you can even do some corrections, then return back to the list by pressing the 'Back to latest agents search results' link and press 'Approve' link to approve the listing, if you do not want this listing to be added simply remove it by pressing the 'Remove' link. You can also check the updated listings, if you press Manage Users -> Check Updated Users you get the list of all the agents updated during last 5 days. You can edit or remove them the same way you do when approving new submissions. If you want to see listing updated during a diffirent period of days you can use the search form located in the bottom of the page. Please note that updated agents are still available in the public directory and are not hidden until you check them.

b. Adding New Agent.


If you have privileges to manage users you can add a new agent (user) into the system. To do this click Manage Users -> Add New User submenu. You'll be presented with a simple form to submit a new user. It is the same form you can find in the user section. Just specify all the required data and press 'Submit Agent' button. If there were errors found during processing you'll get the list of these errors and the form with the previously submitted data to correct. To add a agent photo you will need to use Manage Users -> Update/Remove Users submenu to edit the listing you have recently added, there is an option to upload the photo there, just press 'Edit' link near the user to edit.

c. Updating / Removing Agent.


You can update any user stored in the database if you have privilege to do this. Simply press Manage Users -> Update/Remove Users submenu. You will be presented with the search form to look for the user you want to edit, please, be specific not to fetch too many listings, as this may cause some navigation problems for novice users when editing the listings. After you have searched for the user listings you can edit each listing by pressing the 'Edit' link located near the desired agent. You can also 'Remove' any listing you want. Please, note that if you are removing the listing, all the data connected to that listing will be removed (images, listings, photo gallery). To upload the agent photo you will need to press 'Edit' link near the agent you want to add

photo to. Then use agent Logo/Photo form to do that. Press 'Browse...' button and select the JPEG image you want to upload, please note that the image will be resized according to the setting in the configuration settings (photo_resampled_width). There is also an image size limitation set in the configuration settings (max_photo_width, max_photo_height) and the image file size limitation (max_photo_size).

5. Managing Listings.

a. Approving New/Updated Listings.


If you have configured the script to let you approve all new/updated listing submissions you will need the following submenu to check all the new listings and listings updated for the last 5 days. Please note that new submissions are not available in the public directory until approved by the administrator. The new submissions approval tool is accessible via Manage Listings -> Approve New Listings submenu. You are presented with a list of all new submissions waiting for the approval. Just check the listing by pressing the 'Edit' link on the right, you can even do some corrections, then return back to the list by pressing the 'Back to latest listings search results' link and press 'Approve' link to approve the listing, if you do not want this listing to be added simply remove it by pressing the 'Remove' link. You can also check the updated listings, if you press Manage Listings -> Check Updated Listings you are presented with the list of all the listings updated during last 5 days. You can edit or remove them the same way you do when approving new submissions. If you want to see listings updated during a diffirent period of days you can use the search form located in the bottom of the page, the options to control this can be seen on the following picture. Please note that updated listings are still available in the public directory and are not hidden until you check them.

b. Adding New Listing.


If you have privileges to manage listings you can add a new listing into the system. To do this click Manage Users -> Update/Remove Users -> (Find the user you want to add listing to using the search form in the bottom) -> Press 'Add New Listing' link near the user you want to add the listing to.. You'll be presented with a simple form to submit a new listing. It is the same form you can find in the user section. Just specify all the required data and press 'Submit Listing' button. If there were errors found during processing you'll be presented with the list of these errors and the form with the previously submitted data to correct. To add a listing main photo you will need to use Manage Listings -> Update/Remove Listings submenu to edit the listing you have recently added, there is an option to upload the photo there, just press 'Edit' link near the listing to edit.

c. Updating / Removing Listing.


You can update any listing stored in the database if you have privilege to do this. Simply press Manage Listings -> Edit Listings submenu. You will be presented with the search form to look for the listing you want to edit, please, be specific not to fetch too many listings, as this may cause some navigation problems for novice users when editing the listings. You can also get the list of all the listings for a definite agent by using the following scheme Manage Users -> Update/Remove Users -> (find the required user to add listings to using the simple search form) -> Press 'Edit Listings' link near the agent. This way you will get a list of all the listings for the current agent. Please note that this scheme is only available if the administrator have 'Can Manage Users' privilege. After you have searched for the listings you want to edit you can edit each listing by pressing the 'Edit' link near each one. You can also 'Remove' any listing you want. Please, note that if you are removing the listing, all the data connected to that listing will be removed (images, photo gallery). To upload the listing main photo you will need to press 'Edit' link near the listing you want to add photo to. Then use Image Upload form to do that. Press 'Browse...' button and select the JPEG image you want to upload, please note that the image will be resized according to the setting in the configuration settings (image_resampled_width). There is also an image size limitation set in the configuration settings (max_image_width, max_image_height) and the image file size limitation (max_image_size).

d. Photo Gallery Management.


The Photo Gallery feature is used to store JPEG images for the listings. This part of the PMR script can be accessed for the administrators who have privilege to do this (Can Manage Photo Gallery). To get to the Photo Gallery editor for the definite listing you have to navigate the administrator section using the following scheme: Manage Listings -> Edit Listings -> (find the listing to edit in the search form) -> Press 'Photo Gallery' link to get to the Photo Gallery for this listing. The Photo Gallery interface is quite simple. It consists of a list of images each with a radio button for you to select the image you want to update or remove and a form to upload text data (Submit Photo Information) and upload image. To update the text data, simply select the gallery item to update using the radio button, put some new text into the 'Submit Photo Information' form and press 'Update Photo Information' button. This will also substitute the existing image with the new one. To remove the gallery item just select this item in the list using the radio buttonand press 'Remove Photo Information' button.

Please note that the uploaded images are resized according to the setting in the configuration settings (gallery_resampled_width). There is also an image size limitation set in the configuration settings (max_gallery_width, max_gallery_height) and the image file size limitation (max_gallery_size). Users can also use Bulk Photo Upload tool to upload multiple images at once.

e. Featured Listings.
There is a possibility to make some of the listings featured. This allows them to appear first in the search results and to be visible in the 'Featured Listings' module on the home page. To make the listing featured you have to set the Featured Packages in the Configuration Settings menu, the package consists of Package Name, Package Duration (in days) and Package Price, the price currency is set in the Configuration Settings Web Panel. Please, make sure to add your paypal primary email in the configuration settings and enable IPN in your paypal account. The featured package can be set in the Administrative section only when adding new listing or editing the existing one. Users will have to press the package name when editing their listings to pay for the featured package via paypal. This a separate featured listings packages system and is not connected to the featured agents system. NOTE! Please note that if agent package expires or agent reupgrades to a package which has less listings available he currently has, all listings including featured listings are removed.

f. Featured Agents.
It is possible to have agents pay for their accounts and let them have an ability to store a definite number of listings, photo gallery images per listing and have their address, photo and phone numbers visible in the directory. When agent submits his details he receives a free listing. He can upgrade right after submitting his listing, this way his agent record is approved automatically. When user upgrades to a definite package he gets an ability to post listings, the number of listings is controled for each package individually. Administrator can add an unlimited number of packages with a different number of listings, photo images and other settings. The package duration in days is also set for each package indivudually. This is a number of days the user can have his listings available. Before the record expire the agent is notified by email and have to login and upgrade his agent record again not to lose his listings, photos and contact information. If the agent listing expires it gets free package automatically. If agent reupgrades to a package with more listings available his old listings are not removed,

but if he reupgrades to the package with a smaller number of listings available his old listings are removed, even if those listings are featured. Administrator can change agent's package any time by editing the agent record and setting the required package name in the drop down menu. Administrator can also set the featured package while approving the free listing, this way administrator can let his new users upgrade for free for a definite package just in case of a promo or if this website is free for all agents. Administrator can also change the settings for the FREE package to let agents post free listings for free.

g. 2checkout Account Configuration.


For users with the vendor id < 200000 Go to 'Account Details', then to 'Return' submenu. Here in 'purchase.2c Passback Parameters' set 'Return to a routine on your site after credit card processed?' to 'YES' and insert the full url to 2checkout.php like http://www.phpmyrealty.com/demo/2checkout.php into 'Return URL'. In 'Overall Passback Parameters' set 'Direct Return' to 'YES' and specify a secret word to secure your transactions. After this in 'Account Details' menu choose 'Sales Parameters' submenu and set 'Accept Check Payments' to 'No'. And change 'Put Purchase Button/Link Routine in Demo Mode?' to 'No'. For users with the vendor id > 200000 Go to '7. Setting Up Your Site.', then in the Optional Parameters paragraph choose 'Check Here' link. Please, set the following variables here : 'Input a url for your customers to be sent to on a sucessful purchase', this has to point to your 2checkout.php file located in the PMR root folder and specify a secret word to secure your transactions. You will need to create a product in your 2co account according to the product your have in your packages (agent packages and listing packages, there is a field to place a 2co product ID when you add package in your admin area). To change the gateway to 2co set 'gateway' variable in your PMR Administrator Configuration Panel to '2', for PayPal set it to '1' (default). Attention! All users with the vendor id < 200000 will have to change the 2checkout payment gateway in your Administrator Configuration Setting Panel to "https://www.2checkout.com/cgi-bin/sbuyers/purchase.2c".

You might also like