Hello-
I followed the install and have Advanced Forum Installed. I got it working with the exception of the comments. The comments show but not in the theme format of the Advanced Forum. They look like a regular site comments not like the rest of the forum. I added the variables to the template.php

You will see side text that says variables below which is what I added. I also ran cron etc and no dice. I attached my template PhP file instead of pasting it in to avoid a large post. We are working with the Tapestry theme from roople.

Comments

michelle’s picture

Status: Active » Fixed

The relavent code is this:

if (theme_get_setting('tapestry_themelogo')) {
  function _phptemplate_variables($hook, $vars) {
    if (module_exists('advanced_profile')) {
      $vars = advanced_profile_addvars($hook, $vars);
    }
    if (module_exists('advanced_forum')) {
      $vars = advanced_forum_addvars($hook, $vars);
    }
    
    $styled_logo = '/images/' . get_tapestry_style() . '/logo.png';
    $variables['logo'] = base_path() . drupal_get_path('theme', 'tapestry') . $styled_logo;
    
    return $variables;
  }
}

There are two problems with it.

1) If theme_get_setting('tapestry_themelogo') returns false, the whole function doesn't happen.
2) You're passing in $vars and using $vars for my modules but then adding something to $variables and then returning $variables.

So you need to:
1) Make sure that's never false.
2) Pick $vars or $variables and stick with it.

Michelle

pcs305’s picture

StatusFileSize
new2.06 KB

I'm experiencing the same problem. The Forum looks great but the comments are not formatted.
I tried to figure out what the problem can be but to no avail.

Attached is my template.php if you will be kind enough to glance at it for me.

Than you.
Ian

michelle’s picture

@pcs305 - Yours looks just fine to me. Might want to try asking in your theme's queue to see if there's something else in the theme that could be interfering.

Michelle

venusrising’s picture

Michelle-
1.When you say false is that because
A. it ended in $variables =array ()) ? I tried to look up some PHP info and it said an array() =false or is it because the array is empty? OR
B. Because the where missing from the section?
Thanks you for all of your help and feedback.
Shannon

venusrising’s picture

Hooray!!! I got it working now. Thank you so much for the help and assistance.

roopletheme’s picture

Not sure why the comments would be formatted differently, but the only code anywhere in Tapestry related to comments is this definition on line 108 of style.css:

.comment {
	padding: 10px;
	margin: 10px 0;
}

I've successfully used this code to get Tapestry to support Advanced Profile, Advanced Forum, and Node Title:

<?php
function _phptemplate_variables($hook, $vars) {
  $vars = array();
  if (module_exists('advanced_profile')) {
    $vars = advanced_profile_addvars($hook, $vars);
  }
  if (module_exists('advanced_forum')) {
    $vars = advanced_forum_addvars($hook, $vars);
  }
  if ($hook == 'page') {
    if (module_exists('page_title')) {
      $vars['head_title'] = page_title_page_get_title();
    }
  }
  if (theme_get_setting('tapestry_themelogo')) {
    $vars['logo'] = base_path() . path_to_theme() . '/images/' . theme_get_setting('tapestry_style') . '/logo.png';
  }
  return $vars;
}
?>

If this doesn't work for you, I'd be happy to help figure out why.

yan’s picture

Version: 5.x-1.0-alpha9 » 5.x-1.0-alpha10
StatusFileSize
new6.71 KB

I'm having the exact same problem using the Zen Theme. See my template.php attached. Any ideas?

michelle’s picture

Ok, that's not even remotely close to what it says to do it http://drupal.org/node/207841 . Please run thru the docs again. I don't mind helping, but I need people to try and help themselves first otherwise I'm going to be spending all my time editing peoples' template.php files for them.

Michelle

yan’s picture

Sorry Michelle, I didn't mean to offend you. I misunderstood the part of the documentation where it says

Add this code to the top of _phptemplate_variables in template.php in your theme and make sure you are returning $vars, not array() at the end

(I thought: on top, i.e. above the function) and I didn't see the link to the node you pointed me to. Actually I was quite close, just some lines away. ;)

Thanks for your hint, now it seems to work as it should.

michelle’s picture

Not a matter of offense. Just keep having to answer this over and over and over and it gets to a point where I just have to say enough and point at the docs. You just happened to be the unlucky straw. ;)

Glad you figured it out.

Michelle

Anonymous’s picture

Status: Fixed » Closed (fixed)

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