/** * Convert Smiley * * This function converts text smilies into graphical ones. * * @param string $str * @return string $str * @see /theme/images/smiley/ * @since 5.5.16 * @version 9.5.6 */ public function setSmiley($str) { global $pathToIndex; $smileyDir = Loggix_Core::getRootUri() . 'theme/images/smiley/'; $smilies = array(':-)' => 'smile.png', ';-)' => 'wink.png', ':-D' => 'laugh.png', ':-!' => 'foot_in_mouth.png', ':-(' => 'frown.png', '=-o' => 'gasp.png', '8-)' => 'cool.png', ':-P' => 'tongue.png', '}:-[' => 'angry.png', ':-|' => 'ambivalent.png', ':-/' => 'undecided.png', ':-d' => 'yum.png', ':.(' => 'cry.png', ':-X' => 'sealed.png', ':.)' => 'touched.png', '|-|' => 'sleep.png', '}}:' => 'focus.png', '}-)' => 'strong.png', ':-S' => 'confused.png', ':-}' => 'embarassed.png'); $iconWidth = 18; $iconHeight = 18; foreach ($smilies as $smileyText => $smileyImage) { $str = str_replace($smileyText, '<img' . ' src="' . $smileyDir . $smileyImage . '"' . ' width="' . $iconWidth . '"' . ' height="' . $iconHeight . '"' . ' alt="' . $smileyText . '"' . ' />', $str); } return $str; }
/** * Constructor : Open datbase and load functions and modules. * * @uses _includeModules() * @uses _includePlugins() * @uses getLanguage() */ public function __construct() { global $pathToIndex, $lang, $module, $item; try { // Switch database switch (self::LOGGIX_DATABASE_TYPE) { case 'MySQL': $this->db = new PDO('mysql:' . 'host=' . self::LOGGIX_MYSQL_HOST . ';' . 'dbname=' . self::LOGGIX_MYSQL_DBNAME, self::LOGGIX_MYSQL_USER, self::LOGGIX_MYSQL_PASS); break; default: $sqlite2 = $pathToIndex . self::LOGGIX_SQLITE_2; $sqlite3 = $pathToIndex . self::LOGGIX_SQLITE_3; $dbPath = file_exists($sqlite3) ? 'sqlite:' . $sqlite3 : 'sqlite2:' . $sqlite2; $this->db = new PDO($dbPath); } } catch (PDOException $exception) { die($exception->getMessage()); } self::$startTime = microtime(); self::$config = $this->getConfigArray(); $this->_includeModules(); $lang = $this->getLanguage(); $this->plugin = new Loggix_Plugin(); $this->_includePlugins(); }