Almond Classifieds. Classified Ads Script. Steps for setting up Almond Classifieds on your Web-server: Keep in mind: some features described below are not available for "Almond Classified (Free Edition)". Visit pages http://www.almondsoft.com/alcl.html and http://www.almondsoft.com/alclfree.html to see differences between free and commerce versions. Unzip your loaded zip file; Layout similar to http://www.almondsoft.com/pro is set up in the script by default. If you prefer layout similar to http://www.almondsoft.com/pro2 you have to rename files in the classifieds directory: config2.php to config.php top2.php to top.php details1.php to details.php conf_cat2.php to conf_cat.php. Before renaming you have to delete old files config.php, top.php, details.php, conf_cat.php. You have to set up all installation options in new files config.php and conf_cat.php again. "Configuring your Web Server" 1. Create a new directory under the html directory of your Web server where photo files and files with more detailed ad info will be kept. For example, /home/httpd/html/photos (we prefer, to create such directory inside directory where placed classifieds .php files ) 2. Make permission 777 for this directory by chmod command. "Setting up the config.php file" Go through config.php file and set up the following variables only: 1. Set up MySQL database parameters: Database name ( $db_name ), hostname ( $host_name ), user name ($db_user), password ($password). These parameters you can ask in your web site hosting company. Also choose name for database table ($table_ads) where ads entries will be saved. 2. Set the base of the path to the directory where photo files and files with more detailed ad info will be kept. e.g. $photopath="/home/httpd/html/photos/"; (if you have create photos directory named "photos" inside directory with .php files you can set up relative path $photopath="photos/" , as it made in our default settings in config.php file ). 3. Set the base to the URL of the directory where photo files and files with more detailed ad info will be kept. e.g. $photourl="http://www.yoursite.com/photo/"; (if you have create photos directory named "photos" inside directory with .php files you can set up relative path $photourl="photos/" , as it made in our default settings in config.php file ). Do not forget about end slash "/" in the paths :) "Upload Files" 1. Upload all script files ( .php) via ftp to your php directory, You have to do this via ftp program from computer with Windows system ( such as files saved in Windows text format) to Unix server in ASCII mode. 2. Make permission 755 ( or 777) for these files by chmod command. "Test the Script" Create MySQL database (with the same name as specified in config.php file ) by using special web interface provided by your web site hosting company, or via telnet by using mysqladmin utility. After configuration, start via your browser createtb.php script for creation classifieds table. Input your admin password into form ( this password is set up in the config.php file ). Keep in mind, script uses cookies for admin authorization ( so cookies must be set up in your browser) and if you have once inputed your admin password, script will not ask you about password until you close your browser. Cookies work during one browser session ( when you close your browser, on the next session you have to log in as admin again ). Click on the link to create classifieds table, if the table is created successfully you have to see the name of your chosen database table name in the list of database tables. On your Web browser input the URL of the index.php script, for example, http://www.yourname.com/index.php. Script should work. ---------------------------------------------------------------------------------- MORE DETAILED INSTRUCTIONS (these features are not available for free version ). How to edit the ad by admin: Go to admin.php URL in your browser, then input ad id# in the edit area, then make editing of the ad. How to delete ads by admin: Go to delete area in the web admin interface ( admin.php ) , input ads id# you need to delete, separated by commas, e.g. if you input 5,16,23-27,35,45-48 then ads with the following id# will be deleted: 5,16,23,24,25,26,27,35,45,46,47,48 How to moderate ads by admin: First you have to set up variable $moderating="yes" in the config.php file. After this if some user submits ad, this ad will be placed into moderate folder and will be not visible in the public ads index. Admin can click on the "moderate" link in the web admin interface area, then browse and edit submitted ads. To make ads visible, admin goes to " Make ads visible/unvisible" area and submits list of ads id# he needs to make visible in the public ads index. e.g. if you input 5,16,23-27,35,45-48 then ads with the following id# will become visible: 5,16,23,24,25,26,27,35,45,46,47,48 If you need to delete some ads in the moderate folder, you can submit ads id# for deleting in the delete admin area as described above. If moderating option is set up and some user makes editing of his/her ad, this ad will be placed into editing folder and only after approving by admin with the following above way ( as for moderating folder ) this ad can appear in the public index. How to make ads invisible: If you need to make some ads invisible for some time period you can submit list of ad id# of these ads to the invisible folder, and after some period make them visible as in the moderating case. How to get e-mails of ad owners: To get e-mails of ad owners, you can click on the link with category name in the web admin interface. You will get e-mails of ad owners of this category in the alphabetical order. You can copy this list for using in mail list programs. If you click on the e-mail link you will see the ad details page with this contact e-mail. ----------------------------------------------------------------------------------- Once you have the script working, you can start to set up the script parameters according to your needs. Now you need to set up custom categories set and ad fields for each category. "Setting up the ad fields." 1. In the file conf_cat.php you can find variable $categories with description of categories, variable %ads_fields where the description of ad fields used in all categories is set up, variable %fields_set where the description of specific ad fields used only in some categories is set up. These default settings are a good example to understand the main principles of setting categoreis and ads fields. We give you only a little explanation. To set up an ad field you must define 8 different parts in each field. Each different field within the ad is described as the following example: 'comp' => array('Company',"12",'keyword','20:30','text', '1','text', 'selectparam'), where 'comp' - is short name of the field (it is required for script using) ; 'Company' = displayed name of the field. This is the name of the field that will appear on the form; '12' - parameter which shows how this field will be displayed: '1' - only at the first page (ads index); '2' - only at the second page ( 'detailed info'); '12' - on both first and second pages; '00' - is not displayed on pages (hidden fields). 'keyword' = search parameter that sets the principle of search, it must have one of three different values explained below: 'keyword' = defines this as a search field. Users will be able to search for keys in this field; 'minmax' = when field has numerical value, it will be searched in range [minvalue, maxvalue]; 'nosearch' = not a search field. No search for keys in this field; '20:30' = defines the length of the input field in ad submitting form(20) and max length of the info in this field (30). If field type ( see below) is 'textarea' at this place you will have e.g. the following: '40:6:2000' - where 40 - number of cols, 6 - number of rows, 2000 - max size of the field. ( See our default settings in config.php ). 'text' = type of input field, it can be 'text' or 'select', 'checkbox', 'textarea'. ( See our default settings in config.php ) "1" - means this field reqired to be filled out ("0" is not required). 'text' - parameter means MySQL type for this field, it can be text, char(n), integer, real... 'selectparam' - this last parameter can appear only for fields types 'select' and 'checkbox', this parameter means default values for users' choice. All values are separated by delimiter "