Documentation is available at target.inc.php
- <?php
- /*
- Program E related AIML knowledgebase tools
- Copyright 2004, Anne Kootstra [anne@aiml.info]
- http://www.AIML.info
- Program E is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
- Program E is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with Program E; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
- /**
- * Retrieve the GMcache record.
- *
- * Get the record using it's unique ID.
- *
- * @param integer $id ID of the GMcache entry to be retrieved
- *
- * @return array [pattern] pattern of the category that
- * matched the user's input and [input] the
- * actual input of the user.
- */
- function findtarget($id){
- $query="select patternmatched, inputmatched from gmcache where id='$id'";
- $selectcode = mysql_query($query);
- if ($selectcode){
- if(!mysql_numrows($selectcode)){
- return "";
- }
- else{
- while ($q = mysql_fetch_array($selectcode)){
- $matched['pattern'] = $q[0];
- $matched['input'] = $q[1];
- return $matched;
- }
- }
- }
- return "";
- }
- /**
- * Retrieve the first GMcache record.
- *
- * Retrieve the ID of the first record in the GMcache table. To be used when
- * no targetID was selected for editing.
- *
- * @param string $botid the bot's ID, in case there are more than one bot.
- *
- * @return integer id of the First record
- *
- */
- function findFirsttarget($botid){
- $query="select id from gmcache where bot='".$botid."' order by id asc limit 0,1";
- debugger($query,2);
- $selectcode = mysql_query($query);
- if ($selectcode){
- if(!mysql_numrows($selectcode)){
- return "";
- }
- else{
- while ($q = mysql_fetch_array($selectcode)){
- return $q[0];
- }
- }
- }
- return "";
- }
- /**
- * Delete GMcached record.
- *
- * Delete the GMcache record that has that particular ID.
- *
- * @uses debugger()
- *
- * @param interger $id the ID of the GMcache record to be deleted.
- *
- * @return void
- */
- function deletetarget($id){
- $query = "delete from gmcache where id='".$id."'";
- debugger($query,2);
- $selectcode = mysql_query($query);
- return "";
- }
- ?>
Documentation generated on Tue, 11 Jan 2005 18:41:11 +0100 by phpDocumentor 1.3.0RC3