Documentation
LinkGEN - Monetized AdFly Clone PHP Script

Product by themeZO



Visit Our Portfolio


If you need any kind of help don't hesitate to Email. Thank you!

General

Thank you for purchasing this script. This template allows you to build, run, maintain, and customize your own monetized link shortener, similar to sites like AdFly or Shorte.st.

This documentation is intended to be a guide for installing, customizing, maintaining, and supporting your own LinkGEN installation. It will cover installation, using the administration panel, customizing aspects (such as developing your own theme), and more.

Please note that we do provide basic support for this script and your custom installation as long as it directly relates to your legally purchased copy of LinkGEN and concerns bugs and/or other issues. We do not provide support for 3rd-party themes, plugins, or your own script customizations.

Our code is fully documented and accessible. We do not provide free template customizations

Features

  • Social-Friendly
  • jQuery Driven With Fallback
  • Private Service
  • Anonymous User History
  • Easy Translation
  • Geotargeting System
  • URL Validation & reCaptcha Plugin
  • Full-Featured Administration Panel
  • Extensive Documentation
  • Short links with option for custom aliases
  • Ajaxed results for best user experience.
  • Ad system and adsense
  • Advanced Statistics (Referrer, Browser, Platforms).
  • QR Code for each shortened link.
  • Withdrawal System
  • Dynamic Pages
  • Publishers Panel
  • Payment Gateways
  • 24/7 Premium Support

Requirements

Step by step installation guide

  • PHP 5.6+ with crypt_blowfish and GD Library with freetype support enabled
  • MySQL version 4.0+ Database
  • 10+ MB Free Space
  • FTP Access
  • Write/Read Access (CHMOD777/755)
  • Apache Server with mod_rewrite enabled

Installation

Step by step installation guide

  • Connect to your FTP server
  • Upload the contents of the ‘Upload’ folder onto your FTP server
  • Ensure that .htaccess file is properly uploaded
  • To test that everything is working and you can access the uploaded files, visit http://yourdomain.com/index.php - even if you’re greeted with errors, the script is correctly uploaded!

Setting Up The Database

  • Create a new database for your LinkGEN installation in your hosting solution (e.g. cPanel) or manually (if installed on a VPS or dedicated server). Preferably, name it ‘linkGEN’ or similar.
  • In the ‘DB’ folder, make sure that ‘linkgen.sql’ exists.
  • In your MySQL administration panel (most likely phpMyAdmin), import the SQL file mentioned in Step #2. You can do this by directly selecting the file from the ‘Browse file…’ dialog under the ‘Import’ tab in phpMyAdmin and pressing ‘Go’, or you can manually copy-paste the SQL code from the file and paste it into the ‘SQL’ tab in phpMyAdmin or the mysql command line.
  • The following tables should now be installed (as of v.1.0):
  • As of the final release of v1.0, table 'plugins' is deprecated and is not necessary for the script to function properly
  • Your MySQL database is now ready. Next, you will need to connect your LinkGEN installation to the database. Make sure you have access to the following information related to your database:
    1. Database Host (most likely localhost)
    2. Database Username
    3. Database Password
    4. Database Name
  • In your uploaded LinkGEN files, find the file ‘db.configs.php’ located in the ‘includes/configs’ directory and
  • ensure you can edit it.
  • Starting at Line 16, replace ‘root’ & etc with your correct database info acquired in Step #6 and save the file on your server.
  • Visit your site again. You should not receive a ‘Connection to database failed’ error.

Changing the Base URL

  • The next step is critical for your linkGEN installation to function properly.
  • Access your database using your preferred MySQL administration tool and find the ‘settings_values’ table.
  • In the ‘settings_values’ table, find the setting named ‘Base URL’ with the slug ‘base_url’.
  • Change the ‘settings_value’ column to your base URL and ensure it is saved properly.
  • Your base URL is the full path in which the index.php is located. For example, if you have installed LinkGEN in the root directory of www.yourdomain.com, the base URL would be http://yourdomain.com/
  • Make sure that the base URL ends with a forward slash (/)!
  • You should no longer see errors when visiting your site, and linkGEN is now correctly installed!

