• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pagination

#31
[eluser]TheFuzzy0ne[/eluser]
Ah-ha! The problem is that count_all_results() is not ignoring the limit clause like I thought it would, so it will only find three results every time, which breaks the pagination on the second page, because the result number is more than the total number of results.

If you can post your model method, I can make those final modifications. Or you can make them yourself. Just ensure that this line:
Code:
$total_results = $this->db->count_all_results('articles');

appears before the limit and order_by statements. That should fix it. Big Grin

#32
[eluser]Fero[/eluser]
I love you! it works! Smile Finally, Wooohaaaa!

#33
[eluser]TheFuzzy0ne[/eluser]
I don't think it's working as expected. On the first page, there should be three results and a pagination section which should lead to the forth result. There should be four results as clanky contains 3 results, and recenzie contains 1 (I see you've removed the test entry).

http://www.fotoramik.sk/blog/kategoria/3 shows the final result, but there's no pagination... :/

#34
[eluser]TheFuzzy0ne[/eluser]
Also, your database query is ordering the results by date descending twice.
Code:
SELECT `id`, `odkaz`, `title`, `picture`, `text`, `date`
FROM (`articles`)
WHERE `kategoria` = 'clanky'
ORDER BY `date` desc, `date` desc #<-- Here
LIMIT 3

#35
[eluser]Fero[/eluser]
Fixed the desc date, plus added test article and it works fine with me, doesn't it?

#36
[eluser]TheFuzzy0ne[/eluser]
I mean on the initial page when no category is specified.
http://www.fotoramik.sk/blog/kategoria. There should be a pagination section at the bottom of the page and there isn't. Very strange...

#37
[eluser]Fero[/eluser]
That is on purpose as I implemented this:

Code:
If ($category):
         $data['links']       = $this->pagination->create_links();
   endif;

until I decide to put anchor of http://www.fotoramik.sk/blog/kategoria on the website. -> Which I should do, but haven't decided where to put it yet Smile

#38
[eluser]TheFuzzy0ne[/eluser]
Aaah, OK. As long as it's intentional. Smile

Glad you finally got it sorted. Sorry for any extra hassle I've caused, but hopefully you've learnt something today. I know I have! Thanks for being so patient, and good luck with your Web site. It looks awesome. If I was even half as talented as you with visual design, I'd be very, very happy.

#39
[eluser]masipung[/eluser]
Hei fero, can you post your code?

I'm also have problems with pagination.



*still learning english

#40
[eluser]srajibtechno[/eluser]
what is the solution lab assisstance? i am facing same problem....

please help me...as soon as possible....


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.