Topic: [BUG] Full story doesn't work
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
$allow_add_comment = FALSE;
$allow_full_story = FALSE;
$allow_active_news = FALSE;
$allow_comments = FALSE;
add after
$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
//<<<------------ 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
//<<<------------ 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
<?PHP
$ucat = (!isset($_GET['ucat']))?$category:$ucat;
error_reporting (E_ALL ^ E_NOTICE);