ProLogin Documentation

### “ProLogin” Documentation by “Patchesoft” v1.0

# “ProLogin”

Created: 04/08/2015
By: Patchesoft
Email: patchesoft@gmail.com

Thank you for purchasing the ProLogin application. If you have any questions that are beyond the scope of this help file, please feel free to email via my user page contact form here. Thanks so much!

You can also read our Social Network Guide and Updating Guide

## Table of Contents

1. Setup And Installation
2. Application Structure
3. Where Everything Is
4. FrontPage
5. Dashboard
6. Members
7. User Settings
8. Admin Panel
9. Creating Your Own Content
10. Modifying HTML & CSS
11. Troubleshooting
12. Languages
13. Multiple Languages
14. Credits

### Setup And Installation - top

### UPLOAD FILES

Once you have downloaded your file from the Envato Marketplace, you will need to extract the files from the ZIP file. You will need to upload the ProLogin core files to a webserver. First locate the core files in the folder: /ProLogin/core_files/core.zip. You will need to extract the files from the zip and upload them so that these files are in your main directory on your webserver, usually this is the public_html folder. Your webserver's main directory should look something like this:

### EDIT CONFIG FILES

Before you can use your ProLogin, you will need to edit the config files. First locate the config file in: application/config/config.php and open it up using a text editor such as notepad. The only line you should need to edit is the:

    $config['base_url']	= 'http://www.example.com/';

Replace the http://www.example.com with your own domain name, making sure you keep the quotation tags around it as above. There are some other settings that you can also edit in this file if you feel the need to customise your ProLogin further but for a basic installation this is all you should need to edit. Save the file and overwrite the existing one on your webserver.

The second file you will need to edit is your database file. Find the file: application/config/database.php and open it up using a text editor like Notepad. You will need to edit the lines listed below with your own database login information. For the most part, host stays the same as localhost unless your web host specifies to you otherwise. You will need your database name, database username and database password.

    $db['default']['hostname'] = 'localhost';
    $db['default']['username'] = 'your_username';
    $db['default']['password'] = 'your_password';
    $db['default']['database'] = 'database_name';

Once you have modified this file, save it and overwrite the existing one on your webserver.

### IMPORT SQL FILE

Next you will need to execute the SQL file that came with the ProLogin download. This file will create the database tables that are used to store the data of your application. Usually you can import the SQL tables by using a database management system like PHPmyAdmin. The SQL file is located in ProLogin/core_files/database.sql in the ProLogin download.

To Import the file, login to your database management system, such as PHPmyAdmin. Make sure you are on the database that you named in the database.php config file then locate the Import Tab on PHPmyAdmin.

Next select the browse button (as shown in the screenshot above) and locate the SQL file (ProLogin/core_files/database.sql) from your ProLogin Download. Next click the Go! button and you should now see database tables appear in the left sidebar.

### RUN INSTALL FILE

Finally, you will need to run the install file in your web browser. You should be able to locate it by going to http://www.mydomain.com/install/ where mydomain.com is replaced by your own. If you're having problems accessing this URL, double-check that you entered the correct information in the config.php file. If you are sure that it is correct, it may be something to do with your webserver's settings with allowing friendly URLs. The problem most notably is usually with the .htaccess file- make sure this file is in your public_html directory (like in the directory screenshot above). If you still have problems, head to the Troubleshoot section of this guide.

On the Install Page, you will need to create the admin account which will have all the privleges for managing the ProLogin. You can also setup some initial settings for getting your ProLogin started (you can change these later).

IMPORTANT: Once you have installed the ProLogin, please delete the file application/controllers/install.php! This will prevent other users from messing up your settings.

INSTALLING IN A SUB-FOLDER

If you're installing the software in a sub-folder, such as http://www.example.com/software/ then you will need to modify the .htaccess file inside the main directory (the one that holds the application, bootstrap folders etc). All you need to do is open up the .htaccess file in your text editor and copy the following code, replacing the sub-folder with the name of your sub-folder (in this example, the sub-folder is called software. Replace this with the name of your sub-folder).

    			RewriteEngine On
    RewriteBase /software
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*) index.php?/$1

Save the file as .htaccess and overwrite the one inside your main directory that you used to install the software in (the folder containing the application, bootstrap folders etc). You can skip this step if you're installing in your main folder.

### B) Application Structure - top

