TextpatternMania

Text Link Ads (TLA) in Textpattern

Text Link Ads

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 :-)

Comentarios
1 Markus Merz
19 febrero 2007, 18:20

Great step by step tutorial. Immediately sent to my del.icio.us account :-)


2 Juanjo Navarro
22 febrero 2007, 01:39

Thank you, Markus. I hope this is useful.


3 marios
25 febrero 2007, 01:55

Sorry, if I didn’t mail first.
Is it ok, if I post a link to your tutorial in the textbook wiki ?
( Thanks also for writing this )

regards, marios


4 Juanjo Navarro
25 febrero 2007, 22:09

Marios, of course. You can link this tutorial from the textbook.


5 Sven
5 marzo 2007, 04:49

Just a few weeks ago I’ve implemented it the same way. In some cases (e.g. mine) it’s a nice addition to wrap the textlinkads form in chh_if_data tags. that way txp delivers some alternative content when there are currently no link ads for your site.


6 Juanjo Navarro
5 marzo 2007, 10:43

Sven, thank you, is a good addition. :)


7 Sundar
4 abril 2007, 08:09

Hello sir,
read your tutorial, but i still cant install the codes properly, i have added the codes by creating the local XML file and added to call it on my site, but nothing is displayed on my site.why, am i doing anything wrong, could you please guide me personaly, please give me your msn or yahoo id and give me a time when you would be online. Thanks


8 Effi
5 mayo 2007, 04:49

Hi, thanks for the great tutorial. I added Text Link Ads today, and your tutorial is very helpful. Keep good work!


9 Thale
15 mayo 2007, 13:10

Thanks for help, very useful tutorial!