mLanguage.'.'.$template.'.tpl.cache'; if( !empty( $pParams["cache_time"] ) && file_exists( $cachefile ) && !(( $gBitSystem->getUTCTime() - filemtime( $cachefile )) > $pParams["cache_time"] )) { $fp = fopen( $cachefile, "r" ); $data = fread( $fp, filesize( $cachefile )); fclose( $fp ); print $data; } else { if( $moduleParams = $gBitThemes->getCustomModule( $template )) { $moduleParams = array_merge( $pParams, $moduleParams ); $gBitSmarty->assign( 'moduleParams', $moduleParams ); $data = $gBitSmarty->fetch( 'bitpackage:themes/custom_module.tpl' ); if( !empty( $pParams["cache_time"] ) ) { // write to chache file $fp = fopen( $cachefile, "w+" ); fwrite( $fp, $data, strlen( $data )); fclose( $fp ); } print $data; } } unset( $data ); } }