rpicms

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

commit 58c240d56a7ce73d1192d2c72e4539a00f170edf
parent 14d43b92887963a081531b3768974c513b4f2f5a
Author: Marcel Radzio <mtrnord1@gmail.com>
Date:   Wed,  8 Oct 2014 20:29:32 +0200

auto commit

Diffstat:
Mcore/admin/user/register_handling.php | 30+++++++++++++++---------------
Mcore/blog/posts.php | 7++++---
Acore/config/variables.config.php | 3+++
Mcore/inc/db_connect.inc.php | 15+++++++++++++++
Minstall/add_tables.php | 8++++----
Ainstall/install.php | 76++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mthemes/accentbox/css/style.css | 21++++++++++-----------
Mthemes/accentbox/index.php | 33+++++++++++++++++++++++++++++++--
Athemes/accentbox/lang/de-DE.php | 5+++++
Athemes/accentbox/lang/en-US.php | 5+++++
Mthemes/accentbox/templates/header.php | 2+-
Mthemes/accentbox/templates/page_footer.php | 2+-
Mthemes/accentbox/templates/page_navigation.php | 6+++---
Athemes/parkzone/images/.DS_Store | 0
Athemes/parkzone/images/slides/.DS_Store | 0
Athemes/parkzone/images/slides/thumbs/.DS_Store | 0
Aupload.sh | 6++++++
17 files changed, 179 insertions(+), 40 deletions(-)

