Ací es mostren les diferències entre la revisió seleccionada i la versió actual de la pàgina.
forum 18/02/2010 00:02 | forum 15/06/2021 12:19 actual | ||
---|---|---|---|
Línia 9: | Línia 9: | ||
return $num; | return $num; | ||
} | } | ||
- | echo '<table width="500" border="0" align="center">'; | + | function get_seed() { |
+ | $f = "forum/seed.txt"; | ||
+ | $seed = file_get_contents($f); | ||
+ | ++$seed; | ||
+ | unlink($f); | ||
+ | $fp = fopen($f, 'w'); | ||
+ | fwrite($fp, $seed); | ||
+ | fclose($fp); | ||
+ | return $seed; | ||
+ | } | ||
+ | echo '<div align="center"><table width="90%" border="0" align="center">'; | ||
$not=get_num(); | $not=get_num(); | ||
- | $bool = array(); | ||
- | for ($i=0; $i<$not; ++$i) { | ||
- | $bool[$i]=true; | ||
- | } | ||
$bg[0]="#FF0000"; | $bg[0]="#FF0000"; | ||
$bg[1]="#000000"; | $bg[1]="#000000"; | ||
Línia 25: | Línia 31: | ||
$aut[2]="#000000"; | $aut[2]="#000000"; | ||
for ($i=0; $i<$not; ++$i) { | for ($i=0; $i<$not; ++$i) { | ||
- | $r = rand(0,$not-1); | + | srand(get_seed()); |
- | while (!$bool[$r]) $r = rand(0,$not-1); | + | $file = "forum/$i/not.txt"; |
- | $bool[$r]=false; | + | |
- | $file = "forum/$r/not.txt"; | + | |
$text = file_get_contents($file); | $text = file_get_contents($file); | ||
$dades = explode("$",$text); | $dades = explode("$",$text); | ||
- | echo '<tr><td bgcolor="'.$bg[$i%3].'"><a href="doku.php?id=post'.$r.'"><p style="color:'.$tit[$i%3].'">'.$dades[1].'</p><p align="right" style="color:'.$aut[$i%3].'>'.$dades[0].'</p></a></td></tr>'; | + | echo '<tr><td bgcolor="'.$bg[$i%3].'"><a href="doku.php?id=post'.$i.'"><p style="color:'.$tit[$i%3].';margin-left:10px; margin-top:10px;font-size:14px">'.$dades[1].'</p><p align="right" style="color:'.$aut[$i%3].'; margin-right:10px;font-size:14px">'.$dades[0].'</p></a></td></tr>'; |
} | } | ||
- | echo '<tr><td style="font-size:16px"><a href="doku.php?id=nou_genere">Envia el teu post</a></td></tr></table><br><br>'; | + | echo '<tr><td bgcolor="#FFFFFF" style="font-size:16px"><br><a href="doku.php?id=nou_genere">Envia el teu post</a></td></tr></table></div>'; |
</php> | </php> |