/* * grifare.net * Author name : Armagan Tekdoner * Date : May 2015 * File name : oop.txt * File location : https://www.grifare.net/examples/oop/oop.txt ,---.| |o ,---. o ,---. `---.|--- . .,---|.,---. | _.,---.. |__.,---.,---.,---. || | || ||| | | || | | ,---|| |---' `---'`---'`---'`---'``---' `---'` ` ` `---^` `---' */ // CONTENTS OF website.php FILE class Website { // class Website's attributes public $title = "Dummy website using PHP classes"; public $keywords = "Object-oriented PHP"; public $links = array("Home" => "home.php", "Photography" => "photography.php", "Literature" => "literature.php", "Web Development" => "web_development.php", "About" => "about.php" ); public $content; // class Website's operations public function __set($name, $value) { $this->$name = $value; } // page structure in a function public function page() { echo ""; $this -> Title(); $this -> Keywords(); $this -> stylesheet(); echo ""; $this -> Header(); $this -> DisplayMenu($this->links); echo $this->content; $this -> footer(); echo ""; } public function Title() { echo "".$this->title.""; } public function Keywords() { echo "keywords."\"/>"; echo ""; } public function stylesheet() { // inserts the external stylesheet echo ""; } public function DisplayMenu($links) { echo ""; } public function Header() { // inserts logo echo "Studio Gri Fare"; } public function checkURL($url) { // reads the URL compares it to the link being visited if( strpos($_SERVER['PHP_SELF'], $url )==false) { return false; } else{ return true; } } public function openPage($name,$url,$active = true) { if ($active) { echo "
  • ".$name."
  • "; } else { // removes the hyperlink echo "
  • ".$name."
  • "; } } public function footer() { // copyleft notice $time = time(); // gets the current time off of the server $year= date("Y",$time); // formats it to display just the year $copyleft = "copyleft © 2015 - " . $year . " by Armagan Tekdoner"; echo ""; } }// close class Website