diff --git a/core/admin/user/register_handling.php b/core/admin/user/register_handling.php @@ -8,43 +8,43 @@ * @version 0.2 17/08/2014 19:48 */ - include('../core/inc/db_connect.inc.php'); + include('../../inc/db_connect.inc.php'); //Set variables //$DatabaseHost = "localhost"; //$DatabaseUser = "root"; //$DatabasePassword = "1199Mtr3#"; //$Database = "blog"; - //$TableAktivierung = "users"; - //$Absender = "info@nordgedanken.de"; + $TableAktivierung = "users"; + $Absender = "info@nordgedanken.de"; //Check if the form is sended if($_POST['Send']){ //Open Database connection - // $DatabasePointer = mysql_connect($DatabaseHost, $DatabaseUser, $DatabasePassword); - // mysql_select_db($Database, $DatabasePointer); - $_POST['EMail'] = mysqli_real_escape_string($_POST['EMail']); - $_POST['Name'] = mysqli_real_escape_string($_POST['Name']); - $_POST['pw'] = mysqli_real_escape_string($_POST['pw']); - + //$DatabasePointer = mysql_connect($DatabaseHost, $DatabaseUser, $DatabasePassword); + //mysqli_select_db($Database, $DatabasePointer); + $_POST['EMail'] = mysqli_real_escape_string($connection, $_POST['EMail']); + $_POST['Name'] = mysqli_real_escape_string($connection, $_POST['Name']); + $_POST['pw'] = mysqli_real_escape_string($connection, $_POST['pw']); + //Encrypt the password include '../../secure/aes.php'; - $inputKey = '1554831687984849746489478'; - $inputText = $_REQUEST['pw']; + $Key = '1554831687984849746489478'; + $clean = $_REQUEST['pw']; $blockSize = 256; - $aes = new AES($inputText, $inputKey, $blockSize); + $aes = new AES($clean, $Key, $blockSize); $enc = $aes->encrypt(); $aes->setData($enc); //echo "After encryption: ".$enc."<br/>"; - + //Set first login Date and generate random Activatecode $Erstellt = date("Y-m-d H:i:s"); $Aktivierungscode = rand(1, 9999); //Push it to the Database - mysqli_query("INSERT INTO $TableAktivierung (Aktivierungscode, Erstellt, EMail, Aktiviert, name, password) VALUES ('$Aktivierungscode', '$Erstellt', '".$_REQUEST['EMail']."', '0', '".$_REQUEST['Name']."', '$enc')", $DatabasePointer); + mysqli_query($connection, "INSERT INTO $TableAktivierung (activationcode, registertime, email, activated, name, password) VALUES ('$Aktivierungscode', '$Erstellt', '".$_REQUEST['EMail']."', '0', '".$_REQUEST['Name']."', '$enc')"); //Send Email for Registration - $ID = mysqli_insert_id(); + $ID = mysqli_insert_id($connection); mail($_POST['EMail'], "Registrierung abschlie&szlig;en", "Hallo,\n\num die Registrierung abzuschließen, klicken Sie bitte auf den folgenden Link:\n\nhttp://192.168.178.40/cms_new/core/admin/register_activation.php?ID=$ID&Aktivierungscode=$Aktivierungscode", "FROM: $Absender"); echo"Um die Registrierung abzuschlie&szlig;en, rufen Sie Ihr E-Mail-Postfach ab und klicken Sie auf den Aktivierungslink in der soeben an Sie versandten E-Mail."; } diff --git a/core/blog/posts.php b/core/blog/posts.php @@ -7,6 +7,7 @@ * @author Marcel Radzio <info@nordgedanken.de> * @version 0.2 17/08/2014 19:39 */ + include('../../core/inc/db_connect.inc.php'); //Check if Database connection established if (mysqli_connect_errno()) { printf("Verbindung fehlgeschlagen: %s\n", mysqli_connect_error()); @@ -14,13 +15,13 @@ } //Check if Data in it - if ($resultat = $db_connection->query('SELECT * FROM posts')) { + if ($resultat = $connection->query('SELECT * FROM posts')) { //Put database data in variables while($daten = $resultat->fetch_object() ){ $post_title = $daten->title; $post_text = $daten->text; $post_author = $daten->name; - $post_date = $daten->time; + $post_date = $daten->date; $post_categrory = $daten->category; } $resultat->close(); @@ -30,5 +31,5 @@ } // Close database connection -$db_connection->close(); +$connection->close(); diff --git a/core/config/variables.config.php b/core/config/variables.config.php @@ -0,0 +1,3 @@ +<?php +$blog_name = 'CMS TEST'; + diff --git a/core/inc/db_connect.inc.php b/core/inc/db_connect.inc.php @@ -0,0 +1,14 @@ +<?php + +$db_servername = 'localhost'; + + +$db_username = 'root'; + + +$db_password = '1199Mtr3#'; + + +$db_name = 'test_cms'; + +$connection = mysqli_connect($db_servername, $db_username, $db_password, $db_name) or die ("Verbindung war nicht m&ouml;glich"); +\ No newline at end of file diff --git a/install/add_tables.php b/install/add_tables.php @@ -16,11 +16,11 @@ `title` TEXT NOT NULL , `author` TEXT NOT NULL , `date` DATETIME NOT NULL , - `categrory` TEXT NOT NULL + `category` TEXT NOT NULL ) ENGINE = MYISAM ; "; $result = mysqli_query($connection, $sql) - or die("Anfrage fehlgeschlagen: " . mysql_error()); + or die("Anfrage fehlgeschlagen: " . mysqli_error()); echo 'Erstellen erfolgreich'; //User erstellen require_once ('../core/inc/db_connect.inc.php'); @@ -32,10 +32,10 @@ `password` VARCHAR(50) NOT NULL , `registertime` TEXT NOT NULL , `activationcode` INT( 11 ) NOT NULL, - `acivated` TEXT NOT NULL + `activated` TEXT NOT NULL ) ENGINE = MYISAM ; "; $result = mysqli_query($connection, $sql) - or die("Anfrage fehlgeschlagen: " . mysql_error()); + or die("Anfrage fehlgeschlagen: " . mysqli_error()); echo 'Erstellen erfolgreich'; ?> diff --git a/install/install.php b/install/install.php @@ -0,0 +1,76 @@ +/** +* Module Check +* +* This script checks for requiered modules. +* +* @author Marcel Radzio <info@nordgedanken.de> +* @version 0.2 18/08/2014 18:45 +*/ +<!Doctype html> +<html> +<head> +<title>Installieren</title> +</head> +<body> +<?php + if (!extension_loaded('mysql')) { + if (!dl('mysql.so')) { + print ("MySQL is not installed! Please install this module!"); + exit; + }else{print("MySQL has been successfully loaded");} + } +?> +<h1>Installer</h1> +<h3>MySQL</h3> +<!-- Reset Configs --> +<?php +################# +#Database Config# +################# +unlink('../core/inc/db_connect.inc.php'); +################# +#Blog Basics Config# +################# +unlink('../core/config/variables.config.php'); +?> +<!-- Form to give data to config-generator --> +<form action="generate_configs.php" method="post"> + <table cellpadding="1" cellspacing="4"> + <tr> + <td><p>Datenbank Adresse: </p></td> + <td><input type="name" name="serverpfad" required="required" placeholder="Datenbank Adresse" maxlength="255" /></td> + </tr> + <tr> + <td><p>Nutzername: </p></td> + <td><input type="name" name="username" required="required" placeholder="Nutzername" maxlength="255" /></td> + </tr> + <tr> + <td><p>Passwort: </p></td> + <td><input type="password" name="password" required="required" placeholder="Passwort" maxlength="50" /></td> + </tr> + <tr> + <td><p>Datenbank Name: </p></td> + <td><input type="name" name="db_name" required="required" placeholder="Datenbank Name" maxlength="255" /></td> + </tr> + </table> +<h3>Basics</h3> + <table cellpadding="1" cellspacing="4"> + <tr> + <td><p>Website Name: </p></td> + <td style="text-indent:40px;"><input type="name" name="blog_name" required="required" placeholder="Website Name" maxlength="255" /></td> + </tr> + <tr> + <td><p>Untertitel: </p></td> + <td style="text-indent:40px;"><input type="text" name="admin_username" required="required" placeholder="Untertitel" maxlength="255" /></td> + </tr> + <tr> + <td><p>Schlagw&ouml;rter: </p></td> + <td style="text-indent:40px;"><input type="text" name="admin_password" required="required" placeholder="Schlagw&ouml;rter" maxlength="50" /></td> + </tr> + <tr> + <td colspan="2"><input type="submit" name="send" value="Weiter" /></td> + </tr> + </table> +</form> +</body> +</html> diff --git a/themes/accentbox/css/style.css b/themes/accentbox/css/style.css @@ -126,11 +126,11 @@ margin:10px 0 @font-face { font-family: 'BebasNeueRegular'; - src: url('fonts/BebasNeue-webfont.eot'); - src: url('fonts/BebasNeue-webfont.eot?#iefix') format('embedded-opentype'), - url('fonts/BebasNeue-webfont.woff') format('woff'), - url('fonts/BebasNeue-webfont.ttf') format('truetype'), - url('fonts/BebasNeue-webfont.svg#BebasNeueRegular') format('svg'); + src: url('../fonts/BebasNeue-webfont.eot'); + src: url('../fonts/BebasNeue-webfont.eot?#iefix') format('embedded-opentype'), + url('../fonts/BebasNeue-webfont.woff') format('woff'), + url('../fonts/BebasNeue-webfont.ttf') format('truetype'), + url('../fonts/BebasNeue-webfont.svg#BebasNeueRegular') format('svg'); font-weight: normal; font-style: normal; } @@ -238,7 +238,7 @@ position: relative; float: left; width: 100%; z-index: 99; -background-image: url(images/hbg.gif); +background-image: url(../images/hbg.gif); border-bottom: 7px solid #5E5E5E; } #header{ @@ -674,7 +674,7 @@ display: block; overflow: hidden; list-style-type: none; padding-left: 20px; -background: url(images/arrow.png) 0 5px no-repeat; +background: url(../images/arrow.png) 0 5px no-repeat; } .widget h3 { font-size: 20px; @@ -698,7 +698,7 @@ min-height:50px; overflow:hidden; margin-top: 0px; width: 100%; -background: url(images/hbg.gif); border-bottom: 7px solid #5E5E5E; border-top: 7px solid #5E5E5E; +background: url(../images/hbg.gif); border-bottom: 7px solid #5E5E5E; border-top: 7px solid #5E5E5E; padding-top: 25px; } body > footer .widget{ @@ -834,7 +834,7 @@ font-weight: bold; } .postauthor { padding: 1.5em 1.6em 0.5em; - margin: 1.5em 0 1em 0; background-image: url(images/hbg.gif); border: 1px solid #D4CFC1; min-height: 100px; + margin: 1.5em 0 1em 0; background-image: url(../images/hbg.gif); border: 1px solid #D4CFC1; min-height: 100px; } .postauthor h4 { color: #666; @@ -1246,4 +1246,4 @@ width: 18%; .commentlist p { margin-left: 22.5%; } -} -\ No newline at end of file +} diff --git a/themes/accentbox/index.php b/themes/accentbox/index.php @@ -1,4 +1,34 @@ <?php + function getBrowserLangs() { + $langs[0] = $langs[1] = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); + $langs[0] = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']); + + foreach($langs[0] as $l) { + $q = explode(';', $l); + $lang = substr($q[0], 0, 2); + $q = (isset($q[1])) ? (float)substr($q[1], 2) : 1; + $result[$lang] = $q; + } + if(isset($result) && is_array($result)) { + arsort($result, SORT_NUMERIC); + return $result; + } + return $result[$langs[1]] = 1; + } + + + $langs = getBrowserLangs(); + foreach($langs as $prio => $lang) { + if($lang = 'de') { + include('lang/de-DE.php'); + break; + } elseif($lang = 'en') { + include('lang/en-US.php'); + break; + } + // AND SO ON ................. + } + $page = "Home"; include('templates/header.php'); include('templates/page_header.php'); @@ -10,8 +40,7 @@ <div class="post excerpt "> <?php - include('../core/inc/db_connect.inc.php'); - include('../core/blog/posts.php'); + require('../../core/blog/posts.php'); ?> <header> <div class="bubble"><a href="#">4</a></div> diff --git a/themes/accentbox/lang/de-DE.php b/themes/accentbox/lang/de-DE.php @@ -0,0 +1,5 @@ +<?php +$name_themes = "Themen"; +$name_archiv = "Archiv"; +$name_meta = "Meta"; +$name_contact = "Kontakt"; diff --git a/themes/accentbox/lang/en-US.php b/themes/accentbox/lang/en-US.php @@ -0,0 +1,5 @@ +<?php +$name_themes = "Themes"; +$name_archiv = "Archiv"; +$name_meta = "Meta"; +$name_contact = "Contact"; diff --git a/themes/accentbox/templates/header.php b/themes/accentbox/templates/header.php @@ -18,7 +18,7 @@ <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> - <script src="js/modernizr.js"></script> + <script src="js/modernizr.min.js"></script> <script src="js/customscript.js" type="text/javascript"></script> <style type="text/css"> diff --git a/themes/accentbox/templates/page_footer.php b/themes/accentbox/templates/page_footer.php @@ -4,7 +4,7 @@ <div class="f-widget"> <div class='widget'> <?php - echo "<h3>$name_themen</h3>"; + echo "<h3>$name_themes</h3>"; ?> <div class="textwidget"> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Curabitur quam augue, vehicula quis, tincidunt vel, varius vitae, nulla. Sed convallis orci. Duis libero orci, pretium a.</p> diff --git a/themes/accentbox/templates/page_navigation.php b/themes/accentbox/templates/page_navigation.php @@ -11,17 +11,17 @@ </form> </li> - <li class="widget widget-sidebar"> + <!--<li class="widget widget-sidebar"> <div class="ad-300"> <a href="#"><img src="images/stylishuserinterface300x250.jpg" height="250" width="300"></a> </div> - </li> + </li>--> <li class="widget widget-sidebar"> <h3>Our Sponsors</h3> <div class="ad-125"> <ul> <li class="oddad"> - <a href="#"><img src="images/125x125.gif" height="125" width="125"></a> + <a href="http://nordgedanken.de"><img src="http://nordgedanken.oktarp.de/files/2013/07/nordgedankenlogo.png" height="125" width="125"></a> </li> <li class="evenad"> <a href="#"><img src="images/125x125.gif" height="125" width="125"></a> diff --git a/themes/parkzone/images/.DS_Store b/themes/parkzone/images/.DS_Store Binary files differ. diff --git a/themes/parkzone/images/slides/.DS_Store b/themes/parkzone/images/slides/.DS_Store Binary files differ. diff --git a/themes/parkzone/images/slides/thumbs/.DS_Store b/themes/parkzone/images/slides/thumbs/.DS_Store Binary files differ. diff --git a/upload.sh b/upload.sh @@ -0,0 +1,6 @@ +#!/bin/bash +git add . +git commit -m "auto commit" +git remote add origin git@github.com:MTRNord/RPICMS.git +git push -u origin develop +sleep 30