$limitas = "5"; //Nuotrauku paneleje
$nuotraukos = 1; // 1/0 rodyti/nerodyti nuotraukas paneleje
openside("?iūrimiausios nuotraukos");
$result = dbquery("SELECT photo_id, photo_title".($nuotraukos == 1 ? ", photo_filename, photo_thumb2, album_id" : "")." FROM ".$db_prefix."photos ORDER BY photo_views DESC LIMIT $limitas");
if (dbrows($result)) {
$safe = @ini_get("safe_mode") ? true : false;
while ($data = dbarray($result)) {
if ($nuotraukos == 1) {
$dir = PHOTOS.(!$safe ? "album_".$data['album_id']."/" : "");
$linkas = $data['photo_thumb2'] ? $dir.$data['photo_thumb2'] : $data['photo_filename'];
echo "
\n";
} else {
echo THEME_BULLET." ".trimlink($data['photo_title'], 30)."
\n";
}
}
} else {
echo "Nuotraukų nėra";
}
closeside();