source: trunk/plugins/InsertSmiley/smileys/smileys.php

Last change on this file was 1224, checked in by gogo, 10 years ago

Ticket #1093
Ticket #1377

Rewrite the InsertSmiley? plugin. Remains compatible with ray's changes in r904 if people have made a specific configuration.

File size: 899 bytes
Line 
1<?php
2  /** This script can be used to automatically output all smiley images you
3   *  dump into this folder, as long as they are gif, jpg or png.
4   *
5   *  Simply set your
6   *
7   *   xinha_config.InsertSmiley.smileys =
8   *      _editor_url+'/plugins/InsertSmiley/smilies.php';
9   *
10   * (or better, make a new smileys folder outside of Xinha
11   *  and copy this file to it and change the line above
12   *  appropriately).
13   *
14   */
15 
16  // You will probably need to change this if you copy this file elsewhere!
17  require_once(realpath(dirname(__FILE__) . '/../../../contrib/php-xinha.php'));
18 
19  $dh = opendir(dirname(__FILE__));
20  $smileys = array(); 
21  while($f = readdir($dh))
22  {
23    $M = array();
24    if(preg_match('/^(.*)\.(gif|jpg|png)$/i', $f, $M))
25    {
26      $smileys[] = array('title' => $M[1], 'src'=> $f);
27    }
28  }
29  closedir($dh);
30 
31 
32  echo xinha_to_js($smileys);
33 
34?>
Note: See TracBrowser for help on using the repository browser.