From 3741a16e708fb022d6d05f353c581af831bedf3e Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sat, 5 Jul 2008 13:38:57 +0000 Subject: Redid InstaDisc, new technique in store New technique is to use XML-RPC hooks instead of a pre-built HTML interface so people who host Central Servers will not have to use the default interface, instead allowing them to create their own. --- central/trunk/.htaccess | 4 + central/trunk/db.php | 21 +++++ central/trunk/includes/common.php | 14 ---- central/trunk/includes/db.php | 21 ----- central/trunk/includes/template.php | 160 ------------------------------------ central/trunk/install.php | 20 +++++ 6 files changed, 45 insertions(+), 195 deletions(-) create mode 100644 central/trunk/.htaccess create mode 100644 central/trunk/db.php delete mode 100644 central/trunk/includes/common.php delete mode 100644 central/trunk/includes/db.php delete mode 100644 central/trunk/includes/template.php create mode 100644 central/trunk/install.php diff --git a/central/trunk/.htaccess b/central/trunk/.htaccess new file mode 100644 index 0000000..aad8de8 --- /dev/null +++ b/central/trunk/.htaccess @@ -0,0 +1,4 @@ +RewriteEngine On +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d +RewriteRule ^(.+) /theme/$1 [QSA,L] diff --git a/central/trunk/db.php b/central/trunk/db.php new file mode 100644 index 0000000..c492722 --- /dev/null +++ b/central/trunk/db.php @@ -0,0 +1,21 @@ + diff --git a/central/trunk/includes/common.php b/central/trunk/includes/common.php deleted file mode 100644 index 39a7ed2..0000000 --- a/central/trunk/includes/common.php +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/central/trunk/includes/db.php b/central/trunk/includes/db.php deleted file mode 100644 index 2fe1eed..0000000 --- a/central/trunk/includes/db.php +++ /dev/null @@ -1,21 +0,0 @@ - diff --git a/central/trunk/includes/template.php b/central/trunk/includes/template.php deleted file mode 100644 index cf2a6ab..0000000 --- a/central/trunk/includes/template.php +++ /dev/null @@ -1,160 +0,0 @@ -file = $tfn; - } else { - throw new Exception($tfn . ' does not exist'); - } - } - - function add($name, $value) - { - $this->tags[$name] = $value; - } - - function adds($tagarr) - { - foreach ($tagarr as $name => $value) - { - add($name,$value); - } - } - - function adds_block($block, $tagarr) - { - if (!isset($this->blocks[$block])) - { - $this->blocks[$block] = array('count' => 1); - } - foreach ($tagarr as $name => $value) - { - $this->blocks[$block][$this->blocks[$block]['count']][$name] = $value; - } - $this->blocks[$block]['count']++; - } - - function add_ref($id, $block, $tagarr) - { - $this->adds_block($block,$tagarr); - $this->refs[$id] = &$this->blocks[$block][$this->blocks[$block]['count']-1];//'$this->blocks[\'' . $block . '\'][' . ($this->blocks[$block]['count']-1) . ']'; - } - - function adds_ref($id, $tagarr) - { - foreach ($tagarr as $name => $value) - { - $this->refs[$id][$name] = $value; - } - } - - function adds_ref_sub($id, $block, $tagarr) - { - if (!isset($this->refs[$id][$block])) - { - $this->refs[$id][$block] = array('count' => 1); - } - foreach ($tagarr as $name => $value) - { - $this->refs[$id][$block][$this->refs[$id][$block]['count']][$name] = $value; - } - $this->refs[$id][$block]['count']++; - } - - function display() - { - $template = file_get_contents($this->file); - while (preg_match('//',$template) == 1) - { - preg_match('//',$template,$mat); - $fname = $mat[1]; - $itmp = new FITemplate($fname); - $template = str_replace('',file_get_contents($itmp->file),$template); - } - if (isset($this->tags)) - { - foreach ($this->tags as $name => $value) - { - $template = str_replace('',$value,$template); - } - } - if (isset($this->blocks)) - { - foreach ($this->blocks as $bname => $block) - { - $this->parseBlock($template, $bname, $block); - } - } - while (preg_match('//',$template) == 1) - { - preg_match('//',$template,$mat); - $bname = $mat[1]; - $start = strpos($template,''); - $end = strpos($template,''); - $template = str_replace(substr($template,$start,$end-$start+strlen($bname)+11),'',$template); - } - $template = preg_replace('//','',$template); - echo($template); - } - - function parseBlock(&$template, $bname, $block) - { - while (strpos($template,'') !== FALSE) - { - $start = strpos($template,''); - $end = strpos($template,''); - $gencont = substr($template,$start+strlen($bname)+13,$end-$start-strlen($bname)-13); - $blockcont = ''; - foreach ($block as $lname => $blocktags) - { - if ($lname != 'count') - { - $scrcont = $gencont; - foreach ($blocktags as $name => $value) - { - if (!is_array($value)) - { - $scrcont = str_replace('',$value,$scrcont); - } else { - $this->parseBlock($scrcont, $bname . '.' . $name, $value); - } - } - $blockcont .= $scrcont; - } - } - $template = str_replace(substr($template,$start,$end-$start+strlen($bname)+11),$blockcont,$template); - } - } - -} - -?> diff --git a/central/trunk/install.php b/central/trunk/install.php new file mode 100644 index 0000000..f689875 --- /dev/null +++ b/central/trunk/install.php @@ -0,0 +1,20 @@ +Welcome to the InstaDisc Central Server installation! Please input your database details here:

Database host:
Username:
Password:
Database name: (Note: You must create this database BEFORE running installation)
Oops! Something went wrong!Oops! Something went wrong! -- cgit 1.4.1