move code up one directory
[atutor.git] / mods / _standard / forums / forum / stick.php
1 <?php
2 /****************************************************************/
3 /* ATutor                                                                                                               */
4 /****************************************************************/
5 /* Copyright (c) 2002-2010                                      */
6 /* Inclusive Design Institute                                   */
7 /* http://atutor.ca                                                                                             */
8 /*                                                              */
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
14 define('AT_INCLUDE_PATH', '../../../../include/');
15 require(AT_INCLUDE_PATH.'vitals.inc.php');
16
17 authenticate(AT_PRIV_FORUMS);
18
19 $pid = intval($_GET['pid']);
20
21 /* ABS(sticky-1) : if 1 then 0, if 0 then 1 */
22 $sql    = "UPDATE ".TABLE_PREFIX."forums_threads SET sticky=ABS(sticky-1), last_comment=last_comment, date=date WHERE post_id=$pid";
23 $result = mysql_query($sql, $db);
24
25 $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
26
27 header('Location: '.AT_BASE_HREF.'mods/_standard/forums/forum/index.php?fid='.intval($_GET['fid']));
28 exit;
29
30 ?>