Topic: Title cats problem in full-story

Hello, I installed the hack to display news headlines on the page title.

<?PHP
function title_values($id, $use_category)
    {
                $path = 'cutenews/data';
        if ($use_category)
        {
            $cat_lines = file($path.'/category.db.php');
            foreach ($cat_lines as $cat_line)
                {
                    $cat_array = explode('|', $cat_line);
                    $my_cats[$cat_array[0]] = $cat_array[1];
                }
        }

        $news_lines = file($path.'/news.txt');
        foreach ($news_lines as $news_line)
            {
                $news_array = explode("|", $news_line);
                if ($news_array[0] == $id)
                    {
                        $title = strip_tags($news_array[2]);
                        $description = strip_tags($news_array[3]);

                        if ($use_category and !empty($news_array[6]))
                            {
                                if (strstr($news_array[6], ','))
                                    {
                                        $cat_array = explode(',', $news_array[6]);
                                        foreach ($cat_array as $category)
                                            $category_arr[] = $my_cats[$category];
                                    }
                                else $category_arr = $my_cats[$news_array[6]];
                            }
                    }
            }
        return array ($title, $category_arr, $description);
    }

if (isset($_GET['id']))
    {
        $title_values = title_values($_GET['id'], true);//change true to false if the category doesn't need to be in the titlebar.
        $title = $title_values[0];
        $description = $title_values[2];
        if (is_array($title_values[1])) $cat = ' - '.implode(' - ', $title_values[1]);
        else $cat = ' - '.$title_values[1];

        echo "<title>".$title."".$cat."</title>\n";
        echo "<meta name=\"description\" content=\"".$description."\" />";
    }

else
    {
        echo "<title>Site Name</title>\n";
        echo "<meta name=\"description\" content=\"Default Description\">";
    }
?>

To view the full news {category-url}  is abbreviated, for example.

In Short Story: Video
In Full Story: V

This happens only in full view of the news, what is happening?

Re: Title cats problem in full-story

Probably you should change $cat for $cat_hack in your code.

Best regards,
CN Support team

Re: Title cats problem in full-story

Tanks! Solved Problem !  https://cutephp.com/forum/style_emoticons/default/biggrin.gif