Source for file resource._custom.php
Documentation is available at resource._custom.php
* -------------------------------------------------------------
* File: resource._custom.php
* Purpose: Fetches templates from the correct package
* -------------------------------------------------------------
protected function fetch ( $pTplName, &$pTplSource, &$pTplTime ) {
global $gBitLanguage, $gBitThemes, $gBitSmarty;
// We're gonna run our own cache mechanism for user_modules
// the cache is here to avoid calls to consumming queries,
// each module is different for each language because of the strings
$cacheDir = TEMP_PKG_PATH. 'modules/cache/';
list ( $package, $template ) = explode( '/', $pTplName );
$cacheFile = $cacheDir. '_custom.'. $gBitLanguage->mLanguage. '.'. $template. '.tpl.cache';
if( !empty( $r["cache_time"] ) && file_exists( $cacheFile ) && !(( $gBitSystem->getUTCTime() - filemtime( $cacheFile )) > $r["cache_time"] )) {
if( $moduleParams = $gBitThemes->getCustomModule( $template )) {
$gBitSmarty->assign_by_ref( 'moduleParams', $moduleParams );
$pTplSource = $gBitSmarty->fetch( 'bitpackage:themes/custom_module.tpl' );
$fp = fopen( $cacheFile, "w+" );
|