Location: PHPKode > projects > Batavi > batavi/ext/smarty/plugin/insert.content.php
<?php

/**
 * file smarty_function_content.php
 *
 * Content plugin implementation
 *
 * @copyright Copyright (c) 2008, ICEshop BV
 *
 * @package classes
 */

 function smarty_insert_content($params, &$smarty) {

   $btv_Template = btv_Factory::singleton(TEMPLATE_ENGINE);
   $btv_Database = btv_Factory::singleton('btv_Database_'.DB_DATABASE_CLASS);
   $btv_Language = btv_Factory::singleton('btv_Language');
   $boxInstance  = $params['instance'];
   $QContent     = $btv_Database->query("SELECT cd.content
                                         FROM btv_cms_pages c JOIN btv_cms_pages_description cd ON c.text_keyword = :text_keyword AND c.page_id = cd.page_id
                                         WHERE c.status = 1 AND cd.language_id = :language_id");

   $QContent->bindValue(':text_keyword', $boxInstance);
   $QContent->bindInt(':language_id', $btv_Language->getId());
   $QContent->execute();

   if( $QContent->next() ) {
      return $QContent->value('content');
   }

 }


?>
Return current item: Batavi