[ Index ] |
PHP Cross Reference of phpwcms V1.4.3 _r380 (23.11.09) |
[Summary view] [Print] [Text view]
1 <?php 2 /************************************************************************************* 3 Copyright notice 4 5 (c) 2002-2009 Oliver Georgi (oliver@phpwcms.de) // All rights reserved. 6 7 This script is part of PHPWCMS. The PHPWCMS web content management system is 8 free software; you can redistribute it and/or modify it under the terms of 9 the GNU General Public License as published by the Free Software Foundation; 10 either version 2 of the License, or (at your option) any later version. 11 12 The GNU General Public License can be found at http://www.gnu.org/copyleft/gpl.html 13 A copy is found in the textfile GPL.txt and important notices to the license 14 from the author is found in LICENSE.txt distributed with these scripts. 15 16 This script is distributed in the hope that it will be useful, but WITHOUT ANY 17 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 18 PARTICULAR PURPOSE. See the GNU General Public License for more details. 19 20 This copyright notice MUST APPEAR in all copies of the script! 21 *************************************************************************************/ 22 23 // session_name('hashID'); 24 session_start(); 25 26 $ref = $_SESSION['REFERER_URL']; 27 $phpwcms = array(); 28 require_once ('../../config/phpwcms/conf.inc.php'); 29 require_once ('../inc_lib/default.inc.php'); 30 require_once (PHPWCMS_ROOT.'/include/inc_lib/dbcon.inc.php'); 31 require_once (PHPWCMS_ROOT.'/include/inc_lib/general.inc.php'); 32 checkLogin(); 33 require_once (PHPWCMS_ROOT.'/include/inc_lib/backend.functions.inc.php'); 34 35 if(isset($_GET["do"])) { 36 $values = explode(",", $_GET["do"]); 37 if(count($values)) { 38 switch(intval($values[0])) { 39 case 9: //delete article content part 40 $sql = "UPDATE ".DB_PREPEND."phpwcms_articlecontent SET acontent_trash=9". 41 " WHERE (acontent_uid=".$_SESSION["wcs_user_id"]." OR ".$_SESSION["wcs_user_admin"].")". 42 " AND acontent_aid=".intval($values[1]). 43 " AND acontent_id=".intval($values[2]).";"; 44 mysql_query($sql, $db) or die("error while deleting content part"); 45 break; 46 case 1: //delete article 47 $sql = "UPDATE ".DB_PREPEND."phpwcms_article SET article_deleted=9, article_alias=CONCAT(article_alias,'_del-','".date('YmdHis')."')". 48 " WHERE (article_uid=".$_SESSION["wcs_user_id"]." OR ".$_SESSION["wcs_user_admin"].")". 49 " AND article_id=".intval($values[1]).";"; 50 mysql_query($sql, $db) or die("error while deleting article"); 51 $ref .= '&p=&s=&id='; 52 break; 53 case 2: //make content visible/invisible 54 $sql = "UPDATE ".DB_PREPEND."phpwcms_articlecontent SET acontent_visible=".intval($values[3]). 55 " WHERE (acontent_uid=".$_SESSION["wcs_user_id"]." OR ".$_SESSION["wcs_user_admin"].")". 56 " AND acontent_aid=".intval($values[1]). 57 " AND acontent_id=".intval($values[2]).";"; 58 mysql_query($sql, $db) or die("error while changing content visible/invisible"); 59 break; 60 case 3: //make article visible/invisible 61 $sql = "UPDATE ".DB_PREPEND."phpwcms_article SET article_aktiv=".intval($values[3]). 62 " WHERE article_id=".intval($values[1]).";"; 63 mysql_query($sql, $db) or die("error while changing article visible/invisible"); 64 break; 65 case 4: //make article public/nonpublic 66 $sql = "UPDATE ".DB_PREPEND."phpwcms_article SET article_public=".intval($values[3]). 67 " WHERE article_id=".intval($values[1]).";"; 68 mysql_query($sql, $db) or die("error while changing article visible/invisible"); 69 break; 70 } 71 } 72 } 73 74 if(isset($_GET["sort"])) { 75 list($value1, $value2) = explode("|", $_GET["sort"]); 76 list($id1, $sort1) = explode(":", $value1); list($id2, $sort2) = explode(":", $value2); 77 $id1 = intval($id1); $id2 = intval($id2); $sort1 = intval($sort1); $sort2 = intval($sort2); 78 79 $sql1 = "UPDATE ".DB_PREPEND."phpwcms_articlecontent SET acontent_sorting=".$sort1. 80 " WHERE (acontent_uid=".$_SESSION["wcs_user_id"]." OR ".$_SESSION["wcs_user_admin"].")". 81 " AND acontent_id=".$id1.";"; 82 $sql2 = "UPDATE ".DB_PREPEND."phpwcms_articlecontent SET acontent_sorting=".$sort2. 83 " WHERE (acontent_uid=".$_SESSION["wcs_user_id"]." OR ".$_SESSION["wcs_user_admin"].")". 84 " AND acontent_id=".$id2.";"; 85 mysql_query($sql1, $db) or die("error while changing content part's sorting"); 86 mysql_query($sql2, $db) or die("error while changing content part's sorting"); 87 } 88 89 update_cache(); 90 headerRedirect($ref); 91 92 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Wed Dec 30 05:55:15 2009 | Cross-referenced by PHPXref 0.7 |