PageRenderTime 47ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/admin/includes/edit_static_content.php

https://bitbucket.org/mpercy/deeemm-cms
PHP | 51 lines | 28 code | 16 blank | 7 comment | 3 complexity | 879dd5ae7889ba69230e349529d39357 MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause
  1. <?php
  2. defined( '_INDM' ) or die( 'POSSIBLE HACK ATTEMPT!' );
  3. /*===========================================================================
  4. Check user priviledges
  5. ===========================================================================*/
  6. require VALIDATE;
  7. if ($user != 'ADMIN') header("Location: " . $default_url . "index.php");
  8. $admin_title = $lan[$action];
  9. //$description_lan_1 = mysql_escape_string(stripslashes($_REQUEST['description_lan_1']));
  10. $description_lan_1 = $_REQUEST['description_lan_1'];
  11. $action = str_replace( 'edit_', '', $action);
  12. switch ($action) {
  13. case 'save_static_content';
  14. $page = $_REQUEST['page'];
  15. mysql_query("UPDATE `" . $db_table_prefix . "static_content` SET `description_lan_1` = '$description_lan_1' WHERE `category` = '$page'");
  16. header("Location: " . $default_url . "index.php");
  17. break;
  18. case $action;
  19. $page = $action;
  20. $sql_query = mysql_query("SELECT * FROM `" . $db_table_prefix . "static_content` WHERE `category` = '$page'");
  21. while($sql_result = mysql_fetch_array($sql_query)){
  22. $description_lan_1 = rtesafe($sql_result[description_lan_1]);
  23. }
  24. $rte_editor_rows = '30';
  25. $rte_editor_width = '100%';
  26. break;
  27. default :
  28. break;
  29. }
  30. $main = read_file("templates/edit_static_content.tpl");
  31. /*===========================================================================
  32. //>replace template markers with variables
  33. ===========================================================================*/
  34. $main = replace_variables($main);
  35. ?>