PHP
  Home arrow PHP arrow Page 3 - Implementing Ad Support Into Your Site With PHPAdsNew
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 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? 
PHP

Implementing Ad Support Into Your Site With PHPAdsNew
By: Mitchell Harper
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 10
    2004-04-15


    Table of Contents:
  • Implementing Ad Support Into Your Site With PHPAdsNew
  • What is PhpAdsNew?
  • Using PhpAdsNew
  • Stats and banner rotations
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log 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


    Implementing Ad Support Into Your Site With PHPAdsNew - Using PhpAdsNew
    ( Page 3 of 5 )

    PhpAdsNew has zones, clients, and banners. First off, we want to add a client, so click on the administration tab and then the add new client link. Complete the details of the client when the page loads. Before you click on the save changes button, you should think carefully about whether or not you would like to allow this client to login to your PhpAdsNew system and modify his campaign.

    If you'd like to give your clients the flexibility of changing their banner whenever they like, then you should enter a username and password for them and select the appropriate checkboxes for them, which are shown below:

    PhpAdsNew client options

    When you're done, click on the save changes button. PhpAdsNew will now let you create a new campaign for this client. The great thing about PhpAdsNew is that you can either set how many impressions this clients ad will have, you can set both activation and expiry dates for the ad, or you can just let the ad run for as long as you like.

    The weight field is the frequency that the ad will be shown. The default is 1, but you can set it to a higher value if you'd like the ad to appear more frequently than any others if it's in a rotation.

    Set the options for this clients campaign then click save changes. PhpAdsNew will create the new campaign and redirect you back to the zones page. To create a banner for this client, click on the create link under their campaign:

    Adding a new banner for a client

    Once the add new banner page loads, there are four possible types of banners that we can create:
    • Banner stored in SQL: This option allows you to upload an image directly into the PhpAdsNew MySQL database. It's stored as a blob, and you don't have to worry about storing image files on your server.
    • Banner stored on the Webserver: If you'd like to store your banner images on your webserver, then choose this option.
    • Banner references to through URL: This option allows you to reference a banner that's available online (i.e. http://...). If you're running banners as part of an ad network, then this is the option that you're after.
    • HTML banner: HTML banners are ideal for rich media ads such as flash movies, or even plain text ads, which generally have a great click-thru rate (CTR).
    For this article, we'll create a banner stored in SQL, so select that option and choose/create a banner from your hard drive. I have created a simple 468x60 banner. Once you click on the submit ad button, PhpAdsNew will show you how your banner will look. Here's what mine looked like:

    Previewing my banner with PhpAdsNew

    Now that our banner's created, it's time to tell PhpAdsNew to generate the banner code for it, which we can include in our web pages to display the banner. Click on the administration tab and then the generate banner code link, just under the tab. Once again, there are several options to choose from. The way the banner is invocated can be one of five possible options:
    • Remote Invocation: An image tag will be generated that points to the location of PhpAdsNew's adview.php script, passing in the ID of the client whose banner we want to display.
    • Remote Invocation with JavaScript: Generates a SCRIPT tag which references adjs.php, which uses JavaScript's document.write function to display the banner.
    • Remote Invocation for iFrames: Generates an iframe tag that references adframe.php. Adframe.php returns the image so it's displayed inside of the iFrame.
    • Combined Remote Invocation: Uses a combination of an iframe tag and script tag to generate a banner called from JavaScript based inside of an iFrame.
    • Local Mode: PHP code that includes phpadsnew.inc.php and calls that scripts view function. This is the default mode, however if you're using MySQL in other areas of your site to display data, then I would recommend staying away from this option.
    Once you've chosen your banner display options, you'll need to select the banner to be displayed from the ClientID drop down list. If you'd like the URL that the banner links to open in a new window, enter something like _blank in the target field. In this example I'm using remote invocation, so here's the code that PhpAdsNew generated when I clicked on the generate button:

    <a href="' http://localhost/phpAdsNew/adclick.php'" target='_blank'><img src="'http://localhost/phpAdsNew/adview.php?clientID=2&target=_blank'"; border='0'></a>

    Obviously at this point, it's simply a matter of copying and pasting the generate code into your web page and then saving it.

    At this point we haven't really explored the power of PhpAdsNew, so let's now take a look at its powerful reporting and banner rotation features.

     
     
    >>> More PHP Articles          >>> More By Mitchell Harper
     

       

    PHP ARTICLES

    - Building Dynamic Queries with Chainable Meth...
    - PHP Encryption and Decryption Methods
    - Building a MySQL Abstraction Class with Meth...
    - Completing a Sample String Processor with Me...
    - Mastering WHILE Loops for PHP and MySQL
    - Method Chaining: Adding More Methods to the ...
    - Method Chaining in PHP 5
    - The Role of Interfaces in Applying the Depen...
    - Dependency Injection: Using a Setter Method ...
    - Using a Model Class with the Dependency Inje...
    - Injecting Objects Using Setter Methods with ...
    - Injecting Objects by Constructor with the De...
    - The Dependency Injection Design Pattern in P...
    - Performing Inferential Statistical Analysis ...
    - Performing Descriptive Statistical Analysis ...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
    Stay green...Green IT