BlogPage no posts fix
This commit is contained in:
parent
5143fab182
commit
fb7905200b
@ -101,13 +101,6 @@ if ($sql = $mysqli->prepare("SELECT * FROM user WHERE user_id =$user_id "))
|
|||||||
|
|
||||||
<!-- /aboutwrap -->
|
<!-- /aboutwrap -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<section id="post" name="post"></section>
|
|
||||||
<div id="postwrap">
|
|
||||||
<div class="container">
|
|
||||||
<div class="row">
|
|
||||||
<h2>NAJNOWSZE WPISY</h2>
|
|
||||||
<?php }
|
<?php }
|
||||||
$sql->close();
|
$sql->close();
|
||||||
}
|
}
|
||||||
@ -118,8 +111,25 @@ else die( "Błąd w zapytaniu SQL! Sprawdź kod SQL w PhpMyAdmin." );
|
|||||||
$trash = '';
|
$trash = '';
|
||||||
if ($sql = $mysqli->prepare("SELECT * FROM post WHERE blog_id=$user_id ORDER BY data_dodania"))
|
if ($sql = $mysqli->prepare("SELECT * FROM post WHERE blog_id=$user_id ORDER BY data_dodania"))
|
||||||
{
|
{
|
||||||
$sql->execute();
|
$checkIfHasPost = $mysqli->query("SELECT * FROM post WHERE blog_id=$user_id");
|
||||||
|
if ($checkIfHasPost) {
|
||||||
|
if($checkIfHasPost->num_rows === 0)
|
||||||
|
{?>
|
||||||
|
<section id="post" name="post"></section>
|
||||||
|
<div id="postwrap">
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<h2>Brak Postów</h2>
|
||||||
|
<?php }
|
||||||
|
else{?>
|
||||||
|
<section id="post" name="post"></section>
|
||||||
|
<div id="postwrap">
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<h2>Najnowsze Wpisy</h2>
|
||||||
|
<?php $sql->execute();
|
||||||
$sql->bind_result($post_id,$trash,$title,$description,$main,$image,$date,$mod_date);
|
$sql->bind_result($post_id,$trash,$title,$description,$main,$image,$date,$mod_date);
|
||||||
|
|
||||||
while ($sql->fetch())
|
while ($sql->fetch())
|
||||||
{ ?>
|
{ ?>
|
||||||
<div class="col-lg-4 col-md-6 col-sm-6 col-xs-12 desc">
|
<div class="col-lg-4 col-md-6 col-sm-6 col-xs-12 desc">
|
||||||
@ -138,7 +148,9 @@ if ($sql = $mysqli->prepare("SELECT * FROM post WHERE blog_id=$user_id ORDER BY
|
|||||||
</div> <h1> <?php echo $title; ?></h1></a>
|
</div> <h1> <?php echo $title; ?></h1></a>
|
||||||
</div>
|
</div>
|
||||||
<?php }
|
<?php }
|
||||||
|
}
|
||||||
$sql->close();
|
$sql->close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else die( "Błąd w zapytaniu SQL! Sprawdź kod SQL w PhpMyAdmin." );
|
else die( "Błąd w zapytaniu SQL! Sprawdź kod SQL w PhpMyAdmin." );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user