0) AND ( visible >0) ORDER BY votes DESC, rate DESC, pid ASC LIMIT 0, 10";
$result = $db->sql_query($sql);
//echo $sql . "
" .mysql_error();
$messages = "";
$i = 1;
while ($pic = $db->sql_fetchrow($result)) {
$pic['description'] = substr($pic['description'],0,255);
if (strlen($pic['name']) > 15 ) {
$pic['name'] = substr($pic['name'],0,14).".";
}
$galloc = $pic['galloc'];
$img = $pic['img'];
$ext = substr($img, (strrpos($img,'.') + 1));
if (file_exists("$gallerypath/$galloc/thumb/$img")) {
$thumb = "";
} else {
$row = $db->sql_fetchrow($db->sql_query("SELECT thumbnail from $prefix"._gallery_media_types." where extension='$ext'"));
$thumb = "";
}
if ($pic['visible'] == 1) {
if (is_user($user)) {
$messages .= "
";
$content .= " |