In this second part of a three-part tutorial covering phpAdsNew, you will learn more about the features of the "Publishers" and "Advertisers" module, as well as a convenient way to integrate phpAdsNew with multiple websites, and more.
In the first part, I showed you how to display banners on your website using the "local" mode. This works well when you have installed phpAdsNew at a location relative to the root folder of your website. Needless to say, this doesn't work under our new set up!
Since we have installed phpAdsNew under the root folder of your Web server (and not the website), you’ll have to opt for the "Remote Invocation for JavaScript" method. Sounds confusing? No problem; we'll do this step-by-step.
Navigate to the "Zone overview" sub-section of phpAdsNew under the "Publishers & zones" section. Here you’ll notice that there is a link titled "Invocationcode" for each zone in the listing.
Let’s assume that you have two zones for a particular "publisher" (a.k.a. website), a horizontal "IAB Leader Board (728 x 90)" zone and a vertical "IAB Skyscraper (120 x 600)" zone.
Click on the link for each zone to view the following screen:
From the drop down, select the "Remote Invocation for Javascript" option. Next, you’ll notice the same parameters that I’ve discussed in part one. Let me inject a little note of caution here; you may want to enable the display of more than one banner from the same campaign if you have multiple banners types for a single advertiser, as in our case.
Next, click on the "Generate" button to generate the code snippet that you need to insert into your PHP scripts or HTML code. Take a peek at the following code listing that integrates the code snippet in a sample PHP script (say "index.php"):
Load this example in your browser to view the following output:
As you can see, this was pretty easy; a simple cut-copy-paste operation was all that was required to integrate the banners with your website. Furthermore, you do not need to worry about some complex PHP code, as was the case with the "local" mode of invocation.
Conclusion
That’s it for this part of the phpAdsNew tutorial. Let me give you a quick review of the topics that I covered in today’s article. I gave you more information about the add-on features of the "Publishers" and "Advertisers" modules, which should help you to fine-tune the application to meet your requirements. Next, I showed you how to configure Virtual Hosts on your Apache server, so that you can install phpAdsNew at its own unique URL. Finally, I showed you how to use the "Remote Invocation for Javascript" method to display banners, which helps you to integrate phpAdsNew with multiple websites on the same server, as well as any third-party website (on another server).
In the concluding part, I promise, I will throw light on the less attractive - but more important - "Statistics" and "Reports" sections of the tool. I will also show you how to reconfigure phpAdsNew from the "Settings" section.
Till then, stay healthy!
Note: All examples in this article have been tested on Linux/i586 with Apache 1.3.12, MySQL 3.23 and PHP 4.3.1. Examples are illustrative only, and are not meant for a production environment. YMMV!