Advertisement
zachdyer

PHP CMS Example

Feb 2nd, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.60 KB | None | 0 0
  1. <?php
  2. //Console Logger
  3. function consoleLog($entry){
  4.     echo "<script>console.log('$entry')</script>";
  5. }
  6.  
  7. //Is the CMS Installed?
  8. if(file_exists("admin/config.php")){
  9.     //Connect to database
  10.     require('admin/config.php');
  11.     $mysqli = new mysqli($config['db_host'], $config['db_user'], $config['db_pass'], $config['db_name']);
  12.    
  13.     //Get Theme
  14.     $sql = "select value from settings where setting = 'theme'";
  15.     $themePath = "themes/" . $mysqli->query($sql)->fetch_assoc()['value'] . "/";
  16.    
  17.     //Spawn Theme
  18.     include($themePath . "index.php");
  19.  
  20. //Install CMS
  21. } else {
  22.     include("admin/core/install/install.php");
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement