commit fa2aad7d6ffd22d6f03d09e5e3a0a5e013f5d454
parent b0e28318ff6fa341318a817334d087ed9301937a
Author: MTRNord <mtrnord1@gmail.com>
Date: Mon, 4 Aug 2014 11:15:02 +0200
auto commit
Diffstat:
8 files changed, 66 insertions(+), 168 deletions(-)
diff --git a/core/blog/posts.php b/core/blog/posts.php
@@ -1,9 +1,9 @@
<?php
include('../inc/db_connect.inc.php');
- $query = 'SELECT * FROM posts';
- $db_command = mysql_query($query);
+ #$query = 'SELECT * FROM posts';
+ #$db_command = mysqli_query($query);
- while($row = mysql_fetch_object($db_command)){
+ /*while($row = mysqli_fetch_object($db_command)){
echo '</br>';
echo '</br>';
echo '<h4>' . $row->title . '</h4>';
@@ -14,11 +14,37 @@
echo '<p><i>Erstellt um: ' . $row->time . '</p></i>';
}
- while($row = mysql_fetch_object($db_command)){
+ while($row = mysqli_fetch_object($db_command)){
echo '</br>';
echo '</br>';
echo '<p><i>Erstellt von: ' . $row->name . '</p></i>';
+ }*/
+
+
+
+ if ($resultat = $db->query('SELECT * FROM posts')) {
+ // Antwort der Datenbank in ein Objekt übergeben und
+ // mithilfe der while-Schleife durchlaufen
+ while($daten = $resultat->fetch_object() ){
+ echo '</br>';
+ echo '</br>';
+ echo '<h4>' . $daten->title . '</h4>';
+ echo '</br>';
+ echo '<p>' . $daten->text . '</p>';
+ echo '</br>';
+ echo '</br>';
+ echo '<p><i>Erstellt um: ' . $daten->time . '</p></i>';
+ }
+ // Speicher freigeben
+ $resultat->close();
+ } else {
+ // Sollten keine Datensätze enthalten sein, diese Meldung ausgeben
+ echo "Es konnten keine Daten aus der Datenbank ausgelesen werden";
}
+
+// Verbindung zum Datenbankserver beenden
+$db->close();
+
if($db_command == 0){
print ("FEHLER");
};
diff --git a/core/config/variables.config.php b/core/config/variables.config.php
@@ -0,0 +1,4 @@
+<?php
+$blog_name = 'Test';
+$name_contact = 'Kontakt';
+?>
diff --git a/core/inc/db_connect.inc.php b/core/inc/db_connect.inc.php
@@ -0,0 +1,9 @@
+<?php
+
+$db_servername = "localhost";
+$db_username = "root";
+$db_password = "1199Mtr3#";
+$db_name = "blog";
+
+@$db = new mysqli("$db_servername", "$db_username", "$db_password", "$db_name");
+
diff --git a/themes/accentbox/index.php b/themes/accentbox/index.php
@@ -1,4 +1,5 @@
<?php
+ $page = "Home";
include('templates/header.php');
include('templates/page_header.php');
?>
@@ -22,149 +23,11 @@
<div class="post-content image-caption-format-1">
<a href="#" rel="nofollow" id="featured-thumbnail">
- <div class="featured-thumbnail"><img src="images/2457315858_32ffd98aec_n-150x150.jpg" class="attachment-featured wp-post-image" height="150" width="150"><div> </a>
- <p>Nascetur, vel massa enim lundium nec in, phasellus vel nisi
- nec penatibus? Duis phasellus, ut! Amet risus ultricies integer!
- Elementum natoque! Nec, tincidunt risus adipiscing. Magna, augue
- dignissim in elementum diam ultricies. Enim, enim, sed augue nec? Montes
- habitasse ac, ridiculus, placerat cras sed! Dis nunc? Adipiscing, porta
- magna? Nunc non lundium? Vel, pulvinar aenean, </p>
- <p class="more"><a href="#">Read More…</a></p>
- </div>
- </div><!--.post excerpt-->
-
- <div class="post excerpt ">
- <header>
- <div class="bubble"><a href="#">0</a></div>
- <h2 class="title">
- <a href="#" rel="bookmark">Mauris Dictum Libero Id Justo Fusce In Est</a>
- </h2>
- <div class="post-info">
- <span class="theauthor"><a href="#" rel="author">MTS</a></span>
- <time>September 17, 2008</time>
- <span class="thecategory"><a href="#" rel="category tag">Awesomeness</a>, <a href="#" rel="category tag">featured</a></span>
- </div>
- </header><!--.header-->
- <div class="post-content image-caption-format-1">
- <a href="#" rel="nofollow" id="featured-thumbnail">
-
- <div class="featured-thumbnail"><img src="images/6585158069_29788f608e_n-150x150.jpg" class="attachment-featured wp-post-image" height="150" width="150"></div> </a>
- <p>Nulla sagittis convallis arcu. Sed sed nunc. Curabitur
- consequat. Quisque metus enim, venenatis fermentum, mollis in, porta et,
- nibh. Duis vulputate elit in elit. Mauris dictum libero id justo. Fusce
- in est. Sed nec diam. Pellentesque habitant morbi tristique senectus et
- netus et malesuada fames ac turpis egestas. Quisque semper nibh eget
- nibh. Sed tempor. </p>
- <p class="more"><a href="#">Read More…</a>
- </p>
- </div>
- </div><!--.post excerpt-->
-
- <div class="post excerpt last">
- <header>
- <div class="bubble"><a href="#">0</a></div>
- <h2 class="title">
- <a href="#" rel="bookmark">Cum Sociis Natoque Penatibus Magnis</a>
- </h2>
- <div class="post-info">
- <span class="theauthor"><a href="#" rel="author">MTS</a></span>
- <time>September 17, 2008</time>
- <span class="thecategory"><a href="#" rel="category tag">Child Category III</a>, <a href="#" rel="category tag">featured</a>, <a href="#" rel="category tag">Parent Category III</a></span>
- </div>
- </header><!--.header-->
- <div class="post-content image-caption-format-1">
- <a href="#" rel="nofollow" id="featured-thumbnail">
-
- <div class="featured-thumbnail"><img src="images/44066633_e0ab44de09_n-150x150.jpg" class="attachment-featured wp-post-image" height="150" width="150"></div> </a>
- <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed
- eleifend urna eu sapien. Quisque posuere nunc eu massa. Praesent
- bibendum lorem non leo. Morbi volutpat, urna eu fermentum rutrum, ligula
- lacus interdum mauris, ac pulvinar libero pede a enim. Etiam commodo
- malesuada ante. Donec nec ligula. Curabitur mollis semper diam. Duis
- viverra nibh a felis </p>
- <p class="more"><a href="#">Read More…</a>
- </p>
- </div>
- </div><!--.post excerpt-->
-
- <div class="post excerpt ">
- <header>
- <div class="bubble"><a href="#">2</a></div>
- <h2 class="title">
- <a href="#" rel="bookmark">Aliquet Pid Massa Porttitor Dictumst Ac Aenean A Dolor?</a>
- </h2>
- <div class="post-info">
- <span class="theauthor"><a href="#" rel="author">MTS</a></span>
- <time>September 11, 2008</time>
- <span class="thecategory"><a href="#" rel="category tag">Awesomeness</a>, <a href="#" rel="category tag">featured</a></span>
- </div>
- </header><!--.header-->
- <div class="post-content image-caption-format-1">
- <a href="#" rel="nofollow" id="featured-thumbnail">
-
- <div class="featured-thumbnail"><img src="images/2470289415_b98e0e1dae_n-150x150.jpg" class="attachment-featured wp-post-image" height="150" width="150"></div> </a>
- <p>Elit quis est sit integer rhoncus integer vel lorem mattis
- rhoncus natoque, cum. Sed, cras, sed? Dis tincidunt! Vel lacus
- elementum, in augue mus. Placerat, velit tristique et, magna tristique
- dolor magna, aliquam et elementum in elementum! Turpis placerat proin
- porta etiam augue adipiscing ridiculus. In, ridiculus nec aliquam nisi
- turpis rhoncus in tempor. A, </p>
- <p class="more"><a href="#">Read More…</a>
- </p>
- </div>
- </div><!--.post excerpt-->
-
- <div class="post excerpt ">
- <header>
- <div class="bubble"><a href="#">0</a></div>
- <h2 class="title">
- <a href="#" rel="bookmark">Quotes Time!</a>
- </h2>
- <div class="post-info">
- <span class="theauthor"><a href="#" rel="author">MTS</a></span>
- <time>September 11, 2008</time>
- <span class="thecategory"><a href="#" rel="category tag">Awesomeness</a></span>
- </div>
- </header><!--.header-->
- <div class="post-content image-caption-format-1">
- <a href="#" rel="nofollow" id="featured-thumbnail">
-
- <div class="featured-thumbnail"></div> </a>
- <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, convallis quis,
- pellentesque a, dolor. Curabitur vitae nisi non dolor vestibulum
- consequat. Proin vestibulum. Ut ligula. Nullam sed dolor id odio
- volutpat pulvinar. Integer a leo. In et eros </p>
- <p class="more"><a href="#">Read More…</a>
- </p>
- </div>
- </div><!--.post excerpt-->
-
- <div class="post excerpt last">
- <header>
- <div class="bubble"><a href="#">0</a></div>
- <h2 class="title">
- <a href="#" rel="bookmark">A Post With A Left-Aligned Image</a>
- </h2>
- <div class="post-info">
- <span class="theauthor"><a href="#" rel="author">MTS</a></span>
- <time>September 11, 2008</time>
- <span class="thecategory"><a href="#" rel="category tag">Parent Category II</a>, <a href="#" rel="category tag">Parent Category III</a></span>
- </div>
- </header><!--.header-->
- <div class="post-content image-caption-format-1">
- <a href="#" rel="nofollow" id="featured-thumbnail">
-
- <div class="featured-thumbnail"><img src="images/3478158612_4a09ab2d3c-150x150.jpg" class="attachment-featured wp-post-image" height="150" width="150"></div> </a>
- <p>Nulla sagittis convallis arcu. Sed sed nunc. Curabitur
- consequat. Quisque metus enim, venenatis fermentum, mollis in, porta et,
- nibh. Duis vulputate elit in elit. Mauris dictum libero id justo. Fusce
- in est. Sed nec diam. Pellentesque habitant morbi tristique senectus et
- netus et malesuada fames ac turpis egestas. Quisque semper nibh eget
- nibh. Sed tempor. </p>
- <p class="more"><a href="#">Read More…</a>
- </p>
+ <div class="featured-thumbnail"><img src="images/2457315858_32ffd98aec_n-150x150.jpg" class="attachment-featured wp-post-image" height="150" width="150"><div>
+ </a>
+ <?php
+ include('../../core/blog/posts.php');
+ ?>
</div>
</div><!--.post excerpt-->
diff --git a/themes/accentbox/templates/header.php b/themes/accentbox/templates/header.php
@@ -3,7 +3,7 @@
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<?php
- include('../../../core/config/variables.config.php');
+ include('../../core/config/variables.config.php');
echo "<title>$blog_name | $page</title>";
?>
diff --git a/themes/accentbox/templates/page_footer.php b/themes/accentbox/templates/page_footer.php
@@ -2,7 +2,10 @@
<div class="container">
<div class="footer-widgets">
<div class="f-widget">
- <div class="widget"><h3>Lorem ipsum</h3>
+ <div class='widget'>
+ <?php
+ echo "<h3>$name_themen</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>
</div>
@@ -10,15 +13,19 @@
</div>
<div class="f-widget">
<div class="widget">
- <h3>Consectetuer adipiscing</h3>
+ <?php
+ echo "<h3>$name_archiv</h3>";
+ ?>
<div class="textwidget">
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. <a href="#">Curabitur</a> quam augue, vehicula quis, tincidunt vel, varius vitae, nulla. Sed convallis orci. Duis libero orci, pretium a.</p>
</div>
</div>
</div>
<div class="f-widget last">
- <div class="widget">
- <h3>Recent Posts</h3>
+ <div class="widget">
+ <?php
+ echo "<h3>$name_meta</h3>";
+ ?>
<ul>
<li><a href="#">Porttitor Lectus Tincidunt Elementum Nascetur Montes</a></li>
<li><a href="#">Mauris Dictum Libero Id Justo Fusce In Est</a></li>
diff --git a/themes/accentbox/templates/page_header.php b/themes/accentbox/templates/page_header.php
@@ -23,25 +23,14 @@
<div class="container">
<div class="secondary-navigation">
<nav id="navigation">
- <ul class="menu"><li class="menu-item"><a href="#">Home</a></li>
- <li class="menu-item"><a href="#">About</a></li>
- <li class="menu-item"><a href="#">Contact Us</a></li>
- <li class="menu-item"><a href="#">Awesomeness</a></li>
- <li class="menu-item"><a href="#">featured</a></li>
- <li class="menu-item"><a href="#">Brochure</a></li>
- <li class="menu-item"><a href="#">Design</a></li>
- <li class="menu-item"><a href="#">Inspiration</a></li>
+ <ul class="menu">
+ <li class="menu-item"><a href="#">Home</a></li>
+ <?php echo "<li class='menu-item'><a href='#'>$name_contact</a></li>"; ?>
</ul>
<select>
<option value="" selected="selected">Go to...</option>
<option value="#">Home</option>
- <option value="#">About</option>
- <option value="#">Contact Us</option>
- <option value="#">Awesomeness</option>
- <option value="#">featured</option>
- <option value="#">Brochure</option>
- <option value="#">Design</option>
- <option value="#">Inspiration</option>
+ <?php echo "<option value='#'>$name_contact</option>"; ?>
</select>
</nav>
</div>
diff --git a/themes/accentbox/templates/page_navigation.php b/themes/accentbox/templates/page_navigation.php
@@ -5,7 +5,7 @@
<li class="widget widget-sidebar">
<form method="get" id="searchform" class="search-form" _lpchecked="1">
<fieldset>
- <input name="s" id="s" value="Search this Site..." type="text">
+ <input name="s" id="s" name="Suche etwas..." placeholder="Suche etwas..." title="Suche etwas..." x-moz-errormessage="Suche etwas..." type="text">
<input id="search-image" class="sbutton" src="images/search.png" style="border: 0px none; vertical-align: top;" type="image">
</fieldset>
</form>