Accessing the Admin Account

  • You can log into the default admin account using the following credentials:
  •     Username: admin
        Password: password
        
  • It is recommended you change this password after logging in for the first time!
  • The default login page can be accessed at http://yourdomain.com/login

Accessing the Admin Panel

  • The admin panel can be accessed only by users that are admins. The link to the admin panel is http://yourdomain.com/admin and can also be found in the top right corner of the ‘default’ LinkGEN template for users that are admins.
  • The admin panel allows you to change settings related to your LinkGEN installation, and view/edit/delete members, links, campaigns, withdrawals, and more.

Changing the Admin Password

It is recommended you change the admin password from ‘password’ to something a lot more secure. You can do this by visiting http://yourdomain.com/my_account while logged into the main admin account (username: admin).

Setting up a Payment Processor/Currency

  • Currently, the only supported payment processor for LinkGEN is PayPal.
  • To setup PayPal, ensure that you have a PayPal account.
  • In the admin panel, go to ‘General’, then the ‘Payment’ tab.
  • Ensure that ‘Use PayPal’ is checked.
  • Next, enter your PayPal E-Mail in the ‘PayPal E-Mail’ field towards the bottom of the page. Make sure to hit ‘Save’ after making changes.
  • This is also the part where you might want to select a currency for your site. The default is US Dollar, but if you are located somewhere else, you can change that. Please note if you change this setting in the future, any monetary values in the database will not be converted. Only the label (e.g. ‘$’ and ‘USD’) will be changed accordingly.
  • You can also change the appearance of monetary value on the site. See the ‘Currency Code Position’, ‘Currency Symbol Position’, and ‘Currency Symbol’ options for that.

Processing Withdrawal Requests

  • Processing withdrawals is a major aspect of a monetized link shortener. Please note that this script does not automatically process withdrawals. However, it makes it as easy as possible to manually process withdrawals.
    1. It is always a good idea to double-check withdrawals and check the validity of withdrawal requests before actually visiting PayPal.
    2. If your PayPal account has MassPay enabled, you can export MassPay files by going to ‘Withdrawals’, then ‘MassPay’.
  • Whenever a user requests a valid withdrawal, it will show up in the administration panel. Visit the administration panel and navigate to the ‘Withdrawals’ tab.
  • On the withdrawals page, you will see the most recently requested withdrawals. The table presents all the information necessary to check the validity of withdrawals and change the withdrawal status.
  • Once you have checked the withdrawal request, you can then manually send the funds to the given PayPal e-mail through PayPal (e.g. the ‘Send Money’ option on Paypal.com).
  • Lastly, ensure to mark the withdrawal as ‘Processed’ or as needed. This will let the withdrawal user know that the withdrawal is processed and that the funds have been delivered. If anything is incorrect, this will also allow the user to double check their request and try again.
  • Changing the status of a request will also notify the user through e-mail. You can edit the withdrawal e-mail templates located in ‘templates/admin_default/email’.

Making a Member an Admin

  • Admins are useful for maintaining the site, providing support, checking for spam, and processing withdrawals.
  • To make a normal member an admin, navigate to the admin panel and click on ‘Members’.
  • In the table, search for the member you want to make an admin (most likely by username).
  • Click the ‘Edit’ button on the right side in the member row.
  • For the field ‘Administrator?’, select ‘Yes’.
  • Make sure to assign Administrator permissions to the member. Assuming you have not renamed any permissions, select ‘Administrator’ for the ‘Permissions’ dropdown.
  • Hit ‘Update Member’ to apply these changes.

