Permalink
Browse files

removed old page gen structure

  • Loading branch information...
1 parent 57bb7c8 commit cb20d39d680b1ebf52aa9dd9f911bf84b1cfc1c8 @xcaww committed Mar 23, 2011
View
@@ -1,40 +0,0 @@
-<?php
-
-class database extends core{
-
- function connect_database(){
-
- $this->connectionLink = mysql_connect("localhost", "root", "rscbU");
-
- if($this->connectionLink){
-
- mysql_select_db("oskarr");
-
- }else{
-
- parent::send_error_log("Could not create a connection the to database");
-
- }
-
- }
-
- function query($databaseQuery){
-
- $query = mysql_query($databaseQuery);
-
- if(!$query){
-
- $errorMessage = (string) "query: " . mysql_error();
- parent::send_error_log($errorMessage);
-
- }else{
-
- return $query;
-
- }
-
- }
-
-}
-
-
View
No changes.
View
@@ -1,94 +0,0 @@
-<?php
-
-class generatePage extends core{
-
- function __construct($pageIdentifier, $pageQuery, $pageNumber){
-
- $this->page = $pageIdentifier;
- $this->query = $pageQuery;
-
- if($pageNumber != false){
-
- $this->number = $pageNumber;
-
- }else{
-
- $this->number = false;
-
- }
-
- parent::database_connect();
- $this->validate_query();
- $this->find_page();
- $this->generate_page();
-
- }
-
- function validate_query(){
-
- if(ctype_alnum($this->page) == true && ctype_alnum($this->query) == true && strlen($this->page) < 33 && strlen($this->query) < 57){
-
- return true;
-
- }else{
-
- parent::send_error_log("bad page query: " . $this->page . "?" . $this->query . " -> " . $this->number);
-
- }
-
- }
-
- function find_page(){
-
- if(ctype_digit($this->page)){
-
- $result = parent::database_query("
- SELECT *
- FROM pages
- WHERE id = '" . $this->page . "'
- ");
-
- }elseif(ctype_alnum($this->page)){
-
- $result = parent::database_query("
- SELECT *
- FROM pages
- WHERE address = '" . $this->page . "'
- ");
-
- }else{
-
- parent::send_error_log("bad page request: " . $this->page . "?" . $this->query);
-
- }
-
- while($row = mysql_fetch_array($result)){
-
- $this->pageDetails['id'] = $row['id'];
- $this->pageDetails['name'] = $row['name'];
- $this->pageDetails['address'] = $row['address'];
-
- }
-
- if(!isset($this->pageDetails)){
-
- parent::send_error_log("could not find page: " . $this->page . "?" . $this->query);
-
- }
-
- $this->pageDetails['query'] = $this->query;
- $this->pageDetails['number'] = $this->number;
- return true;
-
- }
-
- function generate_page(){
-
- require("./engine/page/page_producer.php");
- $producer = new pageProducer($this->pageDetails, $this->query);
-
- }
-
-}
-
-?>
@@ -1,58 +0,0 @@
-<?php
-
-class pageProducer extends core{
-
- function __construct($pageDetails, $pageQuery, $mappedPage){
-
-
- $this->add_array_item("pageName", $pageDetails['name']);
- $this->add_array_item("pageID", $pageDetails['id']);
- $this->add_array_item("pageAddress", $pageDetails['address']);
- $this->add_array_item("channelAddress", $mappedPage);
- $this->add_array_item("pageQuery", $pageQuery);
-
- require_once("./engine/page/" . $this->pageDataArray['pageAddress'] . "/function/page_function.php"); //core functions; other function scripts may be called later on during this class!
- $this->channel = new channel($this->pageDataArray['pageQuery'], $this->pageDataArray['channelAddress']);
- $this->construct_data();
-
- }
-
- function add_array_item($associativeKey, $associativeData){
-
- if(ctype_alnum($associativeKey)){
-
- $this->pageDataArray[$associativeKey] = $associativeData;
-
- }else{
-
- send_error_log("page generation failed: invalid array key parsed -> [" . $associativeKey . "] = ". $associativeData);
-
- }
-
- }
-
- function construct_data(){
-
- $this->pageTemplate = "main_index.php";
- $this->add_array_item("styles", "main_index.css");
- $this->add_array_item("thread", $this->channel->get_threads());
- $this->add_array_item("post", null);
-
- foreach($this->pageDataArray['thread'] as $thread){
-
- $this->pageDataArray['post'][$thread['id']] = $this->channel->get_posts($thread['id']);
-
- }
-
- }
-
- function produce_page(){
-
- require("./engine/page/" . $this->pageDataArray['pageAddress'] . "/product/" . $this->pageTemplate);
- build_page($this->pageDataArray);
-
- }
-
-}
-
-?>
@@ -1,60 +0,0 @@
-<?php
-
-/*
- @ OSKARR (beta)
- @
- @ page_producer
- @
- @ This script utilizes the variables given from gen_page and the
- @ associated functions based in the functions directory.
-
-*/
-
-class pageProducer extends core{
-
- function __construct($pageDetails, $pageQuery){
-
-
- $this->add_array_item("pageName", $pageDetails['name']);
- $this->add_array_item("pageID", $pageDetails['id']);
- $this->add_array_item("pageAddress", $pageDetails['address']);
- $this->add_array_item("pageQuery", $pageQuery);
-
- require_once("./engine/page/" . $this->pageDataArray['pageAddress'] . "/function/page_function.php"); //core functions; other function scripts may be called later on during this class!
- $this->channels = new channels();
- $this->construct_data();
-
- }
-
- function add_array_item($associativeKey, $associativeData){
-
- if(ctype_alnum($associativeKey)){
-
- $this->pageDataArray[$associativeKey] = $associativeData;
-
- }else{
-
- send_error_log("page generation failed: invalid array key parsed");
-
- }
-
- }
-
- function construct_data(){
-
- $this->pageTemplate = "main_index.php";
- $this->add_array_item("styles", "main_index.css");
- $this->add_array_item("channels", $this->channels->channels);
-
- }
-
- function produce_page(){
-
- require("./engine/page/" . $this->pageDataArray['pageAddress'] . "/product/" . $this->pageTemplate);
- build_page($this->pageDataArray);
-
- }
-
-}
-
-?>
@@ -1,50 +0,0 @@
-<?php
-
-class pageProducer extends core{
-
- function __construct($pageDetails, $pageQuery, $mappedPage){
-
-
- $this->add_array_item("pageName", $pageDetails['name']);
- $this->add_array_item("pageID", $pageDetails['id']);
- $this->add_array_item("pageAddress", $pageDetails['address']);
- $this->add_array_item("pageQuery", $pageQuery);
-
- require_once("./engine/page/" . $this->pageDataArray['pageAddress'] . "/function/page_function.php"); //core functions; other function scripts may be called later on during this class!
- $this->post = new post($this->pageDataArray['pageQuery']);
- $this->construct_data();
-
- }
-
- function add_array_item($associativeKey, $associativeData){
-
- if(ctype_alnum($associativeKey)){
-
- $this->pageDataArray[$associativeKey] = $associativeData;
-
- }else{
-
- send_error_log("page generation failed: invalid array key parsed -> [" . $associativeKey . "] = ". $associativeData);
-
- }
-
- }
-
- function construct_data(){
-
- $this->pageTemplate = "main_index.php";
- $this->add_array_item("styles", "main_index.css");
- $this->add_array_item("thread", $this->post->get_thread());
-
- }
-
- function produce_page(){
-
- require("./engine/page/" . $this->pageDataArray['pageAddress'] . "/product/" . $this->pageTemplate);
- build_page($this->pageDataArray);
-
- }
-
-}
-
-?>
@@ -1,61 +0,0 @@
-<?php
-
-/*
- @ OSKARR (beta)
- @
- @ page_producer
- @
- @ This script utilizes the variables given from gen_page and the
- @ associated functions based in the functions directory.
-
-*/
-
-
-class pageProducer extends core{
-
- function __construct($pageDetails, $pageQuery){
-
-
- $this->add_array_item("pageName", $pageDetails['name']);
- $this->add_array_item("pageID", $pageDetails['id']);
- $this->add_array_item("pageAddress", $pageDetails['address']);
- $this->add_array_item("pageQuery", $pageQuery);
-
- require_once("./engine/page/" . $this->pageDataArray['pageAddress'] . "/function/page_function.php"); //core functions; other function scripts may be called later on during this class!
- $this->template = new template();
- $this->construct_data();
-
- }
-
- function add_array_item($associativeKey, $associativeData){
-
- if(ctype_alnum($associativeKey)){
-
- $this->pageDataArray[$associativeKey] = $associativeData;
-
- }else{
-
- send_error_log("page generation failed: invalid array key parsed");
-
- }
-
- }
-
- function construct_data(){ //Everything to build each piece of data for the custom page is called from here.
-
- $this->pageTemplate = "main_index.php";
- $this->add_array_item("styles", "main_index.css");
-
- }
-
-
- function produce_page(){
-
- require("./engine/page/" . $this->pageDataArray['pageAddress'] . "/product/" . $this->pageTemplate);
- build_page($this->pageDataArray);
-
- }
-
-}
-
-?>

0 comments on commit cb20d39

Please sign in to comment.