session_start();
ob_start();
include 'php/connect.php';
// get keyword from post
if ($_POST['keyword']) {
$postkeyword = $_POST['keyword'];
$postkeyword = preg_replace('/-/', ' ', $postkeyword);
header("location:$postkeyword-blogs");
}
if (isset($_GET['keyword'])) {
include 'php/class-inputfilter.php';
$myFilter = new InputFilter();
$_GET = $myFilter->process($_GET);
$keyword = $_GET['keyword'];
$keyword = preg_replace('/-/', ' ', $keyword);
}
?>
SEO Web Analyst®™ Blogger - Most Liked Blog Post
Most Liked Blogs
$lmt='0,12';
if(isset($_GET['page'])&&($_GET['page']==2)){ $lmt='12,20';
}
// getting the most liked blogs id
$resultcounter = mysqli_query($link, "select * from `entries` e LEFT JOIN `entry_likes` el on (e.id=el.id) WHERE e.published='1' ORDER BY el.likes DESC LIMIT ".$lmt);
while ($rowcounter = mysqli_fetch_array($resultcounter)) {
$thisblogid = $rowcounter['blogid'];
// set variable to count shown results
$shownresults = 0;
// begin while statement
while ($shownresults < 5) {
$resultsearch = mysqli_query($link, "select * from blogs WHERE id='$thisblogid' AND banned='0' AND active='1' AND title !='' ORDER BY id DESC LIMIT 0, 1");
while ($rowsearch = mysqli_fetch_array($resultsearch)) {
$thisblogname = $rowsearch['blogname'];
$thisauthorname = $rowsearch['authorname'];
$thistitle = $rowsearch['title'];
$thisauthorimage = $rowsearch['authorimage'];
$thisaboutauthor = $rowsearch['aboutauthor'];
// set empty image placeholder
if ($thisauthorimage == "") {
$thisauthorimage = "no-author-image.png";
}
} // close blog info while statement
// increase shownreults value by one
$shownresults++;
} // end while statement ($shownresults<12)
?>