[ Index ]
 

Code source de CMS made simple 1.0.5

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/plugins/ -> function.adsense.php (source)

   1  <?php
   2  #CMS - CMS Made Simple
   3  #(c)2004 by Ted Kulp (wishy@users.sf.net)
   4  #This project's homepage is: http://cmsmadesimple.sf.net
   5  #
   6  #This program is free software; you can redistribute it and/or modify
   7  #it under the terms of the GNU General Public License as published by
   8  #the Free Software Foundation; either version 2 of the License, or
   9  #(at your option) any later version.
  10  #
  11  #This program is distributed in the hope that it will be useful,
  12  #but WITHOUT ANY WARRANTY; without even the implied warranty of
  13  #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14  #GNU General Public License for more details.
  15  #You should have received a copy of the GNU General Public License
  16  #along with this program; if not, write to the Free Software
  17  #Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  18  
  19  function smarty_cms_function_adsense($params, &$smarty) {
  20      $ad_client = "";
  21      $ad_width = "120";
  22      $ad_height = "600";
  23      $ad_format = "120x600_as";
  24      $ad_channel = "";
  25  
  26      if(!empty($params['ad_client']))
  27          $ad_client = $params['ad_client'];
  28      if(!empty($params['ad_width']))
  29          $ad_width = $params['ad_width'];
  30      if(!empty($params['ad_height']))
  31          $ad_height = $params['ad_height'];
  32      if(!empty($params['ad_format']))
  33          $ad_format = $params['ad_format'];
  34      if(!empty($params['ad_channel']))
  35          $ad_channel = $params['ad_channel'];
  36      
  37      $result = "\n<!-- Begin Google AdSense Ad -->\n";
  38      $result .= "\n<script type=\"text/javascript\"><!--\n";
  39      $result .= "google_ad_client = \"$ad_client\";\n";
  40      $result .= "google_ad_width = \"$ad_width\";\n";
  41      $result .= "google_ad_height = \"$ad_height\";\n";
  42      $result .= "google_ad_format = \"$ad_format\";\n";
  43      $result .= "google_ad_channel = \"$ad_channel\";\n";
  44      $result .= "//--></script>\n";
  45      $result .= "<script type=\"text/javascript\" src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\"></script>\n";
  46      $result .= "\n<!-- End Google AdSense Ad -->\n";
  47  
  48      return $result;
  49  }
  50  
  51  function smarty_cms_help_function_adsense() {
  52      ?>
  53      <h3>What does this do?</h3>
  54      <p>Google adsense is a popular advertising program for websites.  This tag will take the basic parameters that would be provided by the adsense program and puts them in a easy to use tag that makes your templates look much cleaner.  See <a href="http://www.google.com/adsense" target="_blank">here</a> for more details on adsense.</p>
  55      <h3>How do I use it?</h3>
  56      <p>First, sign up for a google adsense account and get the parameters for your ad.  Then just use the tag in your page/template like so: <code>{adsense ad_client="pub-random#" ad_width="120" ad_height="600" ad_format="120x600_as"}</code>
  57      <h3>What parameters does it take?</h3>
  58      <p>All parameters are optional, though skipping one might not necessarily made the ad work right.  Options are:
  59      <ul>
  60          <li>ad_client - This would be the pub_random# id that would represent your adsense account number</li>
  61          <li>ad_width - width of the ad</li>
  62          <li>ad_height - height of the ad</li>
  63          <li>ad_format - "format" of the ad <em>e.g. 120x600_as</em></li>
  64          <li>ad_channel - channels are an advanced feature of adsense.  Put it here if you use it.</li>
  65      </ul>
  66      </p>
  67      <?php
  68  }
  69  
  70  function smarty_cms_about_function_adsense() {
  71      ?>
  72      <p>Author: Ted Kulp&lt;tedkulp@users.sf.net&gt;</p>
  73      <p>Version: 1.0</p>
  74      <p>
  75      Change History:<br/>
  76      None
  77      </p>
  78      <?php
  79  }
  80  
  81  ?>


Généré le : Tue Apr 3 18:50:37 2007 par Balluche grâce à PHPXref 0.7