rpicms

A CMS for the Raspberry Pi
git clone git://archive.git.mtrnord.blog/RpicmsTeam/rpicms.git
Log | Files | Refs | README | LICENSE

commit 11c01e239487b1da67a98d759353d46feb11ec4e
parent 7b045e3b2e54e05ecc72a5f5daa9ecf00907261a
Author: MTRNord <mtrnord1@gmail.com>
Date:   Sun, 23 Nov 2014 17:22:55 +0100

-.-

Diffstat:
Mcore/backend/blog/posts.php | 59+++++++++++++++++++++++++++++------------------------------
Mthemes/jumbotron/index.php | 2+-
2 files changed, 30 insertions(+), 31 deletions(-)

diff --git a/core/backend/blog/posts.php b/core/backend/blog/posts.php @@ -20,41 +20,40 @@ } $resultat->close(); } - + next_id(); + function next_id(){ read(); - function read(){ - global $id, $connection, $read, $post_id_clean; - global $post_id, $post_title, $post_text, $post_author, $post_date, $post_categrory; - if ($resultat = $connection->query("SELECT * FROM posts WHERE id LIKE '$id'")) { - //echo 'SELECT * FROM posts WHERE id LIKE '.$id; - //Put database data in variables - while($daten = $resultat->fetch_object() ){ - var_dump ($daten); - $post_id = $daten->id; - $post_title = $daten->title; - $post_text = $daten->text; - $post_author = $daten->author; - $post_date = $daten->date; - $post_categrory = $daten->category; - } - $resultat->close(); - } else { + function read(){ global $id, $connection, $read, $post_id_clean; global $post_id, $post_title, $post_text, $post_author, $post_date, $post_categrory; - global $error; - $error = "1"; - echo "Nothing to read from Database!"; - $post_id = "Database error!"; - $post_title = "Database error!"; - $post_text = "Database error!"; - $post_author = "Database error!"; - $post_date = "Database error!"; - $post_categrory = "Database error!"; + if ($resultat = $connection->query("SELECT * FROM posts WHERE id LIKE '$id'")) { + //echo 'SELECT * FROM posts WHERE id LIKE '.$id; + //Put database data in variables + while($daten = $resultat->fetch_object() ){ + var_dump ($daten); + $post_id = $daten->id; + $post_title = $daten->title; + $post_text = $daten->text; + $post_author = $daten->author; + $post_date = $daten->date; + $post_categrory = $daten->category; + } + $resultat->close(); + } else { + global $id, $connection, $read, $post_id_clean; + global $post_id, $post_title, $post_text, $post_author, $post_date, $post_categrory; + global $error; + $error = "1"; + echo "Nothing to read from Database!"; + $post_id = "Database error!"; + $post_title = "Database error!"; + $post_text = "Database error!"; + $post_author = "Database error!"; + $post_date = "Database error!"; + $post_categrory = "Database error!"; + } } - #if ($id < $post_id_clean+1){ - # read(); - #} } diff --git a/themes/jumbotron/index.php b/themes/jumbotron/index.php @@ -89,7 +89,7 @@ echo "<a href='index.php?id=$id' rel='bookmark'> $post_title </a>"; $x = $x+1; $id = $id+1; - read(); + next_id(); } }else{ echo "<a href='index.php?id=$id' rel='bookmark'> $post_title </a>";