Comment Display Not Formatted

venusrising - June 25, 2008 - 19:30
Project:Advanced Forum
Version:5.x-1.0-alpha10
Component:User interface
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

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.

AttachmentSize
templatesend.php_.txt5.08 KB

#1

Michelle - June 25, 2008 - 19:58
Status:active» fixed

The relavent code is this:

<?php
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

#2

pcs305 - June 25, 2008 - 21:40

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

AttachmentSize
template.php_.txt2.06 KB

#3

Michelle - June 26, 2008 - 02:16

@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

#4

venusrising - June 27, 2008 - 05:35

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

<?php

?>
where missing from the section?
Thanks you for all of your help and feedback.
Shannon

#5

venusrising - June 27, 2008 - 06:22

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

#6

roopletheme - June 28, 2008 - 09:07

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.

#7

yan - June 30, 2008 - 16:21
Version:5.x-1.0-alpha9» 5.x-1.0-alpha10

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

AttachmentSize
template.php_.txt6.71 KB

#8

Michelle - June 30, 2008 - 17:09

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

#9

yan - June 30, 2008 - 17:45

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.

#10

Michelle - July 1, 2008 - 00:12

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

#11

Anonymous (not verified) - July 15, 2008 - 00:22
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.