## Table of Content

- Introduction
- + Quick Guide
  - Installation
  - Upgrading
- Features
- + Settings
  - General
  - Application
  - Security
  - Media
  - User
  - Advertisement
- Themes and Editors
- + Tools
  - Sitemap
  - Digest
  - Export
  - Optimize
- APIs
- Frequently Asked Questions
- Back to Top

## Introduction

Thank you for purchasing this awesome script! This documentation will help you get familiar with this script. Please don't forget to leave this script a good rating and we would really appreciate if you can also leave us a good rating. If this script did not meet your expectation, please before leaving a low rating, contact us and hopefully, we can fix any issues you are having.

An up-to-date documenation is available online 24/7 and can be access via our portal.

### Useful Links

Customer Portal

Follow us on Envato

Follow us on Twitter

Like our page on Facebook

Dedicated Support Portal

### License (learn more)

Two types of license are available: Regular or Extended. If you are using this script for multiple websites, you must buy a license for each of them.

Items purchased under a Regular or Extended License may NOT be redistributed or resold "as-is" or as part of any other collection of image resources or files. You do not own the software but simply own a license to operate it therefore the author of this item has full rights on this item.

#### Regular License Examples (from Envato)

The Regular License could be used for the following:

- Single website (commercial, personal, or non-profit).
- Single website for a client (commercial, personal, or non-profit).
- Single intranet site project.

#### Extended License Examples (from Envato)

The Extended License could be used for any of the following:

- An online service where the file can be displayed on multiple users' pages.
- Part of a software package for sale.

### Support

If you stumble upon an issue or if you need help you may contact via my codecanyon profile and I would be happy to help you.

## Quick Guide

The installation of this script is very trivial. Simply follow the instructions below and you will be ready to launch your new media site in about 5 minutes from now.

1. Upload and extract the compressed file main.zip to the root of your server.
2. Make sure that the folder content and all of its sub-folders are writable (Permission 755)
3. Point your browser to your site and you should be redirected to the installer. If not point your browser to http://yoursite.com/install.php
4. Once on the installer, read and follow instructions as the installer will guide through the installation of this script.
   - On the Database Configuration page, the field Database Prefix is optional. Fill this only if you have multiple tables in the same database
   - The field Server Timezone is the timezone of your server! This is used to provide accurate consistent time server-wide. If you don't know your server's timezone, you can pick anything then change it later via the file includes/Config.php
   - The Security Key is a random string that is used to encode data with. This should not be changed after the installation.
   - Note If you get blank page in step 3 then the script was not able to open the file includes/Config.sample.php or it wasn't able to rename it to includes/Config.php. You will need to do this manually!

### Upgrading (click here for more info)

All upgrading instructions are detailed in "upgrade.html" located in the same folder as this file. Simply open that and follow the instructions according to the version of the script. Please note that some update may require you to replace all files while others only a couple of files. In both cases it is strongly recommended that you first backup all your existing files and download it to your computer.

Click here for detailed upgrade instructions.

## Features

Here is a glimpse of some of the most awesome features this script has to offer.

### Import. Import. Import.

Import what ever you want and however you want. A lot of effort has went into the import system so you can import anything from some majors sites like Youtube, Vine, Vimeo, Dailymotion, etc. Here is how you can import media.

1. Import using the URL to the video
2. Import using the Bookmarklet that is found in the admin panel > Import a Single Video
3. Mass Import from Youtube using the live admin interface

### Add Custom Media

You would rather upload a custom media? No problem. Use the interface to upload video and image files of the following format: mp4, jpg, png and gif. Please note that this script doesn't convert videos nor does it generate thumbnails from videos!

### Featured and NSFW

You can tag a media file as featured and/or NSFW to make them stand from other media. Featuring a video will prioritize that video while tagging it as NSFW will prevent users who have NSFW option disabled to view them. Regarding NSFW, you will have to make sure that you add the minimum age required to register in your TOS because if a user registers they will have access to NSFW content.

### Report

Registered users can report any content. Whether it is a media file, user or comment, it can be reported. You will be able to moderate reports via the admin panel.

### Categories and Types

One of the most important feature of this script is the ability to assign a type. Assigning a type to media makes a big difference so you have to make sure to properly assign it. For example don't assign a picture the video category or vice versa. The built-in types are video, music, vine and picture. This gives you the ability to run a one-script-multimedia-site with ease. You also have to properly assign a type of the categories.

### User Profile and Subscription

User can subscribe to each other and receive notification when there is a new media.

## Script Configuration

Once you have successfully installed the script, you will be able to fully customize it before importing/adding media. Login as admin then you will see your own admin bar at the very top of the script. This admin is dynamic meaning that the content will change depending on which page you are. Look at the right side to find Configuration and click that to configure the script.

