/*************************************************************************** Jupiter Content System @ Jupiterportal.com Copyright (C) 2005 Cosmin Flavius (highstrike@gmail.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. More Info About The Licence At http://www.gnu.org/copyleft/gpl.html ****************************************************************************/ //----------------------------------------------------------------- // Filter Acces Rightes //----------------------------------------------------------------- if(isset($is_guest) || isset($is_user)) { header("location: $PHP_SELF?i=2"); exit; } switch($a) { //----------------------------------------------------------------- // Add badword //----------------------------------------------------------------- case 1: //----------------------------------------------------------------- // Begin Check //----------------------------------------------------------------- if(!$word){ header("location: $PHP_SELF?n=modules/badwords&i=75"); exit; } if(!$replacement){ header("location: $PHP_SELF?n=modules/badwords&i=76"); exit; } //----------------------------------------------------------------- // Add the badword //----------------------------------------------------------------- $db->insertRow("badwords",array('word' => ''.$word.'','replacement' => ''.$replacement.'')); //----------------------------------------------------------------- // Write Log //----------------------------------------------------------------- $db->insertRow("log",array('user_id' => ''.$_SESSION['id'].'','user_user' => ''.$_SESSION['username'].'','log' => ''.$language['Logs desc3'].' badwords the badword -> \''.$word.'\'','date' => ''.time().'')); //----------------------------------------------------------------- // Add the badword //----------------------------------------------------------------- header("location: $PHP_SELF?n=modules/badwords&i=72"); break; //----------------------------------------------------------------- // Delete badword //----------------------------------------------------------------- case 2: //----------------------------------------------------------------- // Write Log //----------------------------------------------------------------- $checker = $db->getLine("SELECT * FROM badwords WHERE id = '$d'"); $db->insertRow("log",array('user_id' => ''.$_SESSION['id'].'','user_user' => ''.$_SESSION['username'].'','log' => ''.$language['Logs desc'].' badwords the badword -> \''.$checker['word'].'\'','date' => ''.time().'')); //----------------------------------------------------------------- // Delete the badword //----------------------------------------------------------------- $db->deleteRow("badwords","id = '$d'"); //----------------------------------------------------------------- // Redirect when finished //----------------------------------------------------------------- header("location: $PHP_SELF?n=modules/badwords&i=73"); break; //----------------------------------------------------------------- // Update badwords //----------------------------------------------------------------- case 3: //----------------------------------------------------------------- // Begin Check //----------------------------------------------------------------- foreach($word as $idx=>$val) if(!$word[$idx]){ header("location: $PHP_SELF?n=modules/badwords&i=75"); exit; } foreach($replacement as $idx=>$val) if(!$replacement[$idx]){ header("location: $PHP_SELF?n=modules/badwords&i=76"); exit; } //----------------------------------------------------------------- // Save the badwords //----------------------------------------------------------------- foreach($word as $idx=>$val) $db->query("Update `badwords` set `word` = '$val' WHERE `id` = '$idx'"); foreach($replacement as $idx=>$val) $db->query("Update `badwords` set `replacement` = '$val' WHERE `id` = '$idx'"); //----------------------------------------------------------------- // Write Log //----------------------------------------------------------------- $db->insertRow("log",array('user_id' => ''.$_SESSION['id'].'','user_user' => ''.$_SESSION['username'].'','log' => ''.$language['Logs desc2'].' badwords','date' => ''.time().'')); //----------------------------------------------------------------- // Redirect when finished //----------------------------------------------------------------- header("location: $PHP_SELF?n=modules/badwords&i=74"); break; //----------------------------------------------------------------- // View Badwords Form //----------------------------------------------------------------- default: //----------------------------------------------------------------- // Load Badwords table //----------------------------------------------------------------- $badwords_db = $db->getTable("SELECT * FROM badwords"); if($badwords_db != FALSE) { foreach($badwords_db as $idx=>$badword) { //----------------------------------------------------------------- // Make Layout //----------------------------------------------------------------- $layout .= "
{$language['Admin name']} | ||
» {$language['Admin back']} |