summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot2014-03-10 15:31:56 +0100
committerroot2014-03-10 15:31:56 +0100
commit833d72001d3df1680913759ff760708766618eb8 (patch)
tree33bb53833e39063e523ee76cd54bab305590e5b3
parent432275ce705b4e418b550eb99c45dd46ca1b3fd3 (diff)
downloadfiles.iamfabulous.de-833d72001d3df1680913759ff760708766618eb8.tar.gz
starting to write the interface
-rw-r--r--tmp/select.php (renamed from www/select.php)0
-rw-r--r--www/.functions.php.swpbin0 -> 20480 bytes
-rw-r--r--www/.index.php.swpbin12288 -> 12288 bytes
-rw-r--r--www/functions.php14
-rw-r--r--www/index.php7
-rw-r--r--www/interface_functions.php5
-rw-r--r--www/select_function.php23
7 files changed, 35 insertions, 14 deletions
diff --git a/www/select.php b/tmp/select.php
index ffa12d1..ffa12d1 100644
--- a/www/select.php
+++ b/tmp/select.php
diff --git a/www/.functions.php.swp b/www/.functions.php.swp
new file mode 100644
index 0000000..51599d7
--- /dev/null
+++ b/www/.functions.php.swp
Binary files differ
diff --git a/www/.index.php.swp b/www/.index.php.swp
index 7dc5069..ea0fadf 100644
--- a/www/.index.php.swp
+++ b/www/.index.php.swp
Binary files differ
diff --git a/www/functions.php b/www/functions.php
index c1cdca6..96f4010 100644
--- a/www/functions.php
+++ b/www/functions.php
@@ -2,7 +2,7 @@
/* --LOGIN-- */
-require_once("select_functions.php");
+require_once("select_function.php");
function login($db){
if($_SERVER['REQUEST_METHOD'] == 'POST') {
@@ -267,7 +267,7 @@ function get_404(){
*/
//}
-function show($db){
+function rewrite($db){
/* test if first argument a username or folder */
@@ -286,14 +286,10 @@ function show($db){
} else {
get_404();
}
- } else {
-
- /* everything was okay, so show the content, please */
-
- $content = select($db);
- return $content;
- //exit;
+ return false;
}
+
+ return true;
}
function failure($reason){
diff --git a/www/index.php b/www/index.php
index d1f86ee..77a29e6 100644
--- a/www/index.php
+++ b/www/index.php
@@ -3,6 +3,7 @@
session_start();
require_once("functions.php");
+require_once("interface_functions.php");
$db = new SQLite3("../database/sqlite.db");
@@ -49,7 +50,9 @@ if(empty($_GET)){
/* shows the user content, main function */
- $content = show($db);
- var_dump($content);
+ if(rewrite($db)){
+ $content = select($db);
+ show($content);
+ }
}
}
diff --git a/www/interface_functions.php b/www/interface_functions.php
new file mode 100644
index 0000000..0116fe6
--- /dev/null
+++ b/www/interface_functions.php
@@ -0,0 +1,5 @@
+<?
+
+function show($content){
+ var_dump($content);
+}
diff --git a/www/select_function.php b/www/select_function.php
index b83fe04..6e4bc66 100644
--- a/www/select_function.php
+++ b/www/select_function.php
@@ -1,3 +1,4 @@
+<?
function select($db){
if($_SESSION["login"]){
$share="";
@@ -47,9 +48,25 @@ function select($db){
}
}
- $content_db = $db->query("SELECT id, name, folder FROM files WHERE parent=" . $parentdir . " AND owner=" . $owner . ";");
- $content_ar = $conten_db->fetchArray(SQLITE3_NUM);
+// echo "parent: " . $parentdir . "<br>";
+ $content_db = $db->query("SELECT * FROM files WHERE parent=" . $parentdir . " AND owner=" . $owner . ";");
+// $content_ar = $content_db->fetchArray(SQLITE3_NUM);
- return $content_ar;
+ $count=0;
+ while($row = $content_db->fetchArray(SQLITE3_NUM)){
+ $content[$count][0] = $row[0];
+ $content[$count][1] = $row[1];
+ $content[$count][2] = $row[2];
+ $content[$count][3] = $row[3];
+ $content[$count][4] = $row[4];
+ $content[$count][5] = $row[5];
+ $content[$count][6] = $row[6];
+ $content[$count][7] = $row[7];
+ $content[$count][8] = $row[8];
+ //echo "<a href='/". $user . "/" . $content[$count][3] . "'>" . $content[$count][3] . "</a><br>";
+ $count++;
+ }
+
+ return $content;
}