Topic: News pagination doesn't work

I've been having a problem with the news pagination on the site I'm creating...
Here it is: site
I've set for 5 news a page. The problem is that if I go to the second page and I try to go on or go back to the first page, it always links at

http://www.dayjobstudio.net/index-en.php?start_from=5


And if I go to the third page and I want to change, it always links at

http://www.dayjobstudio.net/index-en.php?start_from=10


Could you please help me?

Re: News pagination doesn't work

/index-en.php - wrong. make http://www.dayjobstudio.net/ your main address.

I've been having a problem with the news pagination on the site I'm creating...
Here it is: site
I've set for 5 news a page. The problem is that if I go to the second page and I try to go on or go back to the first page, it always links at

And if I go to the third page and I want to change, it always links at

Could you please help me?


Re: News pagination doesn't work

Thank you for your answer, but does it mean that I can't put the news in a page which is different from the main one?

Re: News pagination doesn't work

We advise you using $PHP_SELF before  include "show_news.php.

Best regards,
CN Support team

Re: News pagination doesn't work

We advise you using $PHP_SELF before  include "show_news.php.

Hi,
what does it mean ? I want to integrate pagination to the same page (for exemple test.php). Here is my code in test.php :

        <?php
        $number = "5";
        $template = "mytemp";
include("news/show_news.php");
?>

With CuteNews v153, it does work only for the first page. For the second and other pages, the previous/next link don't work. How should I do to solve it ?

Thanks for your help !

Re: News pagination doesn't work

Please specify, when clicking << prev или next >> links and other links conversion to index.php (not to test.php) appears, right? Or there are no navigation buttons at all?
For instance in your case
<?php
$number = "5";
$template = "mytemp";
$PHP_SELF = "test.php";
include("news/show_news.php");
?>

Best regards,
CN Support team

7 (edited by 2013-03-13 13:05:13)

Re: News pagination doesn't work

Please specify, when clicking << prev или next >> links and other links conversion to index.php (not to test.php) appears, right? Or there are no navigation buttons at all?
For instance in your case
<?php
$number = "5";
$template = "mytemp";
$PHP_SELF = "test.php";
include("news/show_news.php");
?>

Thanks for your reply.

In my case, there are always the << prev или next >> navigation buttons pointing to the test.php. But they don't point to the right start_from pages. For example, when in the second page (test.php?start_from=5), the "prev" link should point to the test.php?start_from=0 and the "next" link should point to the test.php?start_from=10. But it's not the case, all links (including the number links) point to the test.php?start_from=5, so i can never go to the prev/next pages using the navigation buttons. I tried your code, it's the same result.

Re: News pagination doesn't work

I'm sorry, I can't understand.
I've tried to write:

<?php
$number = "5";
$template = "boh";
$PHP_SELF = "index-en.php";
include("public/cutenews/show_news.php");
?>

but it still gives the same problem!
If I go to the second page (or the third, ecc.) the pagination doesn't work and it keeps on linking me at the same page, so I can't see any other news.
Could you please be more precise about what I should do to solve the problem?
Thank you!

Re: News pagination doesn't work

I'm sorry, I can't understand.
I've tried to write:

<?php
$number = "5";
$template = "boh";
$PHP_SELF = "index-en.php";
include("public/cutenews/show_news.php");
?>

but it still gives the same problem!
If I go to the second page (or the third, ecc.) the pagination doesn't work and it keeps on linking me at the same page, so I can't see any other news.
Could you please be more precise about what I should do to solve the problem?
Thank you!

Me either, hope it will be solved in the next release ...

10 (edited by 2013-03-25 12:05:40)

Re: News pagination doesn't work

Dear User!

Please insert:

print_r($left);
print_r($right);

to

core/core.php

into the function

build_uri

after

$ex = spsep($left);
$uq = spsep($adds);

The result:

$ex = spsep($left);
$uq = spsep($adds);
print_r($left);
print_r($right);

Please then make a screenshot of the web page: http://www.dayjobstudio.net/index-en.php?start_from=5 and send it to us.
Alternatively, you can leave this change in your code, so that we would be able to view it on your web site.

Best regards,
CN Support team

Re: News pagination doesn't work

I've done what you told me, here's the result:
screenshot
At the moment the code is still online so you can check it yourselves if you need to https://cutephp.com/forum/style_emoticons/default/smile.gif

Re: News pagination doesn't work

I've done what you told me, here's the result:
screenshot
At the moment the code is still online so you can check it yourselves if you need to https://cutephp.com/forum/style_emoticons/default/smile.gif

Dear User!

"in core/core.php, line 1184 (v1.5.3 cn) please try changing

     

if ($k && $v) $URI[$k] = $v;

to

     

if ($k && $v && !isset($URI[$k])) $URI[$k] = $v;
Best regards,
CN Support team

Re: News pagination doesn't work

I've done it but it still doesn't work...
Page 2 and 3 works but if I go to one of them I can't go back to page 1...

Re: News pagination doesn't work

in core/com/allow_active_news

find

        //----------------------------------
        // Pages
        //----------------------------------
        $pages = '';

        if ($number)
        {
            $pages_count        = ceil($count_all / $number);
            $pages_start_from   = 0;

            for($j=1; $j<= $pages_count; $j++)
            {
                if ( $pages_start_from != $start_from)
                {
                    $URL = $PHP_SELF . build_uri('start_from,ucat,archive,subaction,id:comm_start_from', array($pages_start_from,$ucat,$url_archive,$subaction,$id));
                    $pages .= '[url=]'.$j.'[/url] ';
                }
                else $pages .= '<strong>'.$j.'</strong> ';
                $pages_start_from += $number;
            }
        }
        else
        {
            $no_next = true;
            $no_prev = true;
        }

        $prev_next_msg = str_replace("{pages}", $pages, $prev_next_msg);

AND REPLACE WITH

 //----------------------------------
 // Pages
 //----------------------------------
 if($number){
 $pages_count = @ceil($count_all/$number);
 $pages_start_from = 0;
 $pages = "";
 for($j=1;$j<=$pages_count;$j++){
   if($pages_start_from != $start_from){ $pages .= "[url=]
$url_archive&subaction=$subaction&id=$id&$user_query\">$j[/url] "; }
       else{ $pages .= " <strong>$j</strong> "; }
   $pages_start_from += $number;
   }
   $prev_next_msg = str_replace("{pages}", $pages, $prev_next_msg);
   }

it's simply the code used in previous relases.

Still, PREVIUOS and NEXT link doesn't work.

15 (edited by 2013-08-29 06:46:57)

Re: News pagination doesn't work

in core/com/allow_active_news

AND REPLACE WITH

....

it's simply the code used in previous relases.

Still, PREVIUOS and NEXT link doesn't work.

I have had the same problem with actual version and replaced the code, now it works as it should work!
A pitty, that cutenews support works so poor these days, as the software is great ...

Kind regards, setarkos

Re: News pagination doesn't work

I have had the same problem with actual version and replaced the code, now it works as it should work!
A pitty, that cutenews support works so poor these days, as the software is great ...

Kind regards, setarkos

agree, too bad  https://cutephp.com/forum/style_emoticons/default/sad.gif

Posts: 17

Pages 1

You must login or register to post a reply

CutePHP Forums → Problem Solving / Help & Support → News pagination doesn't work



The pun_antispam official extension is installed. Copyright © 2003–2009 PunBB.