GLOTV   Documentation

  Introduction

Primarily is this powerful PHP script designed as an Online Stream TV subscription platform, using the HLS live stream. However, the script can be equally well used to play all remote videos. The script will play the following types of videos: .webm, .mp4, .mov, .m4v, .ts, .ogv, .opus, .mkv, .mpd or embed.

The installation of this script "GLOTV - Global Online Stream TV Subscription Platform" 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.

  Installation

To install this script, simply follow the instructions below.

  • Upload and extract the compressed file main.zip to the root of your server.
  • Make sure that the folder content and all of its sub-folders are writable (Permission 755)
  • 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
  • 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 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!

  Features

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

  Add Custom Stream or Embed

You would rather add a custom stream or embed? No problem. Use the interface to "Add a TV Station" like User or lika Admin "TV Stations Management > Add a TV Station". User interface for Add a TV Stations enables or disables admin in script configuration.

  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, admin allows or denies users the ability to change the date of birth entered during registration in the script configuration. This has a major impact on NSFW.

  Report

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

  Subscription

User has the option to purchase a subscription and at 7, 30, 180 or 365 days. This subscription will release the user of the TV Station labeled "Subscription" to watch for that period. If a user has not purchased a subscription. These TV stations are played only for the time in seconds that the administrator has set in the script configuration.

  Script Configuration

Once you have successfully installed the script, you will be able to fully customize it before adding first live stream. Login as admin and in the "Admin" drop-down menu, you see the red "Web Administration" field. Clicking on this field will open the complete administration of this script.

  Configuration Management

This option contains two sections.

  1. Settings

    It contains these subsections.

    • General 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.

    • Application Settings

      Here admin enables or disables the basic functions that the script allows. Also very easy to understand, so there is not much to say more. Note: If you enable Subscription Platform in the "Payment Settings" section, you must enter the time in seconds in the "Timer if User is not a subscriber" field. The number of seconds determines how long the player will play for users without subscription.

    • Media Settings

      Also, this section is very clear and I think there is no need to extensively describe them somehow. Perhaps just a little thing: In section "Video Player as Defalt" you need to insert the JW Player and FludPlayer script links. Links where you get them are listed in that section.

    • Payments Settings

      Even this part is very intuitive. If you enable the "Subscription Platform". You need to set a default currency and pricing for each subscription type. The script uses the PayPal payment gateway. The PayPal configuration is discussed in the section     PayPal Configuration  below. If you have a PayPal configuration ready and tested everything in Sandbox. You are now ready to start PayPal Live.

    • Points Settings

      Very intuitive. No need to describe more.

    • Social Settings

      Very intuitive. No need to describe more. Just need to insert a link to ShareThis script with your own ID.

    • 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. Again very intuitive. Select Captcha type. Enter Public Key, Private Key, and Hash Key in Solvemedia. Or Captcha disable.

    • Users Settings

      Read the separate section     User Configuration  below.

    • Extra Settings

      Here are two settings. To send emails, the script uses php mail () as the default. If your server supports SMTP, fill in the required information. The second setting of "Reset Script" is very important. This will delete all media, comments, ratings, users (except the first user), notifications, reports, followings and all uploaded content. This is a great way to start fresh. Once you press that scary button, there is no going back!

  2. Languages

    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.

  PayPal Configuration

PayPal is the most popular payment service on the web so being able to integrate your website with PayPal’s Instant Payment Notification Service (IPN) is essential if you need to process payments through your website.

  Setup PayPal Account

  1. Sign up for a PayPal account if you don’t already have one. In order to use IPN, the Paypal account you are selling from must be a Business Account. and set up a new app by clicking “My Apps” on top right.
  2. Under 'My Selling Preferences' >> 'Getting paid and managing risk' >> 'Instant Payment Notification Preferences'. Set the IPN value to 'On'. Set the IPN URL to the PHP page containing the IPN code. (http://www.example.com/user/paypal)
  3. Under 'My Selling Preferences' >> 'Getting paid and managing risk' >> 'Block payments'. Block payments from users who pay with eCheque. (This is because these will not be instant payments).
  4. Under 'account information' >> 'email'. Note down your primary email address. This email will be visible to users so make it a professional one. User's may feel apprehensive about sending money to an e-mail address with the domain 'hotmail.com' or 'gmail.com' etc...

  Sandbox PayPal Testing

PayPal Sandbox offers all of the functionality of PayPal, but uses "Fake accounts" created by the developer within the sandbox. You can create fake buyer and fake seller profiles, then test your PayPal integration through your development website. Sandbox accounts can be created on the PayPal Developer website for free.

When testing with the sandbox we use the www.sandbox.paypal.com URL. For live payments we need to use www.paypal.com. Our example code is configured to use the sandbox, but you can switch it to live payments by changing $enableSandbox to false, this will update the URLs used to communicate with PayPal.

Once the payment process is ready to be used by real customers you will need to disable the sandbox mode in the code.

That’s it. You’re ready to start taking payments online through your website.

  User Configuration

Also, this section is very clear and I think there is no need to extensively describe them somehow. Below are a few important things.

  Birth Date

The script checks the age of the user based on the date of birth entered at registration. This option is enabled or disabled by the administrator in the script settings. Age control has a major impact on the playback of TV stations labeled NSFW, by a user under 18 years of age.

  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. 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.

  1. Go to https://developers.facebook.com and set up a new app by clicking “My Apps” on top right.
  2. Then click “Create New App”. Facebook will ask you to configure your app.
  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”.

  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.

  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. 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 728×90, 468×60 and 250×250.

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

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

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

However there are also two other slots. One that is reserved for video pre-roll and the other one video mod-roll advertisement.

  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..

  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
#Options -MultiViews
#Options -Indexes


	## Uncomment (remove # ONLY NOT ##) line below if installed in folder and add folder name after /
	## Example: Script is installed in /public_html/folder/ then it should be: Rewritebase /folder/
	## Then the files below should be (add slash to all): /index.php?action=$1
	## Uncomment the code below to Use PHP 5.4
	# AddHandler application/x-httpd-php54 .php

	RewriteEngine On

	## Uncomment the following line to use the multi-domain feature
	# RewriteCond %{HTTP_HOST} ^yourseconddomain\.com$ [NC]
	# RewriteRule ^(.*)$ http://yourfirstdomain.com/$1 [R=301,L]

	#Rewritebase /
	## Admin Panel
	RewriteCond %{REQUEST_FILENAME} !-d
	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteRule ^admin/(.*)?$ admin/index.php?a=$1 [QSA,NC,L]

	## Application Handler
	RewriteCond %{REQUEST_FILENAME} !-d
	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteRule ^(.*)?$ index.php?a=$1	[QSA,NC,L]


## Error 404 ##
ErrorDocument 404 /index.php?a=404