1 (edited by 2013-12-05 10:21:30)

Topic: CuteNews 2.0 Pagination Error

Hello,

Currently I have discovered a new error from the new 2.0 pagination.

I will show it to you guys what is the problem with the pagination as of now,

Note: Each page will only show 4 news.

Test 7
Test 6
Test 5
Test 4
[Page 1]

Test 4
Test 3
Test 2
Test 1
[Page 2]

From the above example, the problem is obvious. Upon entering to page 2, the article "Test 4" appear again. "Test 4" has already appeared at page 1 and therefore in page 2, only "Test 3", "Test 2", "Test 1" should appear. To further prove that there is a problem, I now change the number of news to show per page to 3.

Test 7
Test 6
Test 5
[Page 1]

Test 5
Test 4
Test 3
[Page 2]     

Test 3
Test 2
Test 1
[Page 3]       

Test 1
[Page 4]

From the above example, the same thing happened again.

Hope you see this Support_Team and a fix will come in so I can get my website to work with the new version of 2.0! :3

P.S: It is great to see that you guys have fixed the "Previous" URL for the pagination which plague the version 1.5.x. Thanks alot!

Re: CuteNews 2.0 Pagination Error

Based on my findings, it seems that this is caused by the equation from the pagination that you guys used in the "active_news.php".

Still hoping for an answer from you guys soon on the fix. https://cutephp.com/forum/style_emoticons/default/smile.gif

Thanks

3 (edited by 2013-12-06 03:07:42)

Re: CuteNews 2.0 Pagination Error

As if now, I have progressed through abit on fixing the problem. This are the things which I changed,

Line 109 (Original)

$_prev_num = $start_from - $number + 1;

Changed to,

$_prev_num = $start_from - $number;


Line 126 (Original)

elseif ($start_from && $start_from <= ($number - 1))

Changed to,

elseif ($start_from && $start_from <= ($number + 1))


Line 147 (Original)

$_next_num = $start_from + $number - 1;

Changed to,

$_next_num = $start_from + $number;


By changing the above lines, the articles now display properly at each page. However a new problem arise which is when you are at the last page of your article, you can still press "Next" to the next page. This next page do not have any news article and hence based on the PHP code, "No entries to show" is displayed. To give you an example,

Page 3
Article 3
Article 2
Article 1
[Prev][Next]

Page 4
No entries to show
[Prev][Next]

Note: Italic wording means it is a hyperlink.

From the above example, page 4 doesn't have any article at all yet at page 3, the [Next] button points it to page 4. Based on my findings, this is caused by this particular rule,

Line 145

if ($number && $_show_rows == $number)

Because of this rule, at page 3 when the number of articles is reached, the $_show_rows will have 3. Since the $number is 3, the [Next] button at page 3 will create page 4 due to this rule. However, this does not apply to page 4 because page 4 doesn't have a single article, hence the $_show_rows in page 4 is 0 (this case, the rule can't apply and create a "page 5").


Because of my limited understanding of PHP and everything else, I hope this helps you out Support_Team in fixing the pagination. If not, I can't progress my website having this error within the CMS itself.


Hope to get a reply from you guys, thanks.


P.S: PM if you need a live demo from my website. I don't wish to post my website URL here. Thanks. https://cutephp.com/forum/style_emoticons/default/smile.gif

Re: CuteNews 2.0 Pagination Error

Up for a reply. :]

Re: CuteNews 2.0 Pagination Error

Latest Update:

Thanks Support Team for fixing the problem. The pagination now works properly except for one more error in the pagination coding.

Since CuteNews 2.0, there is now a "Tagline" feature. If you click into the tagline URL and go to that specific tagline, the pagination is totally screw up. The code itself is unable to count the number of particular tagline there is to limit the number of pagination being create.

6 (edited by 2014-01-23 06:00:28)

Re: CuteNews 2.0 Pagination Error

Thanks for noticing the problem, we have fixed it (commit changes on GitHub https://github.com/CuteNews/cutenews-2.0/co...daede16e337897d ).

Best regards,
CN Support team

Re: CuteNews 2.0 Pagination Error

Thanks alot, it is working properly now. Appreciate it!