### General Settings

Under this tab you will find all of the important settings you will need for your site. Fill these as you wish. Notice the email field is used for many things. It first of all used as the sender when the script sends an email. So you will want to make sure you provide a good email. Also filling the social links will activate sidebar widgets. Please make sure that the link you provide is working and is of the proper format.

### Application Settings

This tab groups the main settings you will need to customize your site. Their function is very easy to understand so there is not much to say more. Notice the "Blacklist Words" field as this is used to filter bad words and replace them by an asterisk *. You will need to separate words with a comma. Example badword1,badword2,badword3

### Security Settings

You can enabled catpha to prevent bots from creating accounts or submitting forms. To do so you have options: reCaptcha or Solvemedia. reCaptcha is a very popular captcha system provided by Google. It is free and you can use you Google account to create keys. Solvemedia is another alternative however this system allows you to monetize on captchas. Once you create your account they will give three keys. You will need to add those keys in the file includes/library/Solvemedia.php.

### Media Settings

These settings allows you to change how media looks and upload settings. The display mode setting will switch the script from being a more Youtube-style to a 9gag-style.

#### Local Thumbnails

This a very important setting so you will want to clear your mind on whether you want to store them locally or link to them. You must not change this after your have upload/imorted your first media! All thumbnail are stored in the /content/thumbs folder.

#### Maximum Upload Size

This is another important setting. The maximum upload size is determined by your server configuration. Look under this field to determine what is your maximum upload limit. Note that if you set a size higher than this, the script will set the lower limit as the size limit. Example if you set 100MB and your server's limit is 10 MB then the script will set it as 10 MB.

## User Configuration

### Facebook Connect

You will notice that Facebook connected has now been integrated to this application. Users can now login with their Facebook and bookmark their favorite sites. To set up your app, first go to https://developers.facebook.com and set up a new app by clicking "Apps". Then click "Create New App"; Facebook will ask you to configure your app. The most important fields you must fill out are App Domains and Site URL. Following that Facebook will generate two keys for you. Go to admin settings and paste those keys. That's it. If you did everything correctly Facebook connect should work.

### Twitter Connect

In this version, twitter connect has been added. Now users can login using twitter the same way they use Facebook. You must enable twitter connect for it to appear and function. You can do that on the admin panel. You must register your website on Twitter.com.

#### Instructions

1. Go to https://dev.twitter.com/apps and Login.
2. Then click "Create a new application" on top right
3. Fill the required fields (with a start next to it), add this to the callback field: http://YOUSITE.com/, accept the terms and conditions and click "Create your Twitter application".
4. You will then be redirected to a page with your OAuth Settings
5. Search & Find two keys: Consumer Key and Consumer Secret Copy these keys and paste them in admin settings
6. Finally, under "settings" of your application on twitter you will see "Allow this application to be used to Sign in with Twitter". Check that and click "Update this twitter application's settings".

If you did everything correctly, Twitter OAuth should work. If it doesn't, send me an email and I will help you.

### Google Connect

Google connect protocol has been changed due to restrictions from Google. For this reason you will need to set up Google connect again. Simply follow the instructions below and it should be fairly simple.

1. Go https://code.google.com/apis/console and login using your Google Account
2. On the left side click "Credentials"
3. Then click "Create new Client ID" to open the popup
4. Select "Web Application"
5. Add your domain name as "http://yourdomainname.com" under Authorized Javascript Origins
6. Add the URI to Google Connect under Authorized Redirect URI as "http://yourdomainname.com/user/login/google"
7. Also make sure to create your Consent Screen

## Advertisement Configuration

This script allows you to add any advertisement code you wish and it will display it wherever it fits. You can also enable or disable ads with a single click. The three main sizes are 728x90, 468x60 and 300x250. However there are also two other slots. One that is reserved for video pre-roll and the other one should be a responsive ad because it will be shown on mobile platforms. Notice if you empty the preroll ad then it will not show up otherwise it will show before the viewer is able to click play. You can also change the time the viewer has to wait before being able to play a video.

You can easily display any of the ads anywhere you want to by using the following php code:

    <?php echo $this->ads('SIZE'); ?>

where SIZE can be any of the following: 728, 468, 300, rep

## Themes and Editors

This script comes with a powerful yet easy theming system that allows you to easily modify the theme or create your own. It also comes with a powerful theme editor and translation generator.

### Themes

You can easily activate any themes in the admin panel by just clicking the activate button. If you want to build your own theme but don't want to touch the default theme, just clone it and activate it.

### Theme Editor

