Home arrow Site Administration arrow Page 5 - Banner Management With phpAdsNew (Part two)

Remote Calling - Administration

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.

TABLE OF CONTENTS:
  1. Banner Management With phpAdsNew (Part two)
  2. Publishers Revisited
  3. Advertisers Revisited
  4. Many Websites, One phpAdsNew
  5. Remote Calling
By: Harish Kamath
Rating: starstarstarstarstar / 7
April 11, 2005

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

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

<HTML>
<HEAD>
 <TITLE>My Site</TITLE>
 <BASEFONT face="Arial">
</HEAD>
<BODY>
<TABLE width="100%" border="2" cellpadding="10" cellspacing="0">
 <TR>
  <TD width="25%">
   LOGO
  </TD>
  <TD align="center" valign="middle">

   SOME HEADER TEXT HERE


  </TD> 
 </TR>
 <TR>
  <TD width="100%" colspan="2">

   <!-- code for Horizontal Banner -->
   <script language='JavaScript' type='text/javascript'>
<!--
   if (!document.phpAds_used) document.phpAds_used = ',';
   phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);
  
   document.write ("<" + "script language='JavaScript' type='text/javascript' src='");
   document.write ("http:// ads.mysite.com/adjs.php?n=" + phpAds_random);
   document.write ("&amp;what=zone:2");
   document.write ("&amp;exclude=" + document.phpAds_used);
   if (document.referer)
      document.write ("&amp;referer=" + escape(document.referer));
   document.write ("'><" + "/script>");
//-->
</script><noscript><a href='http:// ads.mysite.com/adclick.php?n=ac36ac73' target='_blank'><img src='http://ads.mysite.com/adview.php?what=zone:2&amp;n=ac36ac73' border='0' alt=''></a></noscript>
<!-- End of Horizontal Banner -->

  </TD> 
 </TR>

 <TR height="80%"`>
  <TD align="center" valign="center" width="75%">
   Content comes here
  </TD>
  <TD align="center" valign="top" width="25%">
   <!-- Code for Vertical banner -->
<script language='JavaScript' type='text/javascript'>
<!--
   if (!document.phpAds_used) document.phpAds_used = ',';
   phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);
  
   document.write ("<" + "script language='JavaScript' type='text/javascript' src='");
   document.write ("
http://ads.mysite.com/adjs.php?n=" + phpAds_random);
   document.write ("&amp;what=zone:4");
   document.write ("&amp;exclude=" + document.phpAds_used);
   if (document.referer)
      document.write ("&amp;referer=" + escape(document.referer));
   document.write ("'><" + "/script>");
//-->
</script><noscript><a href='http://ads.mysite.com/phpadsnew/adclick.php?n=a5b0b59a' target='_blank'><img src='http://ads.mysite.com/adview.php?what=zone:4&amp;n=a5b0b59a' border='0' alt=''></a></noscript>
<!-- End of Vertical banner -->
  </TD>
 </TR> 
</TABLE>
</BODY>
</HTML>

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!



 
 
>>> More Site Administration Articles          >>> More By Harish Kamath
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

SITE ADMINISTRATION ARTICLES

- Coding: Not Just for Developers
- To Support or Not Support IE?
- Administration: Networking OSX and Win 7
- DotNetNuke Gets Social
- Integrating MailChimp with Joomla: Creating ...
- Integrating MailChimp with Joomla: List Mana...
- Integrating MailChimp with Joomla: Building ...
- Integrating MailChimp with Joomla
- More Top WordPress Plugins for Social Media
- Optimizing Security: SSH Public Key Authenti...
- Patches and Rejects in Software Configuratio...
- Configuring a CVS Server
- Managing Code and Teams for Cross-Platform S...
- Software Configuration Management
- Back Up a Joomla Site with Akeeba Backup

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: