I have this running on another site but on this site I get this error "Parse error: syntax error, unexpected T_STRING in /home/content/html/themes/analytic/template.php on line 60"

Comments

ppblaauw’s picture

Status: Active » Postponed (maintainer needs more info)

Can you attach the template.php file so I can help you better.

jimebob’s picture

here it is:

// $Id: template.php,v 1.4 2008/12/26 09:02:43 troy Exp $

function phptemplate_preprocess_page(&$vars) {
  $defaults = array(
    'admin_left_column' => 1,
    'admin_right_column' => 0
  );
  
  global $theme_key;
  // Get default theme settings.
  $settings = theme_get_settings($theme_key);    
  $settings = array_merge($defaults, $settings);
 
  
  
  if (arg(0) == 'admin' && ($settings['admin_right_column'] == 0) && !(arg(1) == 'build' && arg(2) == 'block')) {
    $vars['right'] = '';
  }
  
  if (arg(0) == 'admin' && ($settings['admin_left_column'] == 0) && !(arg(1) == 'build' && arg(2) == 'block')) {
    $vars['left'] = '';
  }
  
  $vars['registration_enabled'] = variable_get('user_register', 1);
  $vars['closure'] .= '<span class="developer">
<strong><a href="http://www.DrCyberspace.com">The Web Design by SEO Firm!</a></strong>
</span>';
}


/**
 * Generate the HTML representing a given menu item ID.
 *
 * An implementation of theme_menu_item_link()
 *
 * @param $link
 *   array The menu item to render.
 * @return
 *   string The rendered menu item.
 */
function phptemplate_menu_item_link($link) {
  if (empty($link['options'])) {
    $link['options'] = array();
  }

  // If an item is a LOCAL TASK, render it as a tab
  if ($link['type'] & MENU_IS_LOCAL_TASK) {
    $link['title'] = '<span class="tab">' . check_plain($link['title']) . '</span>';
    $link['options']['html'] = TRUE;
  }

  if (empty($link['type'])) {
    $true = TRUE;
  }

  return l($link['title'], $link['href'], $link['options']);
}

Add this if statement code in the function analytic_preprocess_ddblock_cycle_block_content

    if ($vars['settings']['view_name'] == 'node_gallery') {
      if (!empty($vars['content'])) {
        foreach ($vars['content'] as $key1 => $result) {
          // add slide_image variable 
		  if (isset($result->node_data_field_multiple_image_field_field_multiple_image_field_fid)) {
            // get image id
            $fid = $result->node_data_field_multiple_image_field_field_multiple_image_field_fid;
            // get path to image
            $filepath = db_result(db_query("SELECT filepath FROM {files} WHERE fid = %d", $fid));
            //  use imagecache (imagecache, preset_name, file_path, alt, title, array of attributes)
            if (module_exists('imagecache') && is_array(imagecache_presets()) && $vars['imgcache_slide'] <> '<none>'){
              $slider_items[$key1]['slide_image'] = 
              theme('imagecache', 
                    $vars['imgcache_slide'], 
                    $filepath,
                    $result->node_title);
            }
            else {          
              $slider_items[$key1]['slide_image'] = 
                '<img src="' . base_path() . $filepath . 
                '" alt="' . $result->node_title . 
                '"/>';     
            }          
          }      
    //  add slide_title and slide_text variable from imagefield title and description
    if (isset($result->node_data_field_multiple_image_field_field_multiple_image_field_data)) {
      $data=unserialize($result->node_data_field_multiple_image_field_field_multiple_image_field_data);
      if (isset($data['description'])) {
       $slider_items[$key1]['slide_text'] = $data['description'];
	  }
      if (isset($data['title'])) {
		$slider_items[$key1]['slide_title'] =  $data['title'];
      }
    }

	// add slide_read_more variable and slide_node variable
          if (isset($result->nid)) {
            $slider_items[$key1]['slide_read_more'] =  l('Read more...', 'node/' . $result->nid);
            $slider_items[$key1]['slide_node'] =  'node/' . $result->nid;
          }
        }
        $vars['slider_items'] = $slider_items;
      }
    }
	
	
Add this if statement code in the function analytic_preprocess_ddblock_cycle_pager_content


    if ($vars['pager_settings']['view_name'] == 'node_gallery') {
      if (!empty($vars['content'])) {
        foreach ($vars['content'] as $key1 => $result) {
          // add pager_item_image variable
          if (isset($result->node_data_field_multiple_image_field_field_multiple_image_field_fid)) {
            $fid = $result->node_data_field_multiple_image_field_field_multiple_image_field_fid;
            $filepath = db_result(db_query("SELECT filepath FROM {files} WHERE fid = %d", $fid));
            //  use imagecache (imagecache, preset_name, file_path, alt, title, array of attributes)
            if (module_exists('imagecache') && 
                is_array(imagecache_presets()) && 
                $vars['imgcache_pager_item'] <> '<none>'){
              $pager_items[$key1]['image'] = 
                theme('imagecache', 
                      $vars['pager_settings']['imgcache_pager_item'],              
                      $filepath,
                      $result->node_data_field_multiple_image_field_field_multiple_image_field_data);
            }
            else {          
              $pager_items[$key1]['image'] = 
                '<img src="' . base_path() . $filepath . 
                '" alt="' . $result->node_data_field_multiple_image_field_field_multiple_image_field_data . 
                '"/>';     
            }          
          }
          // add pager_item _text variable from imagefield alternative text
          if (isset($result->node_data_field_multiple_image_field_field_multiple_image_field_data)) {
		    $data=unserialize($result->node_data_field_multiple_image_field_field_multiple_image_field_data);
		  if (isset($data['alt'])) {
		    $pager_items[$key1]['text'] =  $data['alt'];
            }          
		  }
        }
      }
      $vars['pager_items'] = $pager_items;
    }
/**
 * Duplicate of theme_menu_local_tasks() but adds clear-block to tabs.
 */
function phptemplate_menu_local_tasks() {
  $output = '';

  if ($primary = menu_primary_local_tasks()) {
    $output .= '<ul class="tabs primary clear-block">' . $primary . '</ul>';
  }
  if ($secondary = menu_secondary_local_tasks()) {
    $output .= '<ul class="tabs secondary clear-block">' . $secondary . '</ul>';
  }

  return $output;
}

ppblaauw’s picture

Version: 6.x-1.0-rc5 » 6.x-1.0-rc6
Category: bug » support

When you want to use the node_gallery option with the dynamic display block module you need to add the if statement mentioned in that tutorial to the existing ddblock preprocess function.

Hope this helps you further, please let me know.

I set the Version to RC6, if you are using RC5 please upgrade to RC6.

jimebob’s picture

That was it. Thank you. Dumb Mistake. It's working perfectly now.

ppblaauw’s picture

Status: Postponed (maintainer needs more info) » Fixed

Set status to fixed

Do you have a link to the result?

Status: Fixed » Closed (fixed)

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