/////////////////////////////////////////////
//////////SYSTEM REQUIREMENTS////////////////
///////// UPDATED: 13/07/2014////////////////
////////////////////////////////////////////
PHP 5.3+, MySQL 4.1+

////////////////////////////////////////////
Preparing your system for IsVipi

/////////////////// Working with Debian Wheezy
1) Packets that we need to install to run IsVipi
aptitude install apache2 php5 php5-mysql php5-curl php5-mcrypt mysql-server mysql-client php5-gd

2) We need to enable rewrite module for Apache
a2enmod rewrite

3) If you use the default Virtual Host for run IsVipi when you need to change the follow configuration
	<Directory /var/www/>
		Options Indexes FollowSymLinks MultiViews
		#We need to chenge the AllowOverride to All to can check .htaccess in root directory
		AllowOverride All
		Order allow,deny
		allow from all
	</Directory>

3.1) If you use a new Virtual Host don't forget to cnange AllowOverride to All.


4) Now in /var/www you need to create the follow file
vim /var/www/.htaccess
#Controllers for rewrite
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteRule !\.(gif|jpg|png|css|js|html|ico|zip|rar|pdf|xml|mp4|mpg|flv|swf|mkv|ogg|avi|woff|svg|eot|ttf|jar)$ index.php
</IfModule>

# directory browsing
Options All -Indexes

5) Now we need to create the database for IsVipi on MySQL
CREATE DATABASE isvipi;
GRANT ALL PRIVILEGES ON isvipi.* to isvipi@'localhost' identified by 'isvipi';
FLUSH PRIVILEGES;

6) Now we need to change the permission for /var/www/
chown -R www-data:www-data /var/www
find /var/www -type f -exec chmod 644 {} \;
find /var/www -type d -exec chmod 755 {} \;

6) Now you can follow the instructions below.

////////////////////////////////////////////
INSTALL INSTRUCTIONS

There are two ways to install the script; one using the installer (which is recommended) and the other is installing it manually

/////////////////////////////////////////////
//////////USING THE INSTALLER///////////////
////////////////////////////////////////////

1a. Simply visit your site, for example, http://yoursite.com and as long as there is no db file in inc/db/ folder, you 
    will get the option to install your site.
  
 			OR

1b. If you however get an error when you visit your site, this is possibly due to the presence of a db.php file
    in inc/db/. To get through this, you can either visit http://yoursite.com/_install/ or delete db.php from inc/db/ 
    folder and then go back to http://yoursite.com and refresh it.
    Remember to replace "yoursite.com" with your site.

   If it is a subdirectory, point it to http://yoursite.com/subdirectory/_install/

2. Provide your database login details, that is, server (which is often localhost), database username,
   Database password and database name.

3. Once the script verifies that the credentials are valid, it will import an sql file (sql.sql) and create
   a database connection file (db.php) in inc/db/

   If you happen to make a mistake and the db file is written in the path provided above, simply restart the installation
   process again. The db.php file will be deleted and a new one will be created. You will get a prompt with this regard. 

4. Lastly, in step two of the installation, provide site settings. These settings are important as the site 
   will not function without them. Provide the site url, that is, http://yoursite.com without the trailing front slash.
   Also provide a site title (without special characters), default email address and select your timezone. Delete or rename the _install folder.

   That is it!!!


   It is worthwhile reminding you that the script does not have an admin section as of now but it will be released soon. 
   You can test the functionalities of the member area and make your suggestions or recommendations. 

//////////////////////////////////////////////
///////////MANUAL INSTALLATION////////////////
/////////////////////////////////////////////
To manually install this script, do the following

1. In _install folder, you will find a file named db_sample.php. Move it to "inc/db/" and rename it db.php 
   (that is, delete the _sample)
2. Fill in your database credentials by replacing localhost, my_database_name, my_database_username and my_database_password
   with your database details
3. Once that is done, go back to _install folder and using phpmyadmin, import the sql file (sql.sql). Alternatively, you can 
   open the sql file, copy all its content and in your phpmyadmin, choose SQL, paste it and execute.
4. Lastly, you will need to enter your site settings. These details should be entered in "site_settings" table in your database.
   From phpmyadmin, click on the table "site_settings", then click insert. Leave the id empty but fill in the site_url, site_title,
   site_email, theme and time_zone. For the site url, enter http://yoursite.com or http://yoursite.com/folder without a trailing front slash.
   For the theme, enter "default" without the quotes and in lowercase. Lastly, for the time_zone, use the format Africa/Nairobi.
  
   That is it!

//////////////////////////////////////////////
/////////COMMON ISSUES///////////////////////
////////////////////////////////////////////
1) Forgot to enable rewrite mode on Apache
2) Forgot to create .htaccess in document root for IsVipi


//////////////////////////////////////////////
//////////////SUPPORT////////////////////////
/////////////////////////////////////////////

You can get support by visiting our forum at http://forum.isvipi.com
Alternatively, you can report an issue on our git at 
https://github.com/IsVipiOfficial/IsVipi-Open-Source-Social-Networking-Script

////////////////////////////////////////////
//////////CONTRIBUTION/////////////////////
///////////////////////////////////////////
This is an open source script and therefore we encourage you to test it, modify it and enhance it as you please.
We are currently looking for individuals to help in theme development and enhancing its core functions and therefore
we would appreciate it if you could help in whatever way possible. 

Our forum also needs moderators and therefore if you feel like you are up to the task, you can contact us either through
our website, on github or on sourceforge. 

If you also feel like this script is what you have been looking for, you can make a donation and help in further development 
of the script. You can get details on how you can contribute at http://isvipi.com
