2 /***********************************************************************/
4 /***********************************************************************/
5 /* Copyright (c) 2002-2010 */
6 /* Inclusive Design Institute */
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 //quit if this is not a member
20 if(!(isset($_SESSION['member_id']) && $_SESSION['member_id'] > 0)){
21 $msg->addError('ACCESS_DENIED');
22 header('Location: index.php');
26 //check what comment this is for. Album or Photo.
27 $pid = intval($_POST['pid']);
28 $aid = intval($_POST['aid']);
30 if (isset($_POST['pid']) && $pid>0){
40 if (trim($_POST['comment']) == ''){
42 $msg->addError('PA_EMPTY_COMMENT'); //sql
44 $pa = new PhotoAlbum();
45 $result = $pa->addComment($id, $_POST['comment'], $_SESSION['member_id'], $isPhoto);
49 $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
51 $msg->addError('PA_ADD_COMMENT_FAILED'); //sql
56 header('Location: photo.php?pid='.$pid.SEP.'aid='.$aid);
58 header('Location: albums.php?id='.$aid);