Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP]Jak najkrotszy kod do stronnicowania...
JamalBIG
post 7.07.2008, 15:15:31
Post #1





Grupa: Zarejestrowani
Postów: 496
Pomógł: 1
Dołączył: 16.01.2008
Skąd: Świnoujście

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


Witam

Stworzylem juz sobie strone na ktorej wyswietlane so wyniki ale zapomnialem o wrzuceniu stronnicowania... Przegladajac forum znalazlem troche tematow o stronnicowaniu ale wszystkie sa dosc mocno ingerujace w moj kod i probojac ciagle sie gubie...
Czy znacie moze kod albo link do jakiegos niezbyt skaplikowanego kodu stronnicowania? Najlepiej jezeli wystarczylo by go wrzucic nad kod gotowej juz strony...

Ponizej przedstawiam fragment kodu mojej strony:
  1. <?php
  2. if(empty($orderby)) {
  3. $orderby = "id DESC";
  4. }
  5.  
  6. echo "<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\">"
  7.  ."<tr>"
  8.  ."<td valign=\"top\">";
  9.  
  10. echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"
  11. . "<tr>"
  12. . "<td colspan=\"0\" width=\"510\" valign=\"top\">"
  13. . "<table border=\"0\" width=\"100%\" cellspacing=\"2\" cellpadding=\"0\" background=\"theme/images/logo_00.png\">";
  14. $result8 = $db->sql_query("SELECT id, name, save_as, numfiles, size, tracker_update, ratingsum, seeder
    s, leechers, times_completed FROM torrent_torrents ORDER BY $orderby $limit"
    );
  15. while ($row8 = $db->sql_fetchrow($result8)) {
  16. $id = $row8["id"];
  17. $name = $row8["name"];
  18. $name_long = $row8["save_as"];
  19. $name_long = str_replace("_", " ", $name_long);
  20. $name_long = str_replace("VA-", "<b>", $name_long);
  21. $name_long = str_replace("-", " - ", $name_long);
  22. $name_long = explode(" - ", $name_long);
  23. $name_long = $name_long[0]." - ".$name_long[1];
  24. $name_long = str_replace(" - ", "</b><br />", $name_long);
  25. $numfiles = $row8["numfiles"];
  26. $ratings = $row8["ratingsum"];
  27. # $update = date("d.m.Y <b> H:i </b>", strtotime($update));
  28. $seeders = $row8["seeders"];
  29. $leechers = $row8["leechers"];
  30. $pic_cover = "downloads/Mixtapes2/$id/$name.jpg";
  31. $times_completed = $row8["times_completed"];
  32. echo "<tr>"
  33. . "<td rowspan=\"2\" width=\"100\" align=\"center\"><a href=\"$pic_cover\" rel=\"lightbox\"><img border=\"0\" src=\"$pic_cover\" alt=\"$name\" width=\"90\" height=\"90\"/></a></td>"
  34. . "<td width=\"260\"><a href=\"modules.php?name=Bittorrent&file=details&id=$id\">$name_long</a></td>"
  35. . "<td rowspan=\"2\" width=\"90\" align=\"center\"><img border='0' src='images/star_tapes/star_$ratings.png' alt='Ocena: $ratings'></td>"
  36. . "<td rowspan=\"2\" width=\"60\" align=\"center\"><img src=\"images/active.png\"><br />";
  37. if ($seeders==&& $leechers<=5){
  38. echo "<img src='".$pic_base_url."red.png' border=\"0\" alt=\"$bt_difdownload\">";
  39.  }elseif( ($seeders==&& $leechers<=5) || ($seeders==&& $leechers<=10) ){
  40. echo "<img src='".$pic_base_url."yellow.png' border=\"0\" alt=\"$bt_probdownload\">";
  41.  }else{
  42. echo "<img src='".$pic_base_url."green.png' border=\"0\" alt=\"$bt_easydownload\">";
  43.  }
  44. echo "</td>"
  45.  ."</tr>"
  46.  ."<tr>"
  47.  ."<td valign=\"top\">Pobrano: <b>$times_completed</b> razy"
  48.  ."</td>"
  49.  ."</tr>"
  50.  ."<tr>"
  51.  ."<td colspan=\"0\"><hr width=\"95%\" noshade color=\"#FF9900\"></td>";
  52. }
  53. echo "</tr><tr><td colspan=\"9\">";
  54. echo "</td>"
  55. . "</tr>"
  56. . "</table>"
  57. ?>
Go to the top of the page
+Quote Post
Ziele
post 7.07.2008, 15:59:31
Post #2





Grupa: Zarejestrowani
Postów: 53
Pomógł: 2
Dołączył: 5.07.2008

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


http://www.forumweb.pl/viewtopic.php?t=19456 Zapoznaj się z tym.. Google nie gryzie


--------------------
Pomogłem? Miło będzie jeśli klikniesz przycisk "Pomógł"
Zapraszam do mojego Portfolio
Go to the top of the page
+Quote Post
kallosz
post 7.07.2008, 16:19:01
Post #3





Grupa: Zarejestrowani
Postów: 272
Pomógł: 19
Dołączył: 29.07.2006

Ostrzeżenie: (10%)
X----


ja polecam pager nospora smile.gif


--------------------
Pomogłem ?? Kliknij pomógł :) || kallosz.pl
-----------------------------------
Go to the top of the page
+Quote Post

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 Wersja Lo-Fi Aktualny czas: 12.06.2025 - 13:26