public static function showSmiles() { $app = JCommentsFactory::getApplication('administrator'); $config = JCommentsFactory::getConfig(); require_once JCOMMENTS_LIBRARIES . '/joomlatune/filesystem.php'; $smilesPath = $config->get('smiles_path', 'components' . DS . 'com_jcomments' . DS . 'images' . DS . 'smiles' . DS); $smilesAbsPath = $app->getCfg('absolute_path') . DS . $smilesPath; $smilesAbsPath = str_replace(DS . DS, DS, $smilesAbsPath); $imageFiles = JoomlaTuneFS::readDirectory($smilesAbsPath); $lists['images'] = array(); foreach ($imageFiles as $file) { if (preg_match("/(gif|jpg|png)/i", (string) $file)) { $lists['images'][] = $file; } } $config = JCommentsFactory::getConfig(); $lists['smiles'] = $config->get('smiles'); $lists['smiles_path'] = $app->getCfg('live_site') . str_replace('//', '/', str_replace(DS, '/', $smilesPath) . '/'); HTML_JComments::showSmiles($lists); }
function showSmiles() { require_once JCOMMENTS_LIBRARIES . DS . 'joomlatune' . DS . 'filesystem.php'; $imageFiles = JoomlaTuneFS::readDirectory(JCOMMENTS_BASE . DS . 'images' . DS . 'smiles' . DS); $lists['images'] = array(); foreach ($imageFiles as $file) { if (preg_match("/(gif|jpg|png)/i", (string) $file)) { $lists['images'][] = $file; } } $config =& JCommentsFactory::getConfig(); $lists['smiles'] = $config->get('smiles'); HTML_JComments::showSmiles($lists); }