This application is built up around the CodeIgniter framework. This framework is freely available on the internet and documentation for using the source code can be founded on their website: http://ellislab.com/codeigniter. CodeIgniter is a PHP Framework written in MVC (model-view-controller) format which allows developers to create applications that are structured in a very clean and efficient way. When you unzip the ProLogin Code download (ProLogin/core_files/code.zip), you will be presented with the following directory structure. Below is a quick overview where you can find various files if you are new to using CodeIgniter.

- application - This is where the main application files are kept. It includes the configuaration files, the class controllers, models and view files. If you want to make changes to the application, you should modify these files.
- bootstrap - The bootstrap Javascript and CSS files.
- images - Images used in the application are stored here.
- scripts - Custom Javascript files made for use with the application.
- styles - Custom CSS files made for use with the application.
- system - The core CodeIgniter files are present here. These should not be modified unless upgrading the CodeIgniter version.
- uploads - This folder is used to store user uploads.
- user_guide - Documentation on how to use CodeIgniter.
- .htaccess - This file is used to tell your web server to process friendly URLs.
- index.php - The application bootup file.

You can find more information on directory structure at the CodeIgniter website and reading the User Guide: http://ellislab.com/codeigniter/user-guide/.

### Where Everything Is - top

This part of the guide is to show you where the most common elements of the site are located. Remember, this site uses CodeIgniter Framework, so for well-documented additional support, please use their website and user guide: http://ellislab.com/codeigniter/user-guide/

The site's styling is based off Bootstrap 3; Bootstrap 3 comes with lots of predefined CSS elements that you can use to create well presented websites with. You can view the Bootstrap documentation and examples here: http://getbootstrap.com/. If you wish to upgrade the Bootstrap version or make your own changes to it, you can find the files in the bootstrap/ directory.

ProLogin also uses it's own custom styling to create the site layout. You can find the stylesheet file in styles/main.css folder.

The template files, also known as views, can be found in application/views/. These files contain the HTML of the site and modifying these files allows you to change the way the site presents data. These files also contain some PHP code so it's important to know what you're doing when editting these files. The layout file can be found in application/views/layout/layout.php.

The controller files, which contain the site logic, can be found in application/controllers/ folder. These are PHP files that are used to control how the site works.

The model files can be found in application/models/ which contain the database logic.

The Javascript files can be found in the scripts/ folder.

Some 3rd Party libraries have been used in this software. One that may be of interest to you is the HTML Filter library, which whitelists certain HTML elements. This file can be found in application/libraries/lib_filter.php.

### FrontPage - top

When you have successfully installed the ProLogin system, you should be presented with a frontpage like the one below. This is the login screen that is presented to all your users. You can login by using the Email Address and Password that you created in the Install file.

Users can also login using their social network accounts for Twitter, Facebook and Google. You will first need to setup your social network keys before you can enable this option. View our Social Network setup guide in the documentation.

Also presented on this page is the register button. Clicking it takes you to the simple registration form that allows users to register on your site. You can disable registration in the Admin Panel.

### Dashboard - top

Once logged in, you will be presented with a dashboard area.

This area shows you information on your User Base. It displays the newest registered users, the amount of users registered for the past 6 months and also a breakdown of where your users are coming from.

You will also notice a sidebar which has some useful links that you can navigate. If you are logged in as an Admin user, you will notice the Admin Panel link. Clicking on it will expand the menu, presenting you with more options.

### Members - top

A members page is available for all your members to view.

You can view a user's username, when they joined, where they joined from and what kind of member they are. You can also click their username to go the user's profile.

You can sort the member list by clicking on the table column headers. Sort by Username, date joined, name, user level and provider.

You can also search members by using the top search bar at the top of the page. This allows you to search by Username.

### User Settings - top

The User Settings page can be found by clicking on the Settings link. These settings are for each individual user.

Here a user can upload an avatar, change their name and edit their About Me section which appears on their profile page.

A user can also change their password by clicking the Change Password button in the top right corner.

### Admin Panel - top

The Admin Panel only shows to users with an Admin status account. You can create your Admin account by using the Installer as mentioned in the Install Guide above.

There are quite a lot of options for the Admin Panel that help running your site that much easier. The first set of options is the Global Settings option. These options directly effect the site overall. Here you can change the Site Name, Logo, Disable Registration and more.

Other settings include Social Settings. These settings refer to allowing users to login to your site using their Social Network Accounts. You will need to obtain API keys from the Social Networks, you can do this quite easily and for free. Just follow our Social Network guide that is contained within the documentation folder.

