Просмотр файла forum/thmedit.php

Размер файла: 2.03Kb
  1. <?php
  2. require_once ("../includes/start.php");
  3. require_once ("../includes/functions.php");
  4. require_once ("../includes/header.php");
  5. include_once ("../themes/".$config['themes']."/index.php");
  6. include_once ("../includes/db.php");
  7.  
  8. if (is_admin(array(101,102,103,105))){
  9.  
  10. $id = (int)$_GET['id'];
  11. if ($id) {
  12. $check = mysql_fetch_array(mysql_query("SELECT * FROM `theme` WHERE `id` = '$id'"));
  13. if (!empty($check)) {
  14.  
  15.  
  16. if (isset($_POST['edits'])) {
  17. $theme = check($_POST['theme']);
  18. $description = check($_POST['description']);
  19.  
  20. if (!isset($theme {3})) {header ("Location: thmedit.php?id=".$id."&isset=stheme"); exit;}
  21. if (strlen($theme) > 50) {header ("Location: thmedit.php?id=".$id."&isset=btheme"); exit;}
  22. mysql_query("UPDATE `theme` SET `name`='".$theme."' WHERE `id` = '".$id."'");
  23. mysql_query("UPDATE `theme` SET `description`='".$description."' WHERE `id` = '".$id."'");
  24. header ("Location: ".$config['home']."/forum/?act=posts&id=".$id."&start=".strts($id,$config['forumpost']).""); exit;
  25. }
  26.  
  27. $thms = mysql_query("SELECT * FROM `theme` WHERE `id` = '$id' ");
  28. $thm = mysql_fetch_array($thms);
  29. echo '<div class="b">Управление темой:</div><div>';
  30. echo "<form action='".$config['home']."/forum/thmedit.php?id=".$id."' method='post'>\n";
  31. echo "Название:<br><input type='text' name='theme' maxlength='50' value='" . $thm['name'] . "'><br>\n";
  32. echo "Описание:<br><input type='text' name='description' maxlength='100' value='" . $thm['description'] . "'><br>\n";
  33. echo "<input type='submit' name='edits' value='Отправить'></form></div>";
  34.  
  35. }}}
  36.  
  37. echo '<hr><div>';
  38. echo ': <a href="'.$config['home'].'/forum/?act=posts&amp;id='.$id.'&amp;start='.strts($id,$config['forumpost']).'">В тему</a><br>';
  39. echo ':: <a href="'.$config['home'].'/forum/">В форум</a><br>';
  40. echo '::: <a href="'.$config['home'].'/">На главную</a><br>';
  41. echo '</div>';
  42.  
  43. echo '<a href="http://7je.ru">ByForum 1.5 DEMO</a>';
  44.  
  45. include_once ("../themes/".$config['themes']."/foot.php");
  46. ?>