<?php require_once 'protect.php'; ?>
<div class="content divreviewsmod wp1">
<div class="titles2 padbottom20"><?php echo $titlereviews ?></div>
<?php
$resultr1 = $mysqli->query("SELECT * FROM members WHERE item_id=0 AND publish='yes' ORDER BY RAND() LIMIT 3");
$rows = mysqli_num_rows($resultr1);
while($row = $resultr1->fetch_array()) {	
$rid=$row['id'];
$rname=$row['name'];
$rcity=$row['city'];
$rcountry=$row['country'];
$rcomments=$row['comments'];
$rtext = mb_substr(strip_tags($rcomments), 0, 230, 'UTF-8');
if (strlen($rcomments)>230) {
$rtext = substr($rtext, 0, strrpos($rtext, ' '));
}
$rate=$row['rate'];
$rimage=$row['image'];
$date=$row['date'];
?>
<div class="boxes3 text-left"><div class="boxreviews">
<?php if ($rimage==1) { list($width, $height) = getimagesize($imgsize."members/".$rid.".jpg"); ?>
<div class="floatleft">
<?php if ($width>500 OR $height>500) { ?>
<a id="thumb<?php echo $rid ?>i" href="<?php echo $filepath ?>members/<?php echo $rid ?>.jpg" onclick="return hs.expand(this)" title="<?php echo $rname ?>">
<img src="<?php echo $codepath ?>includes/image.php?image=<?php echo $imagepath ?>members/<?php echo $rid ?>.jpg&amp;nwidth=300" class="bordercolor2 img-mod" alt="<?php echo $rname ?>">
</a>
<?php }else{?>
<img src="<?php echo $codepath ?>includes/image.php?image=<?php echo $imagepath ?>members/<?php echo $rid ?>.jpg&amp;nwidth=300" class="bordercolor2 img-mod" alt="<?php echo $rname ?>">
<?php } ?>
</div>
<?php }else{?>
<?php if ($rate<8) { ?><div class="icon fa-comment colorn bordercolor2 img-mod"></div><?php }else{?><div class="color2 bgrcolor2 bordern img-mod"><?php echo $rate ?></div><?php } ?>
<?php } ?>
<div class="titles"><?php echo $rname ?></div> <?php echo $rcity?> <strong><?php echo $rcountry?></strong> <div class="floatright color2"><?php echo $date ?></div>
<div class="textreviews padtop10"><?php echo $rtext ?>... <a href="reviews">++</a></div>
</div></div>
<?php } ?><div class="cleared"></div>
</div>