The Manage Member section is similar to the Members page. However, this section contains a bit more detail about your users, including their Email Address and the IP address used to sign up with the account. From this page, you can also Edit and Delete members. Clicking on Edit will present you with a page allowing you to edit the user's details, such as username, email and password.

Another option included in the software is User Groups. This section allows you to create groups for your users, allowing you to keep them more organised. You can also use groups to restrict access to certain pages. We have made a test page for this and you can view the coding behind it by editing the file application/controllers/Test.php.

We also have an in-built IP blocking system. Here you can add IP Address to a blacklist which will prevent those IP addresses from registering new accounts and logging in.

Email Templates allow you to edit Emails that are sent out to users. There is currently only one email you need to be aware of and that is the Forgotten Password email. If you wish to change this email and the way it's presented, feel free to edit the Email using this area.

In the Admin Panel is also the ability to send out emails to your members. From the Email Members page, you can select individual users, user groups or all users. Then you can set the title of the email and of course, the email message you wish to send. Emails are sent using CodeIgniters in built email library. You can change the settings for how emails are sent using the email config found here: application/config/email.php. For more information on settings, including how to setup SMTP email, view the documentation guide here: http://www.codeigniter.com/user_guide/libraries/email.html

### Creating Your Own Content - top

Creating your own pages requires you to use the CodeIgniter framework. It's quite simple to use if you have some programming experience. You can view our test content file here: application/controllers/Test.php

To create a page, first you will want to create a Controller file. This file will be where you main PHP code logic goes. Below is an example controller file. The file must be saved as the same name as the class (with a captial letter). So for example, the class here is called Example, so the controller file must be called Example.php. The file must be placed inside the application/controllers/ folder.

    <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

    class Example extends CI_Controller
    {

    	public function index()
    	{

    		// Loads HTML page
    		$this->template->loadContent("test/index.php", array(
    			)
    		);
    	}

    }

    ?>

The name of the Controller is also used to access the page. Since we named our controller Example, we can now access it using our URL like so: http://www.mysite.com/example/

There are a few more things to look at here too. If you notice inside the index() function, there is this line:

    $this->template->loadContent("test/index.php", array(
    			)
    		);

This line is saying to load the HTML file stored in application/views/test/index.php. If you want to create your own HTML files, you can. Simply create a folder inside the application/views/ folder. Name it whatever you like. For this example, let's call it example. Inside that folder, create your very own PHP file that will be used to display the HTML. Let's create a file called test.php and put some code inside it:

    Hello, this is a test! We save it as a .php file so that we can also include PHP code. Like this: <?php echo rand(1,6); ?>

Now, we need to edit our controller file application/controllers/Example.php to use our new HTML file that we just created. So edit the loadContent() function to use it, like so:

    $this->template->loadContent("example/test.php", array(
    			)
    		);

Now when you load the Example page, it will display the content inside application/views/example/test.php.

If you found that confusing, not to worry! There are thousands of guides out there that use the CodeIgniter framework. There is also the CodeIgniter Documentation, which gives a brilliant easy to understand overview of how to use the system. Don't forget to look at our own test file, which gives examples of how you can restrict access to pages (application/controllers/Test.php). You can also contact us via email if you need extra help.

CodeIgniter User Guide: http://www.codeigniter.com/user_guide/

### Modifying the HTML & CSS - top

You can modify the HTML and CSS of the ProLogin to match the look and feel of your website. You can manually edit the CSS file that controls the site's look and feel.

You can find the CSS file in styles/main.css. Here you will be able to see the current rules that have been created for the site. You may want to put your own rules at the bottom of the file, or even create your own CSS file and include that into the site layout. This will be useful should you ever wish to upgrade the ProLogin application with a newer version and your settings won't be overwritten.

You may also wish to change the HTML of the site. All HTML files are inside the application/views/ folders. The layout HTML file can be found in application/views/layout/layout.php. This file is the core of the site structure. There are some PHP coding inside the HTML files which is used to generate the dynamic content; we suggest not modifying these as it could cause unexpected errors in your system.

Remember, you can find out more information on how to use Views, Controllers and Models using the CodeIgniter framework by reading their documentation: http://ellislab.com/codeigniter/user-guide/.

We also use Twitter Bootstrap to create the layouts, which you can find here: http://getbootstrap.com/

### O) Troubleshooting - top

