* Name: replace
* Purpose: simple search/replace * * @link http://smarty.php.net/manual/en/language.modifier.replace.php replace (Smarty online manual) * @author Monte Ohrt * @author Uwe Tews * * @param string $string input string * @param string $search text to search for * @param string $replace replacement text * * @return string */ function smarty_modifier_pagecat($string) { require_once MYDIR . '/set/conf.php'; //цепляем конфиги require_once MYDIR . '/api/php/mysql7.php'; //вызываем апи для работы с мускулом global $db; $db2 = new MySQL; $db2 -> connect( $set['bd_host'], $set['bd_user'], $set['bd_pass'], $set['bd_name'] ); unset($a); $a['id']=$string; $res=$db2->get_val('page_cat', $a, 'txt'); return $res; }