3 include('./fancyurls.config.php');
\r
4 include('./config.php');
\r
6 include_once($DIR_NUCLEUS.'/plugins/gallery/config.php');
\r
8 $data = explode("/",serverVar('PATH_INFO'));
\r
9 $itemid = intval($data[1]);
\r
14 if ($data[$j]) $_GET[$data[$i]] = $data[$j];
\r
17 $_GET['type'] = $data[1];
\r
18 $type = $_GET['type'];
\r
20 if(isset($_POST['type'])) $type=$_POST['type'];
\r
22 global $gmember, $CONF, $NPG_CONF;
\r
23 global $skinid,$manager,$blog,$blogid;
\r
30 $post['itemid'] = intPostVar('itemid');
\r
31 $post['user'] = postVar('user');
\r
32 $post['userid'] = postVar('userid');
\r
33 $post['body'] = postVar('body');
\r
35 // set cookies when required
\r
36 $remember = intPostVar('remember');
\r
37 if ($remember == 1) {
\r
38 $lifetime = time()+2592000;
\r
39 setcookie($CONF['CookiePrefix'] . 'comment_user',$post['user'],$lifetime,'/','',0);
\r
40 setcookie($CONF['CookiePrefix'] . 'comment_userid', $post['userid'],$lifetime,'/','',0);
\r
43 $comments = new NPG_COMMENTS($post['itemid']);
\r
45 $errormessage = $comments->addComment($post);
\r
47 //need to add code to display the error
\r
48 if ($errormessage == '1') {
\r
49 $_POST['id'] = $post['itemid'];
\r
53 if($gmember->canAddAlbum() ){
\r
54 $NPG_vars['ownerid'] = $gmember->getID();
\r
55 $NPG_vars['title'] = requestVar('title');
\r
56 $NPG_vars['description'] = requestVar('desc');
\r
57 ALBUM::add_new($NPG_vars);
\r
60 case 'finaldeletepicture':
\r
61 $id = requestVar('id');
\r
62 $delpromo = requestVar('delpromo');
\r
63 if($gmember->canModifyPicture($id)) {
\r
65 $manager->notify('NPgPreDeletePicture', array('pictureid' => $id));
\r
66 $result = PICTURE::delete($id);
\r
68 if($result['status'] == 'error') {
\r
69 echo $result['message'];
\r
72 $manager->notify('NPgPostDeletePicture', array('pictureid' => $id));
\r
74 if($delpromo == 'yes') {
\r
75 $result2 = PICTURE::deletepromoposts($id);
\r
76 if($result2['status'] == 'error') echo $result2['message'];
\r
79 $_POST['id'] = $result['albumid'];
\r
82 } else echo 'No permission to delete picture<br/>';
\r
85 $id = requestVar('id');
\r
86 if($gmember->canModifyPicture($id)) {
\r
87 $pict = new PICTURE($id);
\r
88 $pict->setTitle(requestVar('ptitle'));
\r
89 $pict->setDescription(requestVar('pdesc'));
\r
90 $aid = requestVar('aid');
\r
91 if($aid && $gmember->canAddPicture($aid)) {
\r
92 ALBUM::decreaseNumberByOne($pict->getAlbumID());
\r
93 ALBUM::increaseNumberByOne($aid);
\r
94 $pict->setAlbumID($aid);
\r
97 $manager->notify('NPgPostUpdatePicture',array('picture', &$pict));
\r
104 $blogid = $CONF['DefaultBlog'];
\r
106 $b =& $manager->getBlog($blogid);
\r
109 selectSkin('NPGallery');
\r
111 $skin =& new SKIN($skinid);
\r
112 $skin->parse('index');
\r