$picture variable set wrong in function phptemplate_node() when "Display post information on" is off

bryan kennedy - December 13, 2005 - 06:18
Project:PHPTemplate
Version:HEAD
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Description

In all other types of posts the $picture variable generates the full link and image tag for the user picture. But on the blog content type only the path is created in the $picture variable in node.tpl.php. This causes the use to just see the path to the image instead of the image with the image tag and link. I am using the default photemplate built into 4.7-beta and the blumarine default theme and the friends electric theme. Both show this behavior.

#1

frjo - February 19, 2006 - 09:35
Title:Node.tpl.php $picture variable broken in blog» $picture variable set wrong in function phptemplate_node() when "Display post information on" is off

I run in to this problem on node types where I have turned off "Display post information on".

The $picture variable is then set to only the file path and is always shown regardless of settings like "Toggle display, User pictures in posts" etc.

In the function phptemplate_node() in phptemplate.engine I added a else statement to set $picture to empty and it work for me but I don't know if it's the proper solution.

  // Display info only on certain node types.
  if (theme_get_setting('toggle_node_info_' . $node->type)) {
    $variables['submitted'] =  t('Submitted by %a on %b.', array('%a' => theme('username', $node), '%b' => format_date($node->created)));
    $variables['picture'] = theme_get_setting('toggle_node_user_picture') ? theme('user_picture', $node) : '';
  }
  // ***new code***
  else {
    $variables['picture'] = '';
  }

#2

drewish - February 24, 2006 - 08:03
Status:active» needs review

Here's a patch that does pretty much the same thing that frjo suggested.

AttachmentSize
phptemplate_picture.patch 721 bytes
 
 

Drupal is a registered trademark of Dries Buytaert.