You can use the the theme editor to directly edit any of the theme files very easily. You also get a powerful code editor built-in so you can safely code your way to success. As a side note, you should not be editing the PHP in the theme. The PHP code is formatted in a black color so you can easily identify it.

### Translation Generator

You can easily translate the site to any languages you want by using the built-in language editor. Simply open the generator and translate each strings. Make sure to save periodically in order to prevent loss of data.

### Plugins and Functions (Beta)

This script includes a powerful plugin API so you can extend the script without having to touch any of the core files. This feature is currently in beta and the API documentation will be available after the script has been released.

## Tools

The script comes with a couple of tools to allow you to maintain your site.

### Sitemap

Sitemaps are an important strategy for you to get indexed quickly. Use this tool to generate an XML sitemap and then submit it search engines. Notice that the script will automatically ping Google and Bing to index the main sitemap once you generate it.

### Digests/Newsletters

This script allows to you send automatic digests and newsletters to your users by using this tool. Digests are a summary of new media on your site. Note that if you abuse this tool you will be in trouble with either your host or spam databases! So it is recommended to not use this too often.

### Export Data

If for some reason you want to export your users' list, you can use this tool. This allows you to define what you want to export. Simply follow the instructions.

### Optimize Database

Optimizing database should be a thing you do regularly as it is inevitable for data to get lost. This tool will optimize the database and remove old notifications..

## APIs

The script now comes with custom API system that enables only the admin to develop app. First you need to enable the API system via the admin panel under "Social & API Settings". Then you will be able to define a custom API key which you can use to grab media. For all requests, you need to send the key parameter which includes your API key.

### Media EndPoint

This endpoint allows you to retrieve information regarding a particular media. The endpoint is

`GET /api/view/UNIQUEID`

Example: http://yoursite.com/api/view/abcd5?key=YOURAPIKEY

Results Example

    {
       "status":"ok",
       "data":{
          "id":"jezQH",
          "url":"http:\/\/mysite.com/view\/don-omar-taboo\/jezQH",
          "title":"Don Omar - Taboo",
          "description":"Download now on:\niTunes: http:\/\/bit.ly\/1emlRdS \nAmazon:  http:\/\/amzn.to\/17xXn96\n\nVisit http:\/\/universalmusica.com\/donomar for more music and news from Don Omar.",
          "duration":"293",
          "votes":"1",
          "views":"11",
          "likes":"1",
          "comments":"2",
          "embed":"<iframe src='http:\/\/mysite.com\/embed\/jezQH' frameborder='0' width='550' height='350' scrolling='no' allowfullscreen><\/iframe><p><a style='color: #000; text-decoration: none;' href='http:\/\/mysite.com\/view\/don-omar-taboo\/jezQH' title='Don Omar - Taboo'>Don Omar - Taboo<\/a><\/p>",
          "author":{
             "name":"Admin",
             "link":"http:\/\/mysite.com\/user\/admin"
          }
       }
    }

### Search EndPoint

This endpoint allows you to search media. The endpoint is

`GET /api/search/KEYWORD`

Example: http://yoursite.com/api/search/KEYWORD?key=YOURAPIKEY&limit=RESULTSPERPAGE&order=[views or date or votes]&page=CURRENTPAGE

Results Example

    {
       "status":"ok",
       "results":10,
       "prev":4,
       "next":null,
       "data":[
          {
             "id":"8UDm4",
             "url":"http:\/\/localhost\/ems\/1.5\/view\/mcdonalds-excorcism-prank-ownage-pranks\/8UDm4",
             "title":"McDonalds Excorcism Prank - Ownage Pranks",
             "description":"This is a second call I did to a McDonalds manager who used to be a crack head. The last time I spoke to him he said he could remove the devil from my soul.. so this time I called back and took him up on his offer.. lmao\n\n\nBecome my facebook fan! I pre-release my videos on facebook, so you&apos;ll see them before they appear on my YouTube profile (The facebook version is uncensored)  http:\/\/www.facebook.com\/OwnagePranks\n\nRegister and join the community @ http:\/\/www.ownagepranks.com\n\nFollow me on twitter! http:\/\/twitter.com\/OwnagePranks\n\nIf you do all this you&apos;ll definitely catch my next live show!\n\nComment and subscribe!",
             "duration":"325",
             "votes":"0",
             "views":"0",
             "likes":"0",
             "comments":"0",
             "embed":"<iframe src='http:\/\/localhost\/ems\/1.5\/embed\/8UDm4' frameborder='0' width='100%' height='450' scrolling='no' allowfullscreen><\/iframe>"
          },
          {
             "id":"PwRoR",
             "url":"http:\/\/localhost\/ems\/1.5\/view\/insane-cheating-girlfriend-prank-animated-ownage-pranks\/PwRoR",
             "title":"Insane Cheating Girlfriend Prank (animated) - Ownage Pranks",
             "description":"I called a black guy as Tyrone and pretended like I&apos;ve been cheating with his long-term girlfriend. His reaction is amazing. Help support these animations by sharing the video with a friend! :) Subscribe for free to catch my future videos - http:\/\/own.ag\/youtube\n\nSecond Channel Reveal (Part 2) - http:\/\/own.ag\/eN\n\nIndian Windows Scammer Prank - http:\/\/own.ag\/cJ\nRidiculous Home Buying Prank - http:\/\/own.ag\/dD\n\nFacebook--------------------- http:\/\/facebook.com\/OwnagePranks\nTwitter ------------------------ http:\/\/twitter.com\/OwnagePranks\n2nd channel \/ Extras ---- http:\/\/youtube.com\/MrOwnagePranks\nMerchandise ---------------- http:\/\/ownagepranks.spreadshirt.com\n\nAnimated by Sam T - http:\/\/youtube.com\/EbolaWorld",
             "duration":"264",
             "votes":"0",
             "views":"0",
             "likes":"0",
             "comments":"0",
             "embed":"<iframe src='http:\/\/localhost\/ems\/1.5\/embed\/PwRoR' frameborder='0' width='100%' height='450' scrolling='no' allowfullscreen><\/iframe>"
          }
       ]
    }

