Warning: Undefined array key "showMaxUploadSize" in /home/kpoil/domains/development.kpoil.torun.pl/public_html/index.php on line 11
/*
*
* Author: id2it | kontakt@id2it.pl
* All rights reserved
* Use without permission is prohibited
*
*/
require_once(_ENGINEINCLUDEPATH.'/libs/smarty/Smarty.class.php');
class mySmarty extends Smarty {
static private $alien = array();
static private $plugins = array();
static private $postfix = 'tpl';
static public $langs;
public function __construct() {
parent::__construct();
$this->registerPlugin('modifier', 'dump', array(&$this, 'dump'), false);
$this->registerPlugin('modifier', 'clip', array(&$this, 'clip'), false);
$this->registerPlugin('modifier', 'przyjaznyString', array(&$this, 'przyjaznyString'), false);
$this->registerPlugin('modifier', 'trans', array(&$this, 'translate'), false);
foreach(self::$plugins as $k => $w) $this->registerPlugin($w[0], $w[1], $w[2], false);
$this->template_dir = 'tpl/';
$this->compile_dir = $_SERVER['DOCUMENT_ROOT'] .'/tmp/compile/smarty/';
$this->cache_dir = $_SERVER['DOCUMENT_ROOT'] .'/tmp/cache/smarty/';
$this->cache_lifetime = _SMARTYCACHELIFETIME;
if($_GET['flush'] == 'buff') { /* CZYSCI CALY CACHE DLA SZABLONOW */
$this->clearAllCache();
}
if(_SMARTYCACHE == 1) {
//$this->setCaching(Smarty::CACHING_LIFETIME_CURRENT);
$this->caching = Smarty::CACHING_LIFETIME_CURRENT;
}
}
public function dump($input) {
return ''. str_replace(")\n\n", ")\n", preg_replace('/Array(\s*\n*\s*)\(/s', 'Array (', print_r($input, true))). '
';
}
public function translate($input) {
$str = explode('.', $input);
$tmp = self::$langs;
foreach ($str as $v){
$tmp = $tmp[$v];
}
return $tmp;
}
public function clip($text, $width, $dots = false, $fontSize = 8) {
$old = $text = str_replace('*', '', trim($text));
do { $text_width = imagettfbbox($fontSize, 0, _ENGINEINCLUDEPATH.'/font/arial.ttf', strtr($text, array('�' => 'S', '�' => 'A', '�' => 'Z', '�' => 's', '�' => 'a', '�' => 'z')));
if($text_width[2] > $width) $text = substr($text, 0, trim(strlen($text) - 1)); } while($text_width[2] > $width);
return trim($text. ($dots && $old != $text? '...': null));
}
public function przyjaznyString($string) {
$string = strtr($string, array('Ę'=> 'E','ę'=> 'e','Ó'=> 'O','ó'=> 'o','Ą'=> 'A','ą'=> 'a','Ś'=> 'S','ś'=> 's','Ł'=> 'L','ł'=> 'l','Ź'=> 'Z','ź'=> 'z','Ż'=> 'Z','ż'=> 'z','Ć'=> 'C','ć'=> 'c','Ń'=> 'N','ń'=> 'n'));
//echo $string;
$string = strtr($string, 'ˇ¦¬±¶Ľ','ASZasz');
$string = preg_replace("'[[:punct:][:space:]]'",'-',$string);
$string = strtolower($string);
$znaki = '-';
$powtorzen = 1;
$string = preg_replace_callback('#(['.$znaki.'])\1{'.$powtorzen.',}#', create_function('$a', 'return substr($a[0], 0,'.$powtorzen.');'), $string);
return $string;
}
}
Fatal error: Uncaught Error: Class "mySmarty" not found in /home/kpoil/domains/development.kpoil.torun.pl/public_html/_engine2/class/factory.php:13
Stack trace:
#0 /home/kpoil/domains/development.kpoil.torun.pl/public_html/indexBasicClassLoader.php(6): require_once()
#1 /home/kpoil/domains/development.kpoil.torun.pl/public_html/index.php(25): require_once('/home/kpoil/dom...')
#2 {main}
thrown in /home/kpoil/domains/development.kpoil.torun.pl/public_html/_engine2/class/factory.php on line 13