smiles.php 678 B

12345678910111213141516171819202122232425
  1. <?
  2. function smiles_disabled()
  3. {
  4. $arr = parse_ini_file(CONFIG_PATH . 'disable.ini');
  5. return isset($arr['smiles']);
  6. }
  7. function show_smiles($data)
  8. {
  9. $form = '';
  10. if (!smiles_disabled()) {
  11. $smile = parse_ini_file(CONFIG_PATH . 'smiles.ini');
  12. $res = rcms_scandir(SMILES_PATH);
  13. sort($res);
  14. foreach ($res as $key) {
  15. if (isset($smile[$key])){
  16. $form .= '<img src="'.SMILES_PATH.$key.'" value="'.basename($key, ".gif").'" alt = "'.basename($key, ".gif").'" onclick="document.forms[\''.$data[0].'\'].elements[\''.$data[1].'\'].value += \'['.basename($key, ".gif").']\'">'."\n";
  17. }
  18. }
  19. if ($form !== '')
  20. $form = '<hr>'.$form.'<hr>';
  21. }
  22. echo $form;
  23. }
  24. ?>