I can't access any pages on my ProLogin. I keep getting 404 and Page Cannot Be found errors. What can I do to solve this?
Usually this is due to an issue with your .htaccess file. This file is used to reroute friendly URLs for the ProLogin (such as http://www.mydomain.com/news/view/1). Sometimes the .htaccess file is blocked by the server host, so you may need to contact your web host and ask them to be allowed to use your own .htaccess file. (We provided one in the download file). You will also need to make sure your webhost has mod_rewrite enabled. You may find using different .htaccess settings works better for you and your host. We recommend contacting your web host to see if they can help with this issue.

I get "No input file specified." when trying to access the install page
This is due to not having the correct .htaccess settings. If you have installed the ProLogin in a sub-folder, please edit your .htaccess file as outlined above. If that doesn't work, try using the file ProLogin/extra/access/dh_.htaccess in your download. Rename the file to .htaccess and overwrite the one in the main directory (You can also find the default.htaccess file which is the one that is used by default and works for most applications)

I am getting database errors when trying to access my ProLogin
Please make sure that you imported the SQL file that was included in the download zip. This file contains all the database tables needed to create the ProLogin.

I want to put my ProLogin in a sub-folder on my server, such as (http://www.example.com/project_box/). How do I do this?
You will need to update your config files to make sure your domains are correct. If you have issues with doing this, open up the application/config/config.php file. Change the base_url variable so that it includes your sub-folder.

Where can I get additional support for my ProLogin?
You can contact us via email provided on this document and we will try to respond within 2 days, but usually respond within a day.

### P) Languages - top

If you would like to translate your application into another language, then you can do so by modifying the language files. Follow the simple steps below to get started:

- 1) Create a new folder inside the application/language/ folder. Give the folder the name of your language, such as spanish, italian etc. For this example, I will call mine french.
- 2) Copy the 4 files from inside application/language/english/ to the newly created folder that you just made.
- 3) Inside your new language folder you should now have a content_lang.php, error_lang.php and success_lang.php. You can also add the index.html file too (this is not needed, it just helps stop people snooping on your files).

You are now ready to begin editting these files. The content_lang.php contains all translations for most of the content pages on the site. The error_lang.php file contains all the error messages that are given to users when they do something wrong. You are free to translate them all or just a few. The main one should be the content_lang.php as those translations are the ones your users will mostly see.

To edit the translations, all you need to do is type the new correct text inside the double quotes. For example, the following is a couple of lines from the content_lang.php file:

    			$lang['ctn_3'] = "Provide Us Feedback";
    			$lang['ctn_4'] = "Email Address";

To translate, you just need to modify the text within the double quotes. For example, a french translation would be:

    			$lang['ctn_3'] = "Fournir nous Commentaires";
    			$lang['ctn_4'] = "Adresse e-mail";

Save the file when your done. The final step for your translations to take place, you need to edit the application/config/config.php file. Change the following line:

    		$config['language']	= 'english';

to the name of the folder that you stored your new language files in. In my case, it was french, so I change it to:

    		$config['language']	= 'french';

Save config.php and you should see your new translations take place.

One final step is to make a folder for the system language files. You don't need to translate these files, you just need to make a copy of them. Go to system/language and create a new folder with the name of your language. In my case, it is french.

Now copy all the files in system/language/english/ to your new folder. I.e system/language/french/. You should now have a dozen or so files inside both folders.

These files are mostly system and error messages that your users will rarely see so there is no need to translate these. (But you are free to if you really want to.).

### P) Multiple Languages - top

This software also has the option for the user to change the language themselves. The available languages are based on the translations you have done. A user can change the language of the site by clicking the Change Language link in the footer of the site.

You can add as many available languages are you like. You just need to make sure you have created the language files and folders, as outlined in the guide above.

To make a language available for selection, you need to edit the main config file: application/config/config.php. Look for this line:

    			// For the Change Language option
    			$config['available_languages'] = array(
    				"English" => "english"
    			);

This is where you need to add your other languages. For example, to add your French language, edit the code so it says:

    			// For the Change Language option
    			$config['available_languages'] = array(
    				"English" => "english",
    				"French" => "french"
    			);

Now when the user visits the Change Language page, the option for French will appear in the menu. Remember, make sure the language files (in this case French) have been added too as outlined in the Language Guide above.

### Credits - top

- Bootstrap 3.0 http://getbootstrap.com/
- CodeIgniter http://ellislab.com/codeigniter
- Lib Filter http://code.iamcal.com/php/lib_filter/
- PHPass http://www.openwall.com/phpass/
- Libel Suit Font http://typodermicfonts.com/

Patchesoft

Go To Table of Contents