[ 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.created_date.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_created_date($params, &$smarty)
  20  {
  21      global $gCms;
  22      $pageinfo = $gCms->variables['pageinfo'];
  23  
  24      if(empty($params['format']))
  25      {
  26          $format = "%x %X";
  27      }
  28      else
  29      {
  30          $format = $params['format'];
  31      }
  32  
  33      if (isset($pageinfo) && $pageinfo->content_created_date > -1)
  34      {
  35          return htmlentities(strftime($format, $pageinfo->content_created_date));
  36      }
  37      else
  38      {
  39          return "";
  40      }
  41  }
  42  
  43  function smarty_cms_help_function_created_date()
  44  {
  45          ?>
  46          <h3>What does this do?</h3>
  47          <p>Prints the date and time the page was created.  If no format is given, it will default to a format similar to 'Jan 01, 2004'.</p>
  48          <h3>How do I use it?</h3>
  49          <p>Just insert the tag into your template/page like: <code>{created_date format="%A %d-%b-%y %T %Z"}</code></p>
  50          <h3>What parameters does it take?</h3>
  51          <ul>
  52                  <li><em>(optional)</em>format - Date/Time format using parameters from php's strftime function.  See <a href="http://php.net/strftime" target="_blank">here</a> for a parameter list and information.</li>
  53          </ul>
  54          <?php
  55  }
  56  
  57  function smarty_cms_about_function_created_date() {
  58      ?>
  59      <p>Author: Ted Kulp&lt;tedkulp@users.sf.net&gt;</p>
  60      <p>Version: 1.0</p>
  61      <p>
  62      Change History:<br/>
  63      </p>
  64      <?php
  65  }
  66  ?>


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