CuteNews

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> [BUG] Full story doesn't work, Articles in multiple categories.
Rating 5 V
FUNimations
post Nov 30 2008, 11:45 AM
Post #1


CuteNews Support Crew Pimp
***

Group: Support
Posts: 16,501
Joined: 28-August 05
From: Belgium
Member No.: 5,662



CuteNews Compatibility: 1.4.5 - * (no incompatibility reported yet)
Author: This fix was proposed by just-sev
Description: I wouldn't call this an actual bug on the CuteNews end but rather the way php handles it's input.
For some reason for some people the full story doesn't work when the article is in more then 1 category.
Now if you read this thinking this is you problem do check that this problem doesn't occur whith articles within 1 category or none.
Instructions:

in show_news.php find
CODE
$allow_add_comment                        = FALSE;
$allow_full_story                        = FALSE;
$allow_active_news                         = FALSE;
$allow_comments                         = FALSE;

add after
CODE
$is_in_category = FALSE;
if (strstr($ucat,',')) { // if the article is in multiple categories.
  $article_cat_arr = explode(',', $ucat);
  foreach($article_cat_arr as $one_cat) {
    if ($requested_cats and $requested_cats[$one_cat] == TRUE){$is_in_category = TRUE;}
  }
}
else {
  if ($requested_cats and $requested_cats[$ucat] == TRUE){$is_in_category = TRUE;}
}


find
CODE
//<<<------------ Detarime what user want to do
if( $CN_HALT != TRUE and $static != TRUE and ($subaction == "showcomments" or $subaction == "showfull" or $subaction == "addcomment") and ((!isset($category) or $category == "") or ($requested_cats[$ucat] == TRUE )  ) ){
    if($subaction == "addcomment"){  $allow_add_comment        = TRUE; $allow_comments = TRUE; }
    if($subaction == "showcomments"){ $allow_comments = TRUE; }
    if(($subaction == "showcomments" or $allow_comments == TRUE) and $config_show_full_with_comments == "yes"){$allow_full_story = TRUE; }
    if($subaction == "showfull") $allow_full_story = TRUE;
    if($subaction == "showfull" and $config_show_comments_with_full == "yes") $allow_comments = TRUE;

}
else{
    if($config_reverse_active == "yes"){ $reverse = TRUE; }
        $allow_active_news = TRUE;
}
//----------->>> Detarime what user want to do

replace by
CODE
//<<<------------ Detarime what user want to do
if( $CN_HALT != TRUE and $static != TRUE and ($subaction == "showcomments" or $subaction == "showfull" or $subaction == "addcomment") and ((!isset($category) or $category == "") or ($is_in_category == TRUE )  ) ){
    if($subaction == "addcomment"){  $allow_add_comment        = TRUE; $allow_comments = TRUE; }
    if($subaction == "showcomments"){ $allow_comments = TRUE; }
    if(($subaction == "showcomments" or $allow_comments == TRUE) and $config_show_full_with_comments == "yes"){$allow_full_story = TRUE; }
    if($subaction == "showfull") $allow_full_story = TRUE;
    if($subaction == "showfull" and $config_show_comments_with_full == "yes") $allow_comments = TRUE;
}
else{
        if($config_reverse_active == "yes"){ $reverse = TRUE; }
            $allow_active_news = TRUE;
}
//----------->>> Detarime what user want to do


Add this at the top of the file
CODE
<?PHP
$ucat = (!isset($_GET['ucat']))?$category:$ucat;
error_reporting (E_ALL ^ E_NOTICE);


--------------------

General FAQ
Spam Protection In Cutenews
Comments get deleted
_______________________
<< If you appreciate my help
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

 



RSS Lo-Fi Version Time is now: 19th May 2013 - 02:52 AM