Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP][Mysql] Wyświetlanie mniejszej ilości elementów na stronie.
Dziaka
post
Post #1





Grupa: Zarejestrowani
Postów: 2
Pomógł: 0
Dołączył: 24.10.2015

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


Witam.
Z góry powiem że na PHP ani MySQL nie znam się wcale dlatego zakładam temat. Chce zmienić w kodzie jedną prostą tak mi się wydaje rzecz. Ale nie mam pojęcia jak a szukanie po internecie nie pomogło. Już przedstawiam problem. Mam taki kod.


  1. <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?>
  2.  
  3. <div class="list">
  4. <div class="title">
  5. <a href="<?php echo site_url('latest/') ?>"><?php echo _('Latest released chapters')?>:</a>
  6. </div>
  7. <?php
  8. $current_comic = "";
  9. $current_comic_closer = "";
  10.  
  11.  
  12.  
  13. $opendiv = FALSE;
  14. // Let's loop over every chapter. The array is just $chapters because we used get_iterated(), else it would be $chapters->all
  15. foreach($chapters as $key => $chapter)
  16. {
  17. if ($current_comic != $chapter->comic_id)
  18. {
  19. if ($opendiv) {
  20. echo '</div>';
  21. }
  22. echo '<div class="group">';
  23. if($chapter->comic->get_thumb()) echo '<a href="'.$chapter->comic->href().'"><img class="preview" src="'.$chapter->comic->get_thumb().'" /></a>';
  24. echo '<div class="title">'.$chapter->comic->url().'</div>';
  25. $current_comic = $chapter->comic_id;
  26. }
  27.  
  28. echo '<div class="element">'.$chapter->download_url(NULL, 'fleft small').'
  29. <div class="title">'.$chapter->url().'</div>
  30. <div class="meta_r">' . _('by') . ' ' . $chapter->team_url() . ', ' . $chapter->date() . ' ' . $chapter->edit_url() . '</div>
  31. </div>';
  32. $opendiv = TRUE;
  33.  
  34. }
  35.  
  36. // Closing the last comic group
  37. echo '</div>';
  38.  
  39. echo prevnext('latest/', $chapters);
  40. ?>
  41. </div>


Chce aby mi wyświetlało tylko 3 elementy na stronie. Teraz wyświetla się 25. Czy jakaś dobra duszyczka nie pomoże szybko rozwiązać tego problemu?
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 23.08.2025 - 20:39