Administration
  Home arrow Administration arrow Page 5 - Banner Management With phpAdsNew (Part...
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
IBM Rational Software Development Conference
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ADMINISTRATION

Banner Management With phpAdsNew (Part two)
By: Harish Kamath
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 7
    2005-04-11

    Table of Contents:
  • Banner Management With phpAdsNew (Part two)
  • Publishers Revisited
  • Advertisers Revisited
  • Many Websites, One phpAdsNew
  • Remote Calling

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Banner Management With phpAdsNew (Part two) - Remote Calling
    (Page 5 of 5 )

    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!


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · Appreciate the tutorials. Great overview and explanation! Nice work.
     

       

    ADMINISTRATION ARTICLES

    - Configuring Load-Balanced Clusters
    - Load-Balanced Clusters
    - UNIX Time Format Demystified
    - Making Changes in the CVS
    - Building Your First CVS Repository
    - CVS Quickstart Guide
    - Authorizing Users in Samba
    - Handling User Accounts in Samba
    - Authentication in Samba
    - Accounts, Authentication, and Authorization
    - Advanced Concepts on Dealing with Files and ...
    - Dealing with Files and Filesystems
    - More Hacks for the User Environment in BSD
    - Personalizing the User Environment in BSD
    - Customizing the User Environment in BSD

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway