Topic: Error when show news by category

Hello!

I have a problem with pagination when show news by categories...

On the main page of selected category news appear ok, but when I click on pagination links, CN show news from other categories too!

Exemple:
This page show news from category number 5, but when navigate in pagination (to show oldest news from this category) news from another categories are displaying:
http://www.siteofadown.com/index.php?soad=news/john

2 (edited by 2012-02-20 18:26:52)

Re: Error when show news by category

Thankyou (:

    if ($soad == 'news') include('cutenews/pages/news.php');
    if ($soad == 'search-news') include('cutenews/search.php');

      //CATEGORIES
      if ($soad == 'news/soad') include('cutenews/pages/news_soad.php');
      if ($soad == 'news/inbr') include('cutenews/pages/news_inbr.php');

<?php

   $number = "5";
   if(!isset($_REQUEST['subaction']))
   $category = "5";

   include("cutenews/show_news.php");
   
?>

For another categories I use the same code but with the respective category ID. As you see, I made one php file to include news from each category.

3 (edited by 2012-02-20 18:41:19)

Re: Error when show news by category

Well..
I solved the problem by deleting the line if(!isset($_REQUEST['subaction']))

...but after I made this news dont open when click on their titles/full-story links hmm

Re: Error when show news by category

Multiple categories or not, no one news open...

Re: Error when show news by category

Looks really good `` Thank you to share with you.http://www.dubaa.info/g.gif

Re: Error when show news by category

Nobody can help me? =/

Re: Error when show news by category

You use a php parameter to determine what page you want to show. pagination links don't pass that parameter.
Have a look at the faq 'parameters you can use with your include code'.
There's a CN parameter you can use to pass the value of $soad to page 2 of the cn news.

$Query_string or $user_query if i'm not mistaken.

Re: Error when show news by category

@Filliu83: I already made this changes on the past (I use cutenews since 2007 xD)...

@FUNimations: Man, I tried use $QUERY_STRING.... but not works too! hmm

File news_sob.php:

<?php
   $QUERY_STRING = "soad=news/sob";
   $number = "5";
   if(!isset($_REQUEST['subaction']))
   $category = "3";

   include("cutenews/show_news.php");

?>

After click on pagination links the url is:

http://www.siteofadown.com/index.php?start_from=5&ucat=3&archive=&subaction=&id=&soad=news/sob

You can access this link, go to the 2nd page of news and see that news from other categories are displaying:
http://www.siteofadown.com/?soad=news/sob

*This category is called "Scars on Broadway", as you will see news from "System of a Down" (and all other categories) are displaying.

Re: Error when show news by category

may i ask what this is for?

if(!isset($_REQUEST['subaction']))

cause pagination link do have the subaction parameter.
And it seems rather useless code.

Re: Error when show news by category

Well...
Problem is solved when I remove this line, but full-story links don't work.

Years ago I've posted here about this problem with full-story links and you (think that you dont remember) fixed it adding if(!isset($_REQUEST['subaction'])) on my code.

11 (edited by 2012-02-27 18:37:28)

Re: Error when show news by category

Yeah, i remember that for some reason the 'official' fix didn't work for the very few.
Hopefully the 'official' fix works for you now.
Else in a last ditch desperate move we can use another dirty fix to fix the problem caused by the first fix.

Re: Error when show news by category

FUCKYEAH!

Guys, you rule!!

I remove if(!isset($_REQUEST['subaction'])) and add $QUERY_STRING  = "X" to all pages that news are included.

I tried this yesterday but not worked... But I try it now and now works fine! haha oO'

Thanks very much for your att and patience! https://cutephp.com/forum/style_emoticons/default/biggrin.gif

-----

OOH SHIT
I have 'hotsites' to show news from a especified category and the problem with full-story links (multiple categories or not) resist:
http://siteofadown.com/serj/

<?php
    $QUERY_STRING = "pg=news";
    $number = "5";
    $category = "2";
    $template = "SerjSite";
    include ("../cutenews/show_news.php");
?>

13 (edited by 2012-03-01 06:21:46)

Re: Error when show news by category

Well, stoped work again... oO
Full-story links doesn't work just when I try to open their on pages that show news from a specified category.

Try open a article of this page:
http://www.siteofadown.com/index.php?soad=news/t2012

I reinstalled my cutenews, aplied modifications from this topic: https://cutephp.com/forum/index.php?showtopic=32860
And I'm using all the include parameters correctly.

<?php
    $QUERY_STRING = "soad=news/2012";
    $number = "5";
    $category = "9";
    include ("cutenews/show_news.php");
?>

Pagination links works fine. The problem is with full links when show news by a specified category.

14 (edited by 2012-03-01 15:53:22)

Re: Error when show news by category

then try this one

if(!isset($_REQUEST['subaction']) || empty($_REQUEST['subaction']))
   $category = "3";

since in the pagin links the subaction isn't given a value, empty() should fix it.

Re: Error when show news by category

FIXED!!!

I love you guy!! haahhahahahahhahaa LOL

thankyou very much

16

Re: Error when show news by category

*useless pondering* Wonder why it's REQUEST instead of GET...

Re: Error when show news by category

*useless pondering* Wonder why it's REQUEST instead of GET...


And what if you submit a comment? Then you don't have a GET subaction

18

Re: Error when show news by category

ah, I was lazy and just read the first and the last (solution) post, and figured this was only a pagin (url) problem

Re: Error when show news by category

I'm having the same problem with the pagination by categories, but I have cutenews 2.0 and all solutions are for previous versions. Someone can help me?

Posts: 23

Pages 1

You must login or register to post a reply

CutePHP Forums → Problem Solving / Help & Support → Error when show news by category