I've read through some of the other support requests on this issue with other themes, but can't find any helpful information. I'm only a novice when it comes to PHP, but I'm pretty sure my function is formatted correctly.
Here is said function:

function _phptemplate_variables($hook, $vars = array()) {
  if (module_exists('advanced_forum')) {
    $vars = advanced_forum_addvars($hook, $vars);
  }
  switch ($hook) {
    case 'node':
      if ($vars['page']) {
        $vars['template_files'] = array('node-default-page', 'node-'. $vars['node']->type .'-page', 'node-'. $vars['node']->nid .'-page');
      }
      else {
        $vars['template_files'] = array('node-'. $vars['node']->nid);
      }
      break;       
  }
  if ($hook == 'page') {
    celju_removetab('Users', $vars);              // replace themename with your theme's name
  }
  return $vars;
}

Thanks in advance for any assistance!

Comments

james_w’s picture

$vars['template_files'] = array('node-default-page', 'node-'. $vars['node']->type .'-page', 'node-'. $vars['node']->nid .'-page');

Edit:

I think it's a problem with the above line. If I comment this line, the post will theme correctly. I'm not experienced enough to understand what this line is doing, though.

Any help is appreciated!

james_w’s picture

Another update, I was able to make it work by moving the snippet to the bottom of the function, like so:

function _phptemplate_variables($hook, $vars = array()) {
  switch ($hook) {
    case 'node':
      if ($vars['page']) {
        $vars['template_files'] = array('node-default-page', 'node-'. $vars['node']->type .'-page', 'node-'. $vars['node']->nid .'-page');
      }
      else {
        $vars['template_files'] = array('node-'. $vars['node']->nid);
      }
	break;     
  }
  if ($hook == 'page') {
    celju_removetab('Users', $vars);              // replace themename with your theme's name
  }  
  if (module_exists('advanced_forum')) {
    $vars = advanced_forum_addvars($hook, $vars);
  }
  return $vars;
}

Any idea if I will see any problems by doing this? I've clicked around most areas of my site and things still appear to be in order.

Thanks...

michelle’s picture

Status: Active » Fixed

Yeah, that line is overriding the forum post template file. Moving the advforum function call to the end looks like the right fix. It won't affect any template files except forum posts.

Thanks for fixing your own issue. Makes my job easier. ;)

Michelle

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.