/** * function intialise_convoArray() * A function to intialise the conversation array * This is the array that is built throught the conversation * @param string $convo_id - unique session id * @param int $bot_id - the id of the bot * @param string $format - the return format of the response (html,json,xml) * @param array $convoArr - the current state of the conversation array * @return $convoArr (updated) **/ function intialise_convoArray($convoArr) { //set the initial convoArr values /*$convoArr['conversation']['convo_id']=$convo_id; $convoArr['conversation']['bot_id']=$bot_id; $convoArr['conversation']['format']=$format;*/ runDebug(__FILE__, __FUNCTION__, __LINE__, "Intialising conversation", 4); //load blank topics $convoArr = load_blank_convoArray('topic', "", $convoArr); //load blank thats $convoArr = load_blank_convoArray('that', "", $convoArr); //load blank stars $convoArr = load_blank_convoArray('star', "", $convoArr); //load blank stars $convoArr = load_blank_convoArray('input', "", $convoArr); //load blank stack $convoArr = load_blank_stack($convoArr); //load the new client defaults $convoArr = load_new_client_defaults($convoArr); return $convoArr; }
/** * function intialise_convoArray() * A function to intialise the conversation array * This is the array that is built throught the conversation * @link http://blog.program-o.com/?p=1242 * @param array $convoArr - the current state of the conversation array * @return array $convoArr (updated) **/ function intialise_convoArray($convoArr) { if (!isset($convoArr['conversation'])) { $convoArr['conversation'] = array(); } //set the initial convoArr values runDebug(__FILE__, __FUNCTION__, __LINE__, "Intialising conversation", 4); //load blank topics $convoArr = load_blank_array_element('topic', "", $convoArr); //load blank thats $convoArr = load_blank_array_element('that', "", $convoArr); //load blank stars $convoArr = load_blank_array_element('star', "", $convoArr); //load blank stars $convoArr = load_blank_array_element('input', "", $convoArr); //load blank stack $convoArr = load_blank_stack($convoArr); //load bot properties $convoArr = load_default_bot_values($convoArr); //load the new client defaults $convoArr = load_new_client_defaults($convoArr); return $convoArr; }