The following mod adds an extra menu item to the admin panel that allows users to specify a directory and (re)upload ALL AIML files from it to the database. In addition, it attempts to convert/sanitize special/foreign characters from the AIML file before import.
It contains two new files, and a small modification to the side navigation bar in the admin menu. It requires "My Program-O" to be installed.
To install, simply unzip the file in your main program-o directory. It will add two new php files ( [botdir]/admin/pages/ph_aiml.php and [botdir]/admin/funcs/ph_aiml.php), and let it replace the admin side-nav file to add a line for easier navigation ( [botdir]/admin/pages/inc/side_nav_bar.php )
To use (after installing ):
1. Create a subdirectory of [botdir]/admin/aiml (with proper read/write permissions for the web user)
2. Upload your AIML files there
3. Open "Mass Import AIML" from the side-navigation menu in the admin panel
4. Type the directory name in the form, and hit "update" - this will (re)load ALL files from that directory to the database.
Alternatively, you can simply add AIML files to the aiml directory, and just hit the [update] button without making/specifying directories. Warning: large files, and a large number of files importing can get pretty server-intensive, hence the ability to specify different directories.
Note: Similarly to upload.php, this will delete/replace all patterns in the aiml table in the database that have these filenames as reference. If successful, you will get a list of all loaded files. If not, you will get errors with filename and line number to look at.
Here are the files:
http://www.speedguide.net/~philip/files ... import.zip
Note this is a fast hack copied from upload.php, with some added functionality for cleaning special characters and loading multiple files. I'm sure it could be done better given the time, but it works for me with the latest ALICE AIML files v. 1.7 from here:
http://code.google.com/p/aiml-en-us-fou ... loads/list
(and a few others)
I hope this helps someone