dbcon = mysql_connect($host, $user, $pass); return $this->dbcon; } function selectDB($db){ $selected = @mysql_select_db($db, $this->dbcon); return $selected; } function loadTemplate(){ $this->content = file_get_contents("includes/template.php"); } function addStaticContent($stuff){ $this->pagecontent .= $stuff; } function getSetting($setting){ //Stuff to process setting return false; } function loadPageAds(){ if($this->getSetting('noads')){ } else{ $this->content = str_replace("##ADBLOCK##", file_get_contents("includes/adblock.txt"), $this->content); } } function loadContent($file, $stuff = false){ if($file == "static"){ $this->content = str_replace("##CONTENT##", $stuff, $this->content); } else{ $this->content = str_replace("##CONTENT##", file_get_contents("includes/$file.php", $this->content)); } } } $s0rs = new s0rscms(); $s0rs->content = ''; $s0rs->loadTemplate(); if($s0rs->connectDB("localhost", "web", "web")){ $s0rs->addStaticContent("I can connect to the DB server @ localhost"); } if($s0rs->selectDB("mysql")){ $s0rs->addStaticContent(" and I can select the mysql DB!"); } $s0rs->loadPageAds(); $s0rs->loadContent("static", $s0rs->pagecontent); print $s0rs->content; ?>