0) { while($info4 = mysqli_fetch_array($result_more)) { $filename=$info4['filename']; $detail=$info4['detail']; print "
$detail "; } } } ?>
';
while($info = mysqli_fetch_array($result))
{
$id=$info['id'];
$image_name=$info['image_name'];
$title=$info['title'];
$date_day=$info['date_day'];
$date_month=$info['date_month'];
$date_year=$info['date_year'];
$body=$info['body'];
$posted_by=$info['posted_by'];
$category=$info['category'];
$cat=$info['artist_id'];
$query_artist = "SELECT * FROM series WHERE id = '$cat'";
$result_artist = mysqli_query($conn,$query_artist) or die(mysqli_error($conn));
$data = mysqli_fetch_array($result_artist);
$name=$data['series_name'];
$date="$date_day-$date_month-$date_year";
$date = strtotime($date);
$date = date('d M Y', $date);
$body = str_replace("\n", '
', $body); $limit_body = substr($body, 0, 200)."..."; $limit_body = str_replace("\n", '
', $limit_body); print ''.$title.'
'; } print ''; } // how many rows we have in database $query = "SELECT COUNT(id) AS numrows FROM post WHERE category = '$type'"; $result = mysqli_query($conn,$query) or die(mysqli_error($conn)); $row = mysqli_fetch_array($result); $numrows = $row['numrows']; // how many pages we have when using paging? $maxPage = ceil($numrows/$rowsPerPage); // print the link to access each page $self = $_SERVER['PHP_SELF']; $nav = ''; for($page = 1; $page <= $maxPage; $page++) { if ($page == $pageNum) { $nav .= " $page "; // no need to create a link to current page } else { $nav .= " $page "; } } // creating previous and next link // plus the link to go straight to // the first and last page if ($pageNum > 1) { $page = $pageNum - 1; $prev = " [Prev] "; $first = " [First Page] "; } else { $prev = ' '; // we're on page one, don't print previous link $first = ' '; // nor the first page link } if ($pageNum < $maxPage) { $page = $pageNum + 1; $next = " [Next] "; $last = " [Last Page] "; } else { $next = ' '; // we're on the last page, don't print next link $last = ' '; // nor the last page link } // print the navigation link echo "
', $body); $limit_body = substr($body, 0, 200)."..."; $limit_body = str_replace("\n", '
', $limit_body); print '
'; } print ''; } // how many rows we have in database $query = "SELECT COUNT(id) AS numrows FROM post WHERE category = '$type'"; $result = mysqli_query($conn,$query) or die(mysqli_error($conn)); $row = mysqli_fetch_array($result); $numrows = $row['numrows']; // how many pages we have when using paging? $maxPage = ceil($numrows/$rowsPerPage); // print the link to access each page $self = $_SERVER['PHP_SELF']; $nav = ''; for($page = 1; $page <= $maxPage; $page++) { if ($page == $pageNum) { $nav .= " $page "; // no need to create a link to current page } else { $nav .= " $page "; } } // creating previous and next link // plus the link to go straight to // the first and last page if ($pageNum > 1) { $page = $pageNum - 1; $prev = " [Prev] "; $first = " [First Page] "; } else { $prev = ' '; // we're on page one, don't print previous link $first = ' '; // nor the first page link } if ($pageNum < $maxPage) { $page = $pageNum + 1; $next = " [Next] "; $last = " [Last Page] "; } else { $next = ' '; // we're on the last page, don't print next link $last = ' '; // nor the last page link } // print the navigation link echo "
".$first . $prev . $nav . $next . $last."
"; ?>