Source for file add.php

Documentation is available at add.php

  1. <?php
  2.  
  3. /*
  4. Program E related AIML knowledgebase tools
  5. Copyright 2004, Anne Kootstra [anne@aiml.info]
  6. http://www.AIML.info
  7. Program E is free software; you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation; either version 2 of the License, or
  10. (at your option) any later version.
  11.  
  12. Program E is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. GNU General Public License for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with Program E; if not, write to the Free Software
  19. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  20. */
  21.  
  22. include "../admin/botloaderfuncs.php";
  23. require_once "include/common.inc.php";
  24. require_once "include/add.inc.php";
  25.  
  26.  
  27. /*
  28. this is the bot's ID which can be found in the bots table
  29. */
  30. $selectbot = findbotid();
  31.  
  32. /*
  33. This ID contains the main node and needs to be fed manually to
  34. the loading function insertmybigsentence(). If this is not done,
  35. then the loading mechanism will add another AIML tree instead
  36. of adding to the existing tree.
  37. */
  38. $annesID = findmainnode($selectbot);
  39.  
  40.  
  41. /*
  42. The category that's going to be inserted.
  43. */
  44. $pattern = "_ FEED";
  45. $that = "*";
  46. $topic = "*";
  47. $template = "Yep ... bite me";
  48.  
  49.  
  50. /*
  51. In this format insertmysentence() expects the pattern side
  52. of the category to be formatted.
  53. */
  54. $mybigsentence="$pattern <that> $that <topic> $topic";
  55.  
  56. /*
  57. $idused is the ID under which the template should be stored.
  58. The ID is the MySQL insert ID of the last word, which would be
  59. the last word of the <topic> bit of $mybigsentence. In many
  60. cases this is an empty cell
  61. */
  62. $idused=insertAnnesentence($mybigsentence, $annesID, $selectbot);
  63.  
  64. /*
  65. This inserts the template.
  66. */
  67. insertmytemplate($idused,$template);
  68.  
  69.  
  70. print $idused."<br>";
  71.  
  72.  
  73. ?>

Documentation generated on Tue, 11 Jan 2005 18:40:57 +0100 by phpDocumentor 1.3.0RC3