[ 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/ -> function.getcontent.php (source)

   1  <?php
   2  // function.getsections.php 
   3  //
   4  // Written by Elie `LordWo` BLETON <lordwo_REM_OVE_THIS@laposte.net>
   5  //
   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_function_getcontent () {
  26  $help = '
  27  <p>the {getcontent} function is used to retrieve the content page linked to the section.<br /><br />
  28  Your index.html template should include() the result of this function, or proceed with normal blog display if the result is FALSE.</p>
  29  ';
  30    return array (
  31      'name'           =>'getcontent',
  32      'type'           =>'function',
  33      'nicename'       =>'GetContent',
  34      'description'    =>'Returns the content page linked to the section. Return FALSE if none.<br>This',
  35      'authors'        =>'Elie `LordWo` BLETON <lordwo_REM_OVE_THIS@laposte.net>',
  36      'licence'        =>'GPL',
  37      'help'           => $help
  38    );
  39  }
  40  
  41  function smarty_function_getcontent($params, &$bBlog) {
  42  
  43    // Retrieving data
  44    $bBlog->get_sections();
  45    $sections = $bBlog->sections;
  46    foreach ($sections as $object) {
  47       $new[$object->sectionid] = $object;
  48    }
  49    $sections = $new;
  50    
  51    $current_section = $bBlog->get_template_vars("sectionid");
  52      
  53    // Return  
  54    $bBlog->assign("content",$sections[$current_section]->content);
  55  }
  56  
  57  ?>


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