Quote:
|
Το μέλος KIT_KAT στις 19-05-2006 στις 01:58 έγραψε:
do{
k=round(Ν*rand(1)); %N τα μέλη με φωτό
check=1;
for i=1:1:size(A)
if k==A(i)
check=0;
end
end
if check==1
display(picture(k));
A=[A k];
end
} while check==0
ή απλά
rearrange(πίνακα μελών)
for i=1:N
display(i)
end
|
|
Σ' έβαλα σε ταλαιπωρία βραδιάτικα και νιώθω τύψεις
Οπότε σε απαλλάσω και σου δίνω τον αλγόριθμο:
$curdayindex = date("z");
$result = sql_query("SELECT COUNT(*) FROM cpg_pictures", $dbi);
list($totals) = sql_fetch_row($result, $dbi);
if ($curdayindex >= $totals)
$rnd = $curdayindex % $totals;
else
$rnd = $curdayindex;
$result = $db->sql_query("SELECT pid, filepath, filename, p.aid, p.title, p.caption, p.pwidth, p.pheight FROM ".$cpg_prefix."pictures p WHERE approved='YES' AND aid=1 ORDER BY pid ASC LIMIT $rnd, 1");
$row = $db->sql_fetchrow($result);
if ($CONFIG['seo_alts'] == 0) {
$thumb_title = $row['filename'];
} else {
if ($row['title'] != '') {
$thumb_title = $row['title'];
} else {
$thumb_title = substr($row['filename'], 0, -4);
}
}
stripslashes($thumb_title);
$swidth = "";
if ( $row[pwidth] >= $row[pheight] ){
$swidth = "width=140";
}
else
$swidth ="height=120";
$filename = str_replace("%2F", "/", rawurlencode($row[filename]));
And I blame this world for making a good man evil
It’s this world that can drive a good man mad
And it’s this world that turns a killer into a hero
Well I blame this world for making a good man bad
[ Το μήνυμα τροποποιήθηκε από τον/την : jorge στις 19-05-2006 11:57 ]