Useful and interesting modules for Drupal 6.xx + Tips and Tricks (Part III)

    We continue what we started, and besides, over the time that has passed since the last review, many interesting modules have accumulated.

    For those who missed the start, here are links to previous reviews: Part I and Part II

    And according to tradition, advice.

    We show the number of comments (if there are any, their number will appear; if not, nothing will appear, for example, this is done on Habré)


    /**
    * Preprocessor for theme('comment_wrapper').
    */
    function ВАША_ТЕМА_preprocess_comment_wrapper(&$vars) {
     $vars['hook'] = 'box';
     $vars['attr']['id'] = 'comments';
     $vars['attr']['class'] .= ' clear-block';
       
     if ($vars['content'] && $vars['node']->type != 'forum' && $vars['node']->comment_count != 0) {
      $vars['content'] = '

    '. t('Comments') .'

    '. $vars['content'];
     }
    }

    * This source code was highlighted with Source Code Highlighter.

    Also popular now: