Text Link Ads (TLA) in Textpattern
Text Link Ads (TLA) is an advertising system for your Web sites. This guide explains to you how to install it in a weblog or Web site managed with Textpattern.
Introduction
Text Link Ads is a an advertising system for Web sites. It is not a contextual system (it doesn’t adapt to the content of your pages). The advertisers select your site to put a link to their Websites. They pays you a given amount for this.
The most remarkable characteristics of TLA are:
- It is compatible with Adsense. You can put both systems in your Web site without violating the policies of adsense nor TLA.
- You can choose which links appear in your site, with a pre-approval system.
- The earnings are proportional to the popularity of your Web site (measured using PageRank and Alexa traffic).
- You receive 50% of the advertiser’s payment. TLA networks receive the other 50%. You can receive the payment by check or using your Paypal account.
How to put TLA in your Textpattern
1. Become a member
Go to Text Link Ads and sign up into the system. (Note: This is an affiliated link, I will be happy if you sign up using it) You must create a “Publisher” account.
2. Submit a site

Go to “Submit a site” a submit your site. You need to answer some questions about your site: URL, description, ...

You will receive an email when your site is approved.
3. Get the PHP code
Select “Install ad code”. Select the site where you want to install TLA. Click “Get Ad Code”.

Step 1: Select “PHP” as language.

Step 2: Select how the links will be presented: number of links in a row, colors, ...

Finally, you will get the PHP code you need to install in textpattern. Go to step 4 in this tutorial to know how.

4. Create the xml file
Create the xml file you obtain in the previous step. In out example the file is named local_72096.xml but it will be named different in your site.
How to create the xml file?
If you have shell access to your hosting, you need to go to the root of your website and execute:
touch local_72096.xml
chmod 666 local_72096.xml
Remember: The file’s name will be different in your site.
If you don’t have shell access, you need to create an empty file in your PC with that name (use notepad or any other program). You can also download this xml file. Remember that you need to change the file’s name.
Use your favorite FTP program to upload the file to your website’s root directory. Go to the file’s properties (in the FTP program) and give reading and writing permissions to the owner of the file, to the group and to “others” users.
5. Install the code in Textpattern
Create a new form in Textpattern. Name it text_link_ads and copy in it the php code obtained in step 3. Substitute the first line with <txp:php> and the last one with </txp:php>.
An example of the form:
<txp:php>function tla_ads() {// Number of seconds before connection to XML times out // (This can be left the way it is) $CONNECTION_TIMEOUT = 10;...........................$retarr[$out[$n][1]][] = str_replace($ $n++; } return $retarr; }tla_ads();</txp:php>
This example is only the start and the end of the form. You don’t have to copy and paste this code. You have to copy the code obtained in step 3.
If you obtain a server error when you save the form, use this alternative method:
- Create a new file “text_link_ads.php” in the root of your website. The content of this file should be the code obtained in step 3 verbatim.
- Create the text_link_ads form with this content:
<txp:php>
include "text_link_ads.php";
</txp:php>
Go to your default page (or any other managing the layout of your website). In the place you want the links inserted, put the following code:
<txp:output_form form="text_link_ads"/>
6. Test it
Go to your website with your browser. You must see a test link. This test link will be deleted after 24 hours. You will receive an email indicating the code is successfully installed.
7. Profit
After days or weeks, you will receive advertisers. Start growing your fortune :-)


19 febrero 2007, 18:20
Great step by step tutorial. Immediately sent to my del.icio.us account :-)