commit c138c9dd02be3a60fccd7d64925067e4ec5f4855 parent 297f9a80e98691959ec86eff2350573ea9f25570 Author: MTRNord <mtrnord1@gmail.com> Date: Sat, 13 Dec 2014 14:07:07 +0100 try to fix showing of wrong ids at categorys/authors Diffstat:
| M | core/backend/blog/posts.php | | | 3 | ++- |
| M | themes/jumbotron/index.php | | | 54 | +++++++++++++++++++++++++++++++++--------------------- |
2 files changed, 35 insertions(+), 22 deletions(-)
diff --git a/core/backend/blog/posts.php b/core/backend/blog/posts.php @@ -29,7 +29,8 @@ } if ($resultat = $connection->query("SELECT * FROM posts WHERE author LIKE '$author'")) { while($daten = $resultat->fetch_object() ){ - $author_id_clean = mysql_num_rows($resultat); + $author_id_clean = $daten->id; + #var_dump($daten); } } next_id_only(); diff --git a/themes/jumbotron/index.php b/themes/jumbotron/index.php @@ -208,33 +208,45 @@ } }else{ if ($author){ + $post_id_empty = empty($post_id); + $post_title_empty = empty($post_title); + $post_author_empty = empty($post_author); + $post_date_empty = empty($post_date); + $post_category_empty = empty($post_category); + $post_text_short_empty = empty($post_text_short); $id = 1; include('../../core/backend/blog/posts.php'); while ($x < $author_id_clean+1){ include('../../core/config/connect.db.inc.php'); - echo " - <h1> - <a href='index.php?id=$id' rel='bookmark'> $post_title </a> - </h1> - <div> - <h4> - <span class='theauthor'><a href='index.php?author=$post_author' rel='author'>$post_author</a></span> | - <time>$post_date</time> | - <span class='thecategory'><a href='index.php?category=$post_category' rel='category tag'>$post_category</a></span></br> - </h4> - </div> - <div> + if($post_id_empty or $post_title_empty or $post_author_empty or $post_date_empty or $post_category_empty or $post_text_short_empty){ + $x = $x+1; + $id = $id+1; + next_id_author(); + }else{ + echo " + <h1> + <a href='index.php?id=$id' rel='bookmark'> $post_title </a> + </h1> + <div> + <h4> + <span class='theauthor'><a href='index.php?author=$post_author' rel='author'>$post_author</a></span> | + <time>$post_date</time> | + <span class='thecategory'><a href='index.php?category=$post_category' rel='category tag'>$post_category</a></span></br> + </h4> + </div> + <div> + <p> + $post_text_short</br> + </p> + </div> <p> - $post_text_short</br> + <a class='btn btn-primary btn-lg' href='index.php?id=$id' role='button'>$name_more »</a> </p> - </div> - <p> - <a class='btn btn-primary btn-lg' href='index.php?id=$id' role='button'>$name_more »</a> - </p> - "; - $x = $x+1; - $id = $id+1; - next_id_author(); + "; + $x = $x+1; + $id = $id+1; + next_id_author(); + } } }else{ include('../../core/backend/blog/posts.php');