1. Start
  2. Installation
  3. Application Setup
  4. Application Integration
  5. File Modification
  6. Closing Notes

ForumScript

Forum Application for Facebook


Thanks for purchasing ForumScript! Please check CodeCanyon often for free updates and new scripts! This integration guide will help you get your new application (or modification of) set up quickly and as hassle-free as possible. Please, do not hesitate to send me an email if you have any questions!

Installation


Introduction

This section will help you create a new application on Facebook.
 

Uploading

The software comes in a ZIP package.  Simply unzip the package and upload the contained folders to a directory of your choice on your server.  You do not need to upload the SQL file to your server.

If you are installing the software to work with an existing application, upload the package contents to the directory containing your application.

You need to import the SQL file to your MySQL database.  If you are using phpMyAdmin, there should be a handy button on the top navigation menu that says 'import'.  Use this to import the SQL file.

You may now move to the section Application Setup.

Application Setup


Introduction

This section will help you create a new application on Facebook.  Before proceeding further, please log into your Facebook account.  If you are planning to integrate the software into an existing application, you may skip this section entirely.
 

The Facebook Developer Application

If you have never set up an application on Facebook before, you will need to add the Facebook Developer application.  This can be accessed at http://www.facebook.com/developers.  Once you allow access to the application, you can continue.
 

Application Creation

You can now create your new application.  Firstly, insure that you are on this web page: https://developers.facebook.com/apps.

In the top left corner of your viewport, you will see the +Create New App button.  Click on the button to begin creating a new application.  You can then choose your application's name and language.  You must also agree to the Facebook Terms before creating your application.  Once you have chosen your application's name and language and accepted the Terms, click continue.
 

Editing Basic Application Settings

Once you have passed the security CAPTCHA, you will be able to edit your application's settings.  While I will explain what some of the items in the settings area are, you should take the time to explore what all of these settings do at a later date.

Firstly, you can add an application icon.  It is a small, 16x16 pixel image that will appear next to your application in a user's bookmarks once they have added the application (for quick and easy access).  Simply click 'edit icon' to add your own icon.

The next settings appear sequentially down the page:

  1. Application Display Name - The name of your application displayed to users.
  2. Application Namepace - This is the namespace used for your application on the Open Graph and the Facebook Canvas.  This will appear in the URL to your application.  Make it short and simple.  Example: http://apps.facebook.com/NAMESPACE/.  Do not include anything but the Namespace in this setting (not the full URL).
  3. Contact Email - Primary email used for important communication related to your application.
  4. Category - Select a category from the drop-down menu that best describes your application.


The next section of the settings asks you to select how your application integrates with Facebook.  Forumscript is meant to be displayed on the Facebook Canvas.  Select App on Facebook as the proper setting.

You need to enter data for both the Select Canvas URL setting and the Select Secure Canvas URL setting.  The only difference between the two is that the secure setting should begin with https:// and the normal setting should start with http://

Enter the web path to your ForumScript folder on your server for both settings.  An example: http://www.mysite.com/forumscript/ & https://www.mysite.com/forumscript/

Keep in mind that you must have an SSL certificate for your server for the script to work. Facebook is requiring this on all canvas applications. You can find a free SSL certificate provider at http://www.startssl.com/. You will need to work with your hosting service to properly add the certificate to your server. I will not be able to help you with this.
You may now save your changes.

Editing Advanced Application Settings



To the left-hand side of your viewport, you will see two navigational buttons - Basics and Advanced  You have been completing the Basics part of the settings.  You can now click on Advanced to finish your application setup.

Most of these settings you should not be touching.  They are already set to the proper setting.  I will explain a few of these settings, though.  In the future before you decide to change any setting, please read up on all of these available settings before changing any of them.  If I do not mention a setting here, you have no need to alter the setting.

  1. Sandbox Mode - Sandbox mode allows you to develop your application in your top secret lair (Facebook just hides it from other users).  This of course, would let you develop your application without intrustion by other users.  While you can turn this setting on, no users will be able to visit your application - they won't even be able to find it!
  2. Canvas Height - I do want you to change this setting.  It should be set to the Settable setting.  This means that the size of the Canvas will be adjusted dynamically and automatically, rather than showing those ugly scrollbars.
  3. Privacy Policy URL - This is the web path to your application's privacy policy.  While I can not give legal advice about creating this document, look around the web for others if you do not have your own.  This is a must and your application will not function without one.
  4. User Support URL - This setting need only be used if you have a specific website you would like users to visit for help regarding your application.

You may now continue to the section File Modification.

Application Integration