Shortening Links

  • The key aspect of any link shortener is to shorten links. linkGEN uses AJAX and jQuery as well as a small API backend to provide a fast and error-free link shortening experience. Links can be shortened on the home page or under the publisher dashboard. The template for the link shortening component is called ‘shorten_widget.tpl’ and contains the HTML and jQuery frontend. The backend for the link shortener is called api.php and is protected from unwanted API access.
  • To prevent users from spamming links, it is a good idea to turn on the 'Anonymous links require CAPTCHA verification’ option in the admin panel located under ‘Links’ and then ‘Settings’. This requires non-registered users to fill out a security code before being able to shorten links.
  • It is also a good idea to have a link posting ‘cooldown’ period. By default, it is 10 seconds for non-registered users, 5 seconds for registered members, and 0 seconds for any admins. To change this amount, visit ‘Members’ and then ‘Permissions’. Pick the permission you’d like to change and hit the ‘Edit’ button in its row. A new page should open. For the ‘Spam Waiting Time’ enter the time period in seconds the user has to wait between shortening links. If you do not want a cooldown period, simply type in ‘0’. Make sure to save these changes by hitting ‘Update Permission’.
  • The link shortener allows for advanced settings as well. As of 1.0, these settings include ‘Custom Alias’, ‘Ad Type’, and ‘Domain’.
  • ‘Custom Alias’ allows users to give their shortened links a custom name, e.g. alias instead of having a random string of letters and numbers for their shortened URL. You can turn off ‘Custom Alias’ for certain permissions in the admin panel under the ‘Members’ and then ‘Permissions Edit’ page (for example, only registered members can use a custom alias - this could be an incentive to get users to sign up for your site). You can change the minimum allowed length and the maximum allowed length of the custom alias under ‘Links’, then ‘Settings’. The length of the automatically generated suffix can be changed on the same settings page as well.
  • ‘Ad Type’ changes the type of ad that will be displayed once a user clicks on the shortened link. Users can choose between Interstitial, Banner, or No Ads. Interstitial Ads are full page advertisement, banner ads are smaller, and no ads simply redirects to the intended link. This can be turned off in the permissions for certain groups as well.
  • Users also have the option of selecting different domains if the default domain of the site isn’t fitting or they simply want something different. This can be turned off in the permissions for certain groups as well. See below on how to add alternative domains to linkGEN. Please note that if you do not have any alternative domains, the ‘Domain’ drop down will not appear in the shortener.

Setting up Alternative Domains

  • Setting up shortened domains is not difficult. You do not require a hosting plan with the alternative domain.
  • In your domain provider's administration panel, setup a redirect to your main domain (where linkGEN is hosted on). For example, if your main domain is http://linksho.rt, and your alternative domain is http://short.url, make sure that http://short.url redirects to http://linksho.rt.
  • You also have to ensure it is a WILDCARD REDIRECT (see screenshot below). Otherwise, the suffix will not be redirected to your main domain.
  • Most domain providers have this function visible and available.
  • In the admin panel under ‘Links’, ‘Domains’, click on ‘Add Domain’ and enter the new alternative domain. Ensure it ends with a forward slash (/)!

Using the Publisher Dashboard

The publisher dashboard allows publishers to create, manage, and view their shortened links and see how well they are doing.

