require_once 'common.php'; $access_control->su_check(access_control::SU_RIGHT_EDITORWORLD,true); page_header('Spott Editor'); grotto_nav(); if ($_GET['op']=='edit') { addnav('Spotteditor','su_taunt.php'); $str_output .= '
'; } else if($_GET['op']=='del') { $sql = 'DELETE FROM taunts WHERE tauntid='.$_GET['tauntid']; db_query($sql); redirect("su_taunt.php?c=x"); } else if($_GET['op']=='save') { if ($_GET['tauntid']!='') { $sql = 'UPDATE taunts SET taunt="'.$_POST['taunt'].'" WHERE tauntid='.$_GET['tauntid']; } else { $sql = 'INSERT INTO taunts (taunt,editor) VALUES ("'.$_POST['taunt'].'","'.addslashes($session['user']['login']).'")'; } db_query($sql); redirect("su_taunt.php?c=x"); } else { $sql = 'SELECT * FROM taunts ORDER BY taunt ASC'; $result = db_query($sql); $str_output .= '| '; $str_output .= '[Edit|Löschen]'; addnav('','su_taunt.php?op=edit&tauntid='.$row['tauntid']); addnav('','su_taunt.php?op=del&tauntid='.$row['tauntid']); $str_output .= ' | '; $str_output .= ''; $str_output .= $row['taunt']; $str_output .= ' | '; $str_output .= ''; $str_output .= $row['editor']; $str_output .= ' | '; $str_output .= '