You should only be following instructions in this section if you are integrating the software into an existing application on Facebook.  You will need some knowledge of PHP and HTML to continue.

You will do some file modification in this section.  I've put this modification into this section so that it is not confused with other modifications in the next section.  I'll explain this as clearly as possible.  Whenever I mentioned the word application, I am referring to your actual application you are integrating into - not ForumScript.  Take your time and ensure you follow the steps correctly.

First, you need to modify your application's index.php file.  Take note, this is not ForumScript's index.php file, but the application's file which you are integrating ForumScript into.

Above absolutely all other code (except PHP starting and ending tags), add this:

  if(isset($_REQUEST['forum']))
  {
    $app_info['forum_path']="forumscript";
 
    require $app_info['forum_path'].'/index.php';
 
    exit();
  }

You will need to modify the $app_info['forum_path'] variable.  It should be set to the relative web path from your application's (not ForumScript's) index.php file to ForumScript's index.php file.  Do NOT include slashes on the front or end of the variable.  It is generally best to have ForumScript uploaded to the same directory as your application's index.php file, so that the relative path is what I have provided.

Now, you need to open the index.php file for ForumScript.  At the very top, you'll find the same variable as above.  The two should be exactly equal.  You will find you need to enter this variable a third time in the next section.  All three variables are the same and should equal the same value.

The last thing you need to do is ensure that the PHP SDK will be correctly loaded.  I have included this folder inside the zipped package.  The PHP SDK is relatively pathed from ForumScript's fb_init.php file like so:

  require '../fb-php-sdk/src/facebook.php';

ForumScript is included through your application's index.php file, which means the path to the SDK might not be accurate depending on the application file's location.

If you are already using the latest PHP SDK, you can replace the relative path in fb_init.php with the same one from your application's index.php file.

If you are not using the PHP SDK inside your application's index.php file, the best solution is to upload the SDK to the parent directory of your application's index.php folder.

For example, if the path to your application's index.php file is site/folder/app/index.php then you would upload the SDK folder to site/folder/.  The final path to the SDK folder would be site/folder/fb-php-sdk/.


Once this is done, you can continue to the File Modification section.  Keep in mind that you'll need to enter data that corresponds to your current application, not a new one.  You will also need to provide a way back to your application from the forum.  I plan to add this in a future update, I just did not find a way that particularly satisfied me.

File Modification


Editing Files

You will need to edit a single file.  You can do this before or after uploading.  Open the file masterfile.php.  While there are comments in the file to help you, I will explain what to edit here as well.  You will get most of this information from your application settings.

$app_info['admins'] -This is a comma-separated array of Facebook user ids for administrators to the software.

$app_info['id'] - This is your application's identification number.  To find this, visit https://developers.facebook.com/apps and view your application's information.

$app_info['secret'] - This is your application's secret key.  It is found in the same location as your application's identification number.

$app_info['forum_title'] - The title of your forum.  You can enter HTML and even use a small image if you choose.

$app_info['namespace'] - This is the namespace of your application. If you are integrating the software as an add-on, make sure to list your application's namespace that you are integrating into.

$app_info['color_scheme'] - Determines the colorscheme of the forum.  Any number between '1' and '8'.

$app_info['copyright_notice'] -  This is the copyright notice at the bottom left of the app.

$app_info['referral'] - Enables the referral text on the bottom right of the app.  '1' to enable, '0' to disable.  While enabled, you'll earn referral income from the script.

$app_info['cc_username'] - This is your CodeCanyon username, used in referrals back to the script.

$app_info['bbcode'] - Enables the use of BBCode within the app.  '1' to enable, '0' to disable.

$app_info['use_path'] - If you are integrating the software as an add-on, this should be enabled with 1. If you are integrating the software as a stand-alone app, this should be disabled with 0.

$app_info['forum_path'] - You can ignore this if you are integrating the software as a stand-alone application. If you are integrating the software as an add-on, this needs to be the same web path you used in the Application Integration section.

All other variables should be self-explanatory.  You may now continue to the final section.

Closing Notes


Your application should be set up and running at this point.  I'll take a minute to explain a few things about the forum for you.

Administrators have access to the admin panel, available from the very top menu.  you can see your forum's usage insights and modify the boards within your forum.

Everything else should be easy to figure out.  If you've enabled BBCode in your forum. you can click the BBCode button when posting a new topic or reply and when editing to see how to implement the code.

I hope you enjoy the software as I've put a lot of effort into it.  If you find any bugs or require assistance, please send me an email through CodeCanyon or to phillip.rock@rosenrotproductions.com.

Thanks for purchasing!