Guest User

Untitled

a guest
May 22nd, 2018
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.80 KB | None | 0 0
  1. Fatal error: Class 'settings' not found in C:wampwwwSYSTEMview.php on line 22
  2.  
  3. <?php
  4. //First of all, start with some advertisement
  5. header("X-Powered-By:ZOMFG CMS, and ofcourse PHP, but that's less important");
  6. //Then less impotant stuff lololol.
  7. session_start(); //Start a session
  8. mysql_connect($db_host, $db_user, $db_pass); //Connect to database
  9. mysql_select_db($db_name); //Select a database
  10.  
  11. //Load core
  12. require_once("core.php");
  13.  
  14. //Load modules
  15. $res_modules = mysql_query("SELECT * FROM ".$_SERVER["db_prefix"]."modules WHERE enabled=1");
  16. echo mysql_error();
  17. $module_exists = array();
  18. while($row_modules = mysql_fetch_array($res_modules))
  19. {
  20. //Load module
  21. $name = $row_modules["name"];
  22. modules::load_module($name);
  23. //and initialize it
  24. eval($name."::init();");
  25. //Yes, it exists
  26. $module_exists[$name] = true;
  27. }
  28.  
  29. //Check if the user wants shit from a module
  30. if(isset($_GET["m"]))//Yes the user want it
  31. {
  32. //Does the module exist and activated, and has it a function called view?
  33. if(isset($module_exists[$_GET["m"]]) && method_exists($_GET["m"], "view"))//Yep
  34. {
  35. //Load view (should be an array)
  36. eval("$module_view = ".$_GET["m"]."::view();");
  37. if(!is_array($module_view))//Not an array :(
  38. {
  39. error::e500module($_GET["m"], $_SERVER["REQUEST_URI"]);
  40. }
  41. else//The error would kill the entire script, m'kay
  42. {
  43. view::index();
  44. }
  45. }
  46. else//Nope, so display error
  47. {
  48. error::e404($_SERVER['REQUEST_URI']);
  49. }
  50. }
  51.  
  52. <?php
  53. class settings
  54. {
  55. function get($what)
  56. {
  57. $result_get = mysql_query("SELECT value FROM ".$_SERVER["db_prefix"]."settings WHERE key='$what'");
  58. if(mysql_num_rows($result_get) > 0)
  59. {
  60. $row_get = mysql_fetch_array($result_get);
  61. return $result_get["value"];
  62. }
  63. else
  64. {
  65. return -1;
  66. }
  67. }
  68. }
  69.  
  70. <?php
  71. //Load core classes
  72. require_once("settings.php");
  73. require_once("error.php");
  74. require_once("theme.php");
  75. require_once("view.php");
  76. require_once("modules.php");
  77.  
  78. <?php
  79. class view
  80. {
  81. function head()
  82. {
  83. include("../THEMES/".settings::get("theme")."/head.php");
  84. }
  85. function foot()
  86. {
  87. include("../THEMES/".settings::get("theme")."/foot.php");
  88. }
  89. function left()
  90. {
  91. include("../THEMES/".settings::get("theme")."/left.php");
  92. }
  93. function right()
  94. {
  95. include("../THEMES/".settings::get("theme")."/right.php");
  96. }
  97. function index()
  98. {
  99. include("../THEMES/".settings::get("theme")."/index.php");
  100. }
  101. }
  102.  
  103. <?php
  104. $db_host = "localhost"; //Database host
  105. $db_user = "root"; //Database user
  106. $db_pass = "you may not know this"; //Database password
  107. $db_name = "zomfg"; //Database name
  108. $_SERVER["db_prefix"] = "zomfg_";//Prefix, needs to be superglobal
  109.  
  110. the file including the offending class lacks the initial '<?'
Add Comment
Please, Sign In to add comment