I followed all the instructions, but my slideshow does not display at all. I am using the theme "mytheme" and the "custom" files are saved in the mytheme folder. Please help!

my template.php document:

<?php
// $Id: template.php,v 1.5 2009/01/29 14:32:52 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="" title=""></a></strong>          <span class="version"></span>
</span>';
}

function phptemplate_pager_last($text, $limit, $element = 0, $parameters = array()) {
  global $pager_page_array, $pager_total;
  $output = '';
$view_path = "frontpage";  // Change to reflect yours views actual path
if ( arg(0) != $view_path ) {
  // If we are anywhere but the last page
  if ($pager_page_array[$element] < ($pager_total[$element] - 1)) {
    $output = theme('pager_link', $text, pager_load_array($pager_total[$element] - 1, $element, $pager_page_array), $element, $parameters, array('class' => 'pager-last'));
  }

  return $output;
  }
}


/**
 * 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']);
}

/**
 * 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;
}


/*!
 * Dynamic display block preprocess functions
 * Copyright (c) 2008 - 2009 P. Blaauw All rights reserved.
 * Version 1.5 (27-JUL-2009)
 * Licenced under GPL license
 * http://www.gnu.org/licenses/gpl.html
 */

 /**
 * Override or insert variables into the ddblock_cycle_block_content templates.
 *   Used to convert variables from view_fields to slider_items template variables
 *
 * @param $vars
 *   An array of variables to pass to the theme template.
 * 
 */
function mytheme_preprocess_ddblock_cycle_block_content(&$vars) {
  $settings = $vars['ddblock_slider_settings'];
  // for showing debug info
  ddblock_show_content_debug_info($vars);
  if ($settings['output_type'] == 'view_fields') {
    if ($settings['view_name'] == 'news_items' && $settings['view_display_id'] == 'block_1') {
      if (!empty($vars['ddblock_content'])) {
        foreach ($vars['ddblock_content'] as $key1 => $result) {
          // add slide image variable
          $slider_items[$key1]['slide_image'] = ddblock_add_image(
            $vars,
            // determines which imagcache preset to use, leave to 'slider_item_image'
            'slider_item_image',
            // name of CCK generated image field, change if needed.
            $result->node_data_field_pager_item_text_field_image_fid,
            // alt attribute of image or NULL
            $result->node_title,
            // cck content type for default image or NULL, change if needed
            NULL, //'ddblock_news_item',
            // cck fieldname for default image or NULL, change if needed
            NULL, //'field_image',
            // to link the image to or NULL, change if needed
            NULL //'node/' . $result->nid
          );
          // add slide_text variable
          if (isset($result->node_data_field_pager_item_text_field_slide_text_value)) {
            $slider_items[$key1]['slide_text'] =  check_markup($result->node_data_field_pager_item_text_field_slide_text_value);
          }
          // add slide_title variable
          if (isset($result->node_title)) {
            $slider_items[$key1]['slide_title'] =  check_plain($result->node_title);
          }
          // add slide_read_more variable and slide_node variable
          if (isset($result->nid)) {
            $slider_items[$key1]['slide_read_more'] = '<a href="/node/' .  $result->nid . '">' . t('Read more') . '</a>';
            $slider_items[$key1]['slide_node'] =  'node/' . $result->nid;
          }
        }
      }
    }    
    $vars['ddblock_slider_items'] = $slider_items;
  }
}  
/**
 * Override or insert variables into the ddblock_cycle_pager_content templates.
 *   Used to convert variables from view_fields  to pager_items template variables
 *  Only used for custom pager items
 *
 * @param $vars
 *   An array of variables to pass to the theme template.
 *
 */
function mytheme_preprocess_ddblock_cycle_pager_content(&$vars) {
  $settings = $vars['ddblock_pager_settings'];
  // for showing debug info
  ddblock_show_pager_debug_info($vars);
  if (($settings['output_type'] == 'view_fields') && 
      ($settings['pager'] == 'number-pager' || 
      $settings['pager'] == 'custom-pager' || 
      $settings['pager'] == 'scrollable-pager' )){
    if ($settings['view_name'] == 'news_items' && $settings['view_display_id'] == 'block_1') {
      if (!empty($vars['ddblock_content'])) {
        foreach ($vars['ddblock_content'] as $key1 => $result) {
          // add pager_item_image variable
          $pager_items[$key1]['image'] = ddblock_add_image(
            $vars,
            // determines which imagcache preset to use, leave to 'pager_item_image'
            'pager_item_image',
            // name of CCK generated image field, change if needed.
            $result->node_data_field_pager_item_text_field_image_fid,
            // alt attribute of image or NULL
            $result->node_data_field_pager_item_text_field_pager_item_text_value,
            // cck content type for default image or NULL, change if needed
            NULL, //'ddblock_news_item',
            // cck fieldname for default image or NULL, change if needed
            NULL, //'field_image',
            // to link the image to or NULL, change if needed
            NULL //'node/' . $result->nid
          );
          // add pager_item _text variable
          if (isset($result->node_data_field_pager_item_text_field_pager_item_text_value)) {
            $pager_items[$key1]['text'] =  check_plain($result->node_data_field_pager_item_text_field_pager_item_text_value);
          }
        }
      }
    }
    $vars['ddblock_pager_items'] = $pager_items;
  }    
}

Comments

ppblaauw’s picture

Version: 6.x-1.0-beta » 6.x-1.0-rc6
Category: bug » support
Status: Active » Closed (duplicate)

You are using the preprocess functions and maybe also the template files of the new development version of the ddblock module. They are not compatible with version RC6 of the ddblock module.

You can download the files for the RC6 version of the module at http://ddbock.myalbums.biz/download

Please continue the issue at http://drupal.org/node/587436.

I will set this one to duplicate.