2 /****************************************************************/
4 /****************************************************************/
5 /* Copyright (c) 2002-2005 by Greg Gay */
6 /* Adaptive Technology Resource Centre / University of Toronto */
9 /* This program is free software. You can redistribute it and/or*/
10 /* modify it under the terms of the GNU General Public License */
11 /* as published by the Free Software Foundation. */
12 /****************************************************************/
13 // $Id: message_reader.php 5123 2005-07-12 14:59:03Z greg $
16 Add a require statement to the end of a theme header template to have ATalker
17 read error and feedback messages out loud. add to:
18 themes/theme_name/include/header.tmpl.php
20 require(AT_INCLUDE_PATH."../mods/atalker/message_reader.php");
25 require_once(AT_INCLUDE_PATH."../mods/atalker/atalkerlib.inc.php");
27 if( $_SESSION['messages_on'] == '1'){
28 if($_SESSION['message'] ){
30 define('AT_MSGS_DIR', AT_CONTENT_DIR.'/msgs/');
31 define('AT_MSGS_URL', $this->base_href.'content/msgs/');
33 //See if the messages (msgs) directory exists and if it does, open it, otherwise create it, then open it
34 if(@!opendir(AT_MSGS_DIR)){
35 mkdir(AT_MSGS_DIR, 0700);
40 if($_SESSION['message']['feedback'] != ''){
41 foreach($_SESSION['message']['feedback'] as $var => $val){
44 $messages[$i]= $val[0];
45 $vals[$val[$i]] = $val[1];
56 if($_SESSION['message']['error'] != ''){
57 foreach($_SESSION['message']['error'] as $var => $val){
59 $messages[$i]= $val[0];
60 $vals[$val[$i]] = $val[1];
72 read_messages($messages, $vals);