Hello,

forum module works fine for me, flatforum too as long as there is no comment. But if there are any comments (so post answers to the thread) all comments are shown, but the thread topic (first post in that thread) isn't !

It seems like there is something wrong with my function _phptemplate_variables($hook, $vars).

this there was original (garland, drupal 5) - I commented this out

function _phptemplate_variables($hook, $vars) {
  if ($hook == 'page') {

    if ($secondary = menu_secondary_local_tasks()) {
      $output = '<span class="clear"></span>';
      $output .= "<ul class=\"tabs secondary\">\n". $secondary ."</ul>\n";
      $vars['tabs2'] = $output;
    }

    // Hook into color.module
    if (module_exists('color')) {
      _color_page_alter($vars);
    }
    return $vars;
  }
  return array();
}

and just added than this from flatforum (like their install.txt says)

function _phptemplate_variables($hook, $vars) {
  if ($hook == 'page') {
  static $is_forum;
  $variables = array();
  if (!isset($is_forum)) {
    if (arg(0) == 'node' && is_numeric(arg(1)) && arg(2) == '') {
      $nid = arg(1);
    }
    if (arg(0) == 'comment' && arg(1) == 'reply' && is_numeric(arg(2))) {
      $nid = arg(2);
    }
    if ($nid) {
      $node = node_load(array('nid' => $nid));
    }
    $is_forum = ($node && $node->type == 'forum');
    _is_forum($is_forum);
  }
  if ($is_forum) {
    switch ($hook) {
      case 'comment' :
        $variables['template_file'] = 'node-forum';
        $variables['row_class'] = _row_class();
        $variables['name'] = $vars['author'];
        $variables['userid'] = $vars['comment']->uid;
        $joined = module_invoke('flatforum', 'get_created', $vars['comment']->uid);
        $variables['joined'] = $joined ? format_date($joined, 'custom', 'Y-m-d') : '';
        $posts = module_invoke('flatforum', 'get', $vars['comment']->uid);
        $variables['posts'] = $posts ? $posts : 0;
        $variables['submitted'] = format_date($vars['comment']->timestamp);
        $subject = $vars['comment']->subject;
        $variables['title'] = empty($subject) ? '&nbsp' : $subject;
        $variables['content'] = $vars['comment']->comment;
        $variables['links'] = empty($vars['links']) ? '&nbsp' : $vars['links'];
        break;
      case 'node' :
        $variables['row_class'] = _row_class();
        $variables['userid']=$vars['node']->uid;
        $joined = module_invoke('flatforum', 'get_created', $vars['node']->uid);
        $variables['joined'] = $joined ? format_date($joined, 'custom', 'Y-m-d') : '';
        $posts = module_invoke('flatforum', 'get', $vars['node']->uid);
        $variables['posts'] = $posts ? $posts : 0;
        $variables['title'] = empty($vars['title']) ? '&nbsp' : $vars['title'];
        $variables['content'] = $vars['node']->body;
        $variables['links'] = empty($vars['links']) ? '&nbsp' : $vars['links'];
        break;
    }
  }
  return $variables;
}

(Normaly that 2 functions have to be merged or?)

Do anybody see why it does not show the start posting in a thread AFTER there are comments to it?

Ps.: Anybody added support to it that the user picture (if the user uploaded one) got shown on the left side under the users name?

Sincerally, l8a

Comments

l8a’s picture

I just noticed that the original posting IS within the source code, but not vissible - seems like some css problem
(yes - i have merged flatforum.css within garlands style.css)

Ps.: I noticed the option "user pictures in comments" - that does the job @user picture:-)

l8a’s picture

nobody :/ ?

snav’s picture

Hi,

To be honest, i'm very interested in what your doing. I definately would like to have flatforum working on my drupal5, garland theme based site. I'm fairly new to drupal myself, but if I find something i'll definately post it up here.

l8a’s picture

Access denied. Can you post the 'fix' ? Else i will register there..

Sincerally l8a

azote’s picture

woops... is fixed now...

keylope’s picture

Make sure to comment this function out:

function phptemplate_comment_wrapper($content, $type = null)

That was causing the starting post to not display for me. Hope that helps.