2 /***********************************************************************/
4 /***********************************************************************/
5 /* Copyright (c) 2002-2009 */
6 /* Adaptive Technology Resource Centre / Inclusive Design Institution */
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 /***********************************************************************/
14 $_user_location = 'public';
15 define('AT_INCLUDE_PATH', '../../include/');
16 require (AT_INCLUDE_PATH.'vitals.inc.php');
17 include (AT_PA_INCLUDE.'classes/PhotoAlbum.class.php');
19 //check what comment this is for. Album or Photo.
20 $pid = intval($_POST['pid']);
21 $aid = intval($_POST['aid']);
23 if (isset($_POST['pid']) && $pid>0){
33 if (trim($_POST['comment']) == ''){
35 $msg->addError('PA_EMPTY_COMMENT'); //sql
37 $pa = new PhotoAlbum();
38 $result = $pa->addComment($id, $_POST['comment'], $_SESSION['member_id'], $isPhoto);
42 $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
44 $msg->addError('PA_ADD_COMMENT_FAILED'); //sql
49 header('Location: photo.php?pid='.$pid.SEP.'aid='.$aid);
51 header('Location: albums.php?id='.$aid);