wonderful module, but it will not all inserted images appear. Can one still image is an option again
insert and delete.

Comments

bakr’s picture

for me nothing appears at all?

tars16’s picture

I can't replicate. What versions are you using? I just installed 6.22 and content_type_image with nothing else and everything worked as expected.

bakr’s picture

StatusFileSize
new131.8 KB

Apparently the issue depends on theme.

I use summertime theme.

The following var_dump of the $items does not indicate containing any relevant image info.
Though the $screenshots variable is ok.

++++++ function print_array($aArray) {
++++++  // Print a nicely formatted array representation:
++++++  echo '<pre>';
++++++  print_r($aArray);
++++++  echo '</pre>';
}

/**
 * Override theme_node_add_list().
 */
function theme_content_type_image_node_add_list($content) {
  $screenshots = variable_get('content_type_image_images', array());

++++  print_array($screenshots);
  
  $output = '<ul class="node-add-list">';
  if ($content) {
	 
    foreach ($content as $item) {
		
		
		 
      // get content type name from argument path
      $classes = _content_type_image_icon_classes($item['href']);
      if (isset($item['localized_options']['attributes']['class'])) {
        $item['localized_options']['attributes']['class'] .= ' ' . $classes;
      }
      else {
        $item['localized_options']['attributes']['class'] = $classes;
      }
      $item['localized_options']['html'] = TRUE;

      $output .= '<li>';

      $type = end(explode('/', $item['link_path']));
      $class = '';
      if (isset($screenshots[$type])) {
		   drupal_set_message($screenshots[$type]);
        $class = 'hasimg';
        $output .= '<div class="image"><a href="/node/add/' . $type . '">' . theme('imagecache', '150x110_content_type_image', $screenshots[$type]) . '</div>';
      }
      $output .= '<div class="title' . $class . '">' . l($item['title'], $item['href'], $item['localized_options']) . '</div>';
      $output .= '<div class="description' . $class . '">'. filter_xss_admin($item['description']) .'</div>';
      if (isset($screenshots[$type])) {
        $output .= '<div class="clear"></div>';
      }
      $output .= '</li>';
	  
+++++	  print_array($item);
    }
  }
  $output .= '</ul>';
  return $output;
 
}
bakr’s picture

Priority: Normal » Major

have changed to major, due to potential incompatibility with some themes.

I am using drupal 6.22

bakr’s picture

Priority: Major » Normal
Status: Active » Closed (fixed)

SOLUTION

         $type = end(explode('/', $item['link_path']));
+++      $type = str_replace("-","_",$type);

That was the culprit!

Great Module, Thanks.

bakr’s picture

I hope this gets commited in the next release.

fugazi’s picture

# 5 confirmed it works for me, wonderful, many thanks bakr

tars16’s picture

Thanks. Will get a new release together tonight hopefully.

fugazi’s picture

I now have a problem. The link to your image does not there. it links to, for example
/node/add/advpoll_binary

linking would be correctly
/node/add/advpoll-binary

Only when I remove #5 are no longer displayed the pictures. What can I do.

Many Thanks

fugazi’s picture

StatusFileSize
new74.88 KB
new106.51 KB

two pictures. normal first second after clicking on image

fugazi’s picture

Status: Closed (fixed) » Active
bakr’s picture

simply create a new variable to put it in the path

      $type = end(explode('/', $item['link_path']));
+    $type_orig = $type;
      $type = str_replace("-","_",$type);
      $class = '';
      if (isset($screenshots[$type])) {
        $class = ' hasimg';
        $output .= '<div class="image"><a href="?q=node/add/' . $type_orig . '">' . theme('imagecache', '150x110_content_type_image', $screenshots[$type]) . '</div>';
      }
fugazi’s picture

Hello bakr
I'm very sorry but I can not program well, as is the variable to look + $type_orig = $type;.
Can you help me.

many thanks for your help current

bakr’s picture

yes indeed. type_orig is the variable i just added.

this a resolution to ensure the images are clickable and pointing to the correct node add url

fugazi’s picture

Hello bakr,

it was my fault I forgot to change

<a href="/node/add/' . $type . '">
in
<a href="?q=node/add/' . $type_orig . '">

now it works,

many thanks

tars16’s picture

Status: Active » Closed (fixed)