liberty
[ class tree: liberty ] [ index: liberty ] [ all elements ]

Source for file data.adsense.php

Documentation is available at data.adsense.php

  1. <?php
  2. /**
  3.  * @version  $Revision$
  4.  * @package  liberty
  5.  * @subpackage plugins_data
  6.  */
  7. // +----------------------------------------------------------------------+
  8. // | Copyright (c) 2004, bitweaver.org
  9. // +----------------------------------------------------------------------+
  10. // | All Rights Reserved. See below for details and a complete list of authors.
  11. // | Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details
  12. // |
  13. // | For comments, please use phpdocu.sourceforge.net documentation standards!!!
  14. // | -> see http://phpdocu.sourceforge.net/
  15. // +----------------------------------------------------------------------+
  16. // | Author:  xing
  17. // +----------------------------------------------------------------------+
  18. // $Id$
  19.  
  20. /**
  21.  * definitions
  22.  */
  23.  
  24. /******************
  25. * Initialization *
  26. ******************/
  27. global $gLibertySystem;
  28. define'PLUGIN_GUID_DATAADSENSE''dataadsense' );
  29. $pluginParams array (
  30.     'tag' => 'ADSENSE',
  31.     'auto_activate' => FALSE,
  32.     'requires_pair' => FALSE,
  33.     'load_function' => 'data_adsense',
  34.     'title' => 'Adsense',
  35.     'help_page' => 'DataPluginAdsense',
  36.     'description' => tra("This plugin adds Adsense Code to page."),
  37.     'help_function' => 'data_adsense_help',
  38.     'syntax' => "{ADSENSE}",
  39.     'plugin_type' => DATA_PLUGIN
  40. );
  41. $gLibertySystem->registerPluginPLUGIN_GUID_DATAADSENSE$pluginParams );
  42. $gLibertySystem->registerDataTag$pluginParams['tag']PLUGIN_GUID_DATAADSENSE );
  43.  
  44. /*****************
  45. * Help Function *
  46. *****************/
  47. function data_adsense_help({
  48.     return 'NO HELP WRITTEN FOR {ADSENSE} YET. You can set: client, width, height, format, type and channel.';
  49. }
  50.  
  51. /****************
  52. * Load Function *
  53. ****************/
  54. function data_adsense$pData$pParams {
  55.     extract$pParams );
  56.     $width   !empty$width )   $width   "728" );
  57.     $height  !empty$height )  $height  "90" );
  58.     $client  !empty$client )  $client  "pub-xxxxxxxxxxxxxxxx" );
  59.     $format  !empty$format )  $format  "728x90_as" );
  60.     $type    !empty$type )    $type    "text_image" );
  61.     $channel !empty$channel $channel "" );
  62.  
  63.     return "<!--~np~--><script type=\"text/javascript\">/* <![CDATA[ */
  64.         google_ad_width   = $width;
  65.         google_ad_height  = $height;
  66.         google_ad_client  = \"$client\";
  67.         google_ad_format  = \"$format\";
  68.         google_ad_type    = \"$type\";
  69.         google_ad_channel = \"$channel\";
  70.     /* ]]> */</script>
  71.     <script type=\"text/javascript\" src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\"></script><!--~/np~-->";
  72. }
  73. ?>

Documentation generated on Wed, 29 Jul 2015 13:56:17 +0000 by phpDocumentor 1.5.0-lsces