Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> ograniczenie ilości wyświetlania
speedow
post
Post #1





Grupa: Zarejestrowani
Postów: 2
Pomógł: 0
Dołączył: 21.06.2006
Skąd: z nienacka

Ostrzeżenie: (0%)
-----


Jak zrobić ograniczenie wyświetlania. Tzn. nie mam za dużo miejsca na stronie wiec chce aby wyświetlał się tylko jeden shout w shoutboxie. Jak to zrobic ? Oto kod:
  1. <?php
  2. //Display shouts
  3. echo ("<table width=100% cellpadding=0 cellspacing=0>");
  4. $shouts = file("shouts.php");
  5. $shouts = array_reverse($shouts);
  6. $shouts = array_slice($shouts,0,10);
  7. foreach ($shouts as $item){
  8. $row_color = ($row_count % 2) ? $row_color1 : $row_color2;
  9. list ($poster,$message,$date,$time,$ip) = explode ("|^|", $item);
  10. $thisnamecolor = $namecolor;
  11. $thisnamecolor = colornames($poster,$thisnamecolor);
  12. $thisshout = "$poster:$message";
  13. $wrap = intval(($width+15)/($textsize-2))+1;
  14. $thisshout = wordwrap($thisshout, $wrap, ' ', 1);
  15. $newmessage=profanityfilter(shoutcode(smilies(killhtml($message))));
  16. $thisshout = str_replace($message,$newmessage,$thisshout);
  17. $thisshout = "<div title="Posted $date @ $time">".$thisshout."</div>n";
  18. $thisshout = str_replace($poster.":","<font color=".$thisnamecolor.">$poster:</font> ",$thisshout);
  19. if($row_coloring==on){
  20. $thisshout = "<tr bgcolor='$row_color'><td>".$thisshout."</td></tr>";
  21. } else {
  22. $thisshout = "<tr><td>".$thisshout."</td></tr>";
  23. }
  24. echo ($thisshout);
  25. $row_count++;
  26. }
  27. echo ("</table><br>")
  28. ?>


uzywaj odpowiedniego bbcode, dr_bonzo
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 20.08.2025 - 12:35