[ PHPXref.com ] [ Generated: Sun Jul 20 16:35:25 2008 ] [ bBlog 0.7.6 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/bblog/bBlog_plugins/ -> modifier.smartypost.php (source)

   1  <?php
   2  
   3  // modifier.smartypost.php - processes smarty tags embedded in posts
   4  // Copyright (C) 2003  Mario Delgado <mario@seraphworks.com>
   5  // modifier.smartypost.php - a plug-in written for bBlog Weblog
   6  /*
   7  ** bBlog Weblog http://www.bblog.com/
   8  ** Copyright (C) 2003  Eaden McKee <email@eadz.co.nz>
   9  **
  10  ** This program is free software; you can redistribute it and/or modify
  11  ** it under the terms of the GNU General Public License as published by
  12  ** the Free Software Foundation; either version 2 of the License, or
  13  ** (at your option) any later version.
  14  **
  15  ** This program is distributed in the hope that it will be useful,
  16  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  17  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18  ** GNU General Public License for more details.
  19  **
  20  ** You should have received a copy of the GNU General Public License
  21  ** along with this program; if not, write to the Free Software
  22  ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  23  */
  24  
  25  function identify_modifier_smartypost () {
  26  
  27      $help='<br>Use the smartypost modifier on the {$post.body} tag,<br> 
  28             to process any Smarty tags you have embedded in a post.<br><br>
  29             Example : 
  30             <ul> 
  31                 <li>{$post.body|smartypost}</li> 
  32             </ul> Smarty Post can be used with other modifiers.<br><br>
  33             Example :
  34             <ul> 
  35                 <li>{$post.body|readmore:$post.postid|smartypost}</li> 
  36             </ul>';
  37  
  38      return array (
  39        'name'          =>'smartypost',
  40        'type'          =>'smarty_modifier',
  41        'nicename'      =>'Smarty Post',
  42        'description'   =>'Processes Smarty tags in a post',
  43        'authors'       =>'Mario Delgado <mario@seraphworks.com>',
  44        'licence'       =>'GPL',
  45        'help'          =>$help
  46      );
  47  
  48  }
  49  
  50  function smarty_modifier_smartypost($text) {
  51  
  52      global $bBlog;
  53      $bBlog->assign('smartied_post', $text);
  54      // we will store the smartypost template in the inc/admin_template dir, becasue almost noone will need to change it, - reduce clutter in the templates/* directory.
  55      $tmptemplatedir = $bBlog->template_dir;
  56      $tmpcompileid = $bBlog->compile_id;
  57      $bBlog->template_dir = BBLOGROOT.'inc/admin_templates';
  58      $bBlog->compile_id = 'admin';
  59      $output = $bBlog->fetch('smartypost.html');
  60      $bBlog->template_dir = $tmptemplatedir;
  61      $bBlog->compile_id = $tmpcompileid;
  62  
  63  
  64      return $output;
  65        
  66  }
  67  
  68  ?>


[ Powered by PHPXref - Served by Debian GNU/Linux ]