The dashboard allows members to directly shorten links without visiting the home page. It also presents account information like username, account balance, and e-mail.

  • Total Earnings: Shows the total profit from all links
  • Total Views: Shows the total amount of views that each link received combined
  • Links: Shows the amount of links this member has shortened
  • Average CPM: Shows the average CPM (Cost Per Mille) that the member would earn per thousand views
  • Average View: Shows the cost an average view
  • Monthly Views: Shows the line bar graph (#10)
  • Top Countries: Top Ten list of the top ten countries where viewers are from
  • Top Referrals: Top Ten list of the top ten referral sites
  • Date Filter: Allows the member to filter the graph to a certain month and year
  • Line Graph: Shows a line graph based on the month and year selected in #9 with the total amount of views each day
  • Showing entries: Allows the member to change the amount of entries on the table
  • Search: Allows the member to search for specific links
  • Short URL: Shows the shortened URL in the table
  • Full URL: Shows the full URL in the table
  • Ad Type: Shows the type of ad (either interstitial, banner, or no ad) in the table
  • Views: Shows the total amount of views the link has received in the table
  • Profit: Shows the total amount of money the link has generated for the user
  • Statistics: Redirects to the statistics page
  • Delete: Allows the user to delete the link. Funds will not be lost.

Clicking on Statistics will present the same information as the ‘Statistics’ panel in the Dashboard, but for an individual link.

Basic Campaign Info

  • There are two types of campaigns:
        Interstitial
        Banner
      
  • In order for a campaign to be displayed, the following requirements have to be met:
  • The campaign's status is set to 'Running' and is approved (if this is turned on in the settings)
  • The campaign is successfully paid for
  • The 'Budget Used Today' does not exceed 'Daily Budget'
  • The 'Current Budget' is not zero
  • The amount of delivered views is smaller than the amount of ordered views
  • The user viewing the campaign is on the device specified (mobile, desktop, or both)
  • The user viewing the campaign is in the country specified in the purchased rate

If no campaign is found, no ads will be shown and the user will be immediately redirected to the link.

Rates & Percentages

Rates define different prices and locations that advertisers can purchase. For example, one rate named ‘US Package’ could be priced at 1.00 USD CPM with location ‘US’. This means, that if an advertiser purchases this rate, they have to pay 1 USD for every thousand views their campaign receives. Also, the campaign is then only displayed to visitors from the United States.

You can view, create, and delete rates in the administration panel under ‘Campaigns’, then ‘Rates’.

In the admin panel under ‘Campaigns’, then ‘Settings’, you can change the following percentages:

  1. Interstitial Ad Percentage (80% default)
  2. Banner Ad Percentage (75% default)
  3. No Ad Percentage (0% default)

Your share of profit from each valid view would then be: 100% - Publisher Percentage = Your Profit

Rates Pricing Reference

Here is an example for competitively priced rates that have proven to be effective:

Custom Localization

You can change the global site language under ‘General’ in the admin panel. You can turn off the language picker by unchecking ‘Show language picker’ and saving the changes. Languages are automatically discovered - simply place them in the ‘langs’ folder and ensure the filename ends with ‘.lang.php’.

Translation Files

In order to translate the whole main website (not the admin panel), linkGEN uses PHP language files. These files simply contain an array with the translations that are then used by the template and some core functions.

As of version 1.0, LinkGEN is prepackaged with an english translation file. Use this file as a template for further translations.

In order to add a new translation, simply copy the ‘english.lang.php’ file located in the ‘langs’ folder. Then, rename the file to ‘new_language.lang.php’, where new_language is the language of the new translation (e.g. ‘german.lang.php’ or ‘swedish.lang.php’). Please note that the name of the language in the file name is also the name that will be displayed in the language picker and the admin panel.

In your new language file, simply start translating by replacing the text in the quotes after each array item with the new translation.

For example, this is what it might look like for an English-German translation:

Original ‘english.lang.php’:

$langs[0] = 'Earn money by sharing links.';

$langs[1] = 'Get paid to share your links on the Internet!';

$langs[2] = 'Your link will be immediately shortened. Want to earn money while you are at it? ';

$langs[3] = 'Make money with links';

…

New ‘german.lang.php’:

$langs[0] = 'Verdiene Geld bei dem Du Links verteilst.';

$langs[1] = 'Werde bezahlt Deine Links im Internet zu verteilen!';

$langs[2] = 'Ihr Link wirdt sofort gekuerzt. Willst du Geld damit verdienen?';

$langs[3] = 'Verdiene Geld mit Links';

...

Translating Pages

Since pages are not stored in the language files but in the database, you have to translate them through the admin panel. If the language is different than the language that the page is stored as, the page will not be found. However, you can have translated pages with the same slug in order for the translated pages to appear when a different language is set.

For example, to translate the ‘about’ page, simply add a new page under ‘Pages’ in the admin panel. You can then translate the title and content, but make sure that for slug you put ‘about’, since this is the translation for the about page. For the language field, put the language of the translated page.

Creating your own Theme using Smarty

Creating your own theme requires knowledge of Smarty, a PHP templating engine. To get started, it is a good idea to copy the ‘default’ template folder and start from there. Refer to the Smarty Documentation to learn more.

Version history

v1.1 — First release

Support