Topic: newsletter category


I want to add the category NAME to the newsletter after an item's title (not the category number).

There is (was?) a topic on this (

but the lin throws up a page error.

Any help on how to add category name to newsletter would be appreciated.


Re: newsletter category

There has been no solution on this question... but maybe someone with good php experience could help. I'll quote the topic from the google web cache:

Newsletter Hack: how to add category name to newsletter?

My own PHP is not good enough to work this one out with the menu hack code ...
hopefully some php aware member will be able to figure this...

Sorry can't help myself

Re: newsletter category

multiple categories didn't exist when the hack was made

from the other topic

function show_cat_name($cat_id){
                      $cats = file("./data/category.db.php");
                      foreach($cats as $cat_line){
                          $cat_line_arr = explode("|", $cat_line);
                          if($cat_line_arr[0] == $cat_id)
                              return $cat_line_arr[1];

replace with new function as mentioned

// Function:    Category ID to Name
// Description:    convert to category name from ID
if (!function_exists('catid2name')){
    function catid2name($thecat){
        $cats = file("./data/category.db.php");//<----make sure the path is correct!

        if(strstr($thecat, ',')){
            $thecat_arr = explode(',', $thecat);
            foreach($thecat_arr as $single_thecat){
                    $thecat_str .= ', '. $cat[$single_thecat];
                    $thecat_str .= $cat[$single_thecat];

                $thecat_not_first = TRUE;

            return $thecat_str;
            return $cat[$thecat];

replace all catid2name
with the old function name show_cat_name