### User EndPoint

This endpoint allows you to get a user's media. The endpoint is

`GET /api/user/USERNAME`

Example: http://yoursite.com/api/user/USERNAME?key=YOURAPIKEY&limit=RESULTSPERPAGE&order=[views or date or votes]&page=CURRENTPAGE

Results Example

    {
       "status":"ok",
       "results":142,
       "prev":0,
       "next":2,
       "author":{
          "name":"",
          "description":"We have the best videos every! Sit back and enjoy our videos!",
          "cover":"http:\/\/localhost\/ems\/1.5\/static\/covers\/cover-1.jpg",
          "avatar":"http:\/\/localhost\/ems\/1.5\/content\/users\/JOjSxejI_avatar.jpg"
       },
       "data":[
          {
             "id":"jezQH",
             "url":"http:\/\/localhost\/ems\/1.5\/view\/don-omar-taboo\/jezQH",
             "title":"Don Omar - Taboo",
             "description":"Download now on:\niTunes: http:\/\/bit.ly\/1emlRdS \nAmazon:  http:\/\/amzn.to\/17xXn96\n\nVisit http:\/\/universalmusica.com\/donomar for more music and news from Don Omar.",
             "duration":"293",
             "votes":"1",
             "views":"11",
             "likes":"1",
             "comments":"2",
             "embed":"<iframe src='http:\/\/localhost\/ems\/1.5\/embed\/jezQH' frameborder='0' width='100%' height='450' scrolling='no' allowfullscreen><\/iframe>"
          }
       ]
    }

### Youtube and Vimeo API Key

### Google API Key

1. Login with your Google Account at https://console.developers.google.com
2. Fill the credetials page
3. Follow images below
4. Then paste your API code in the admin panel.

### Vimeo API Key

1. Login with your Vimeo Account at https://developer.vimeo.com
2. Follow images below
3. Then paste your API code in the admin panel.

## Frequently Asked Questions

### The installer is stuck at step 3 and I am seeing a blank page.

Although this can be caused by many reasons, a common cause is that the script was not able to open and write in the file includes/Config.sample.php. Open this file and check if your DB info has been saved. If not manually replace the placeholders (like RHOST,RUSER) by the actual info. Another reason you may see a blank page at step 3 is that the script wasn't able to rename the file includes/Config.sample.php to includes/Config.php. You will need to do this manually.

### The time is showing as a negative or huge value.

If the time is shown correctly then that means your server's timezone was not set correctly. You will need set the correct timezone to fix this. To set the timezone, open the file includes/Config.php and add your timezone on right side of arrow. You can get your timezone from https://php.net/manual/en/timezones.php.

### I keep getting a 404 page whenever I click on something.

If you get a 404 page (the one generated by your server) then that means you did not upload the file .htaccess or your server doesn't support the mod rewrite module. If you did not upload the file .htaccess then you will need to upload to the root of your server. If for some reason you cannot see that file in the package, you will need to create that file using cpanel's editor (or equivalent) to create a new file named .htaccess and put the following code in it.

    AddType video/mp4 .mp4
    RewriteEngine On
    Rewritebase /
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^admin/(.*)?$ admin/index.php?a=$1 [QSA,NC,L]
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)?$ index.php?a=$1	[QSA,NC,L]
    ErrorDocument 404 /index.php?a=404