I have this code to display top rated media on my website. It;s displaying 10 top rated medias but I want to change this code to display 2 medias in a row than next 2 in another row and so on, something like this:
1 2
3 4
5 6...
Instead of:
1
2
3...
I can't figure out how to do this so any help apreciated
1 2
3 4
5 6...
Instead of:
1
2
3...
I can't figure out how to do this so any help apreciated
Code:
<?php
$text = "";
$medias = get_medias("order=rating&sort=DESC&limitstart=0&limitnum="._sp($themecfg['topmenusnumber'])."&htmlize=true");
$num = count($medias);
$i = 0;
foreach ($medias as $media) {
++$i;
if ($i < 10) {
$text .= "";
} else {
$text .= "<b>".$i.".</b> ";
}
$link = get_media_link("id="._sp($media['id']));
$media['name'] = shrinktext($media['name'], 14);
$text .= "<a href='".$link."'><img src='[imgdir]".$media['nameid'].".png' width='60;' height='48;' style='border: 1px solid #000000;' /></a><br/>";
// - ".$media['rating']."
}
lcb("", 4, $text);
?>








