Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I don't have it working. I've attached a .jpg with screenshots of what I've done. I'm not sure I'm allowing the embeddings correctly. Any assistance will be greatly appreciated.
Comment | File | Size | Author |
---|---|---|---|
fading_slideshow_support.jpg | 187.08 KB | cjschott2 |
Comments
Comment #1
cjschott2 CreditAttribution: cjschott2 commentedNothing needs to be done with the .js file - that should be made clear in the documentation
Comment #3
arielberg CreditAttribution: arielberg commented/*
maybe this would help:
(
global $base_path;
foreach ($files as $file) {
$file = preg_replace('/^\.\//', '/'.$base_path.'/', $file);
part has changed).
*/
<?php
/**
* Implementation of hook_menu().
*/
function fade_slideshow_menu($may_cache) {
global $user;
$items = array();
if ($may_cache) {
$items[] = array(
'path' => 'admin/settings/fade_slideshow',
'title' => t('Fading Slideshow'),
'description' => t('Configure Fading Slideshows.'),
'callback' => 'drupal_get_form',
'callback arguments' => 'fade_slideshow_settings',
'access' => user_access('administer site configuration'),
'type' => MENU_NORMAL_ITEM);
}
return $items;
}
/**
* Implementation of hook_settings().
*/
function fade_slideshow_settings() {
$form = array();
$form['fade_slideshow_instructions'] = array(
'#value' => '
',
'#weight' => -99
);
$number_of_slideshows = 6;
$i = 1;
while ($i <= $number_of_slideshows) {
$collapsed = false;
if ($i > 1) $collapsed = true;
$form['fade_slideshow_ss' . $i] = array(
'#type' => 'fieldset',
'#title' => t('Slideshow ' . $i . ' settings'),
'#collapsible' => true,
'#collapsed' => $collapsed,
);
$form['fade_slideshow_ss' . $i]['instructions'] = array(
'#type' => 'fieldset',
'#title' => t(''),
'#collapsible' => false
);
$form['fade_slideshow_ss' . $i]['instructions']['instructions'] = array(
'#value' => '
<?php print fade_slideshow_show(' . $i . '); ?>
',
'#weight' => -99
);
$form['fade_slideshow_ss' . $i]['fade_slideshow_image_dir_ss' . $i] = array(
"#type" => "textfield",
"#title" => "Image directory",
"#field_prefix" => t( "/files/" ),
"#size" => 70,
"#description" => t( "Directory where the source images for this slideshow are located." ),
"#default_value" => variable_get( "fade_slideshow_image_dir_ss" . $i, 'slideshow_images/'),
);
$form['fade_slideshow_ss' . $i]['fade_slideshow_width_ss' . $i] = array(
"#type" => "textfield",
"#title" => "Width",
"#size" => 4,
"#description" => t( "Set it to accommodate the largest image within the slideshow" ),
"#default_value" => variable_get( "fade_slideshow_width_ss" . $i, ''),
);
$form['fade_slideshow_ss' . $i]['fade_slideshow_height_ss' . $i] = array(
"#type" => "textfield",
"#title" => "Height",
"#size" => 4,
"#description" => t( "Set it to accommodate the largest image within the slideshow" ),
"#default_value" => variable_get( "fade_slideshow_height_ss" . $i, ''),
);
//$form['fade_slideshow_ss' . $i]['fade_slideshow_borderwidth_ss' . $i] = array(
// "#type" => "textfield",
// "#title" => "Border width",
// "#size" => 2,
// "#description" => t( "Width of border of the slideshow" ),
// "#default_value" => variable_get( "fade_slideshow_borderwidth_ss" . $i, '0'),
//);
$form['fade_slideshow_ss' . $i]['fade_slideshow_delay_ss' . $i] = array(
"#type" => "textfield",
"#title" => "Delay",
"#size" => 2,
"#description" => t( "Number of seconds delay between each image change." ),
"#default_value" => variable_get( "fade_slideshow_delay_ss" . $i, '3'),
);
$form['fade_slideshow_ss' . $i]['fade_slideshow_pause_ss' . $i] = array(
'#type' => 'radios',
'#title' => t('Pause on mouseover'),
'#default_value' => variable_get('fade_slideshow_pause_ss' . $i, 1),
'#options' => array(t('Disabled'), t('Enabled')),
'#description' => t('Enabeling this option will make the slideshow pause when the mouse is hovering over the image.'),
);
$form['fade_slideshow_ss' . $i]['fade_slideshow_random_ss' . $i] = array(
'#type' => 'radios',
'#title' => t('Random'),
'#default_value' => variable_get('fade_slideshow_random_ss' . $i, 1),
'#options' => array(t('Disabled'), t('Enabled')),
'#description' => t('Enabeling this option will show the images in random order.'),
);
$i++;
}
return system_settings_form($form);
}
function fade_slideshow_show($show) {
require_once('./'. drupal_get_path('module', 'fade_slideshow') .'/fade_slideshow.js.inc');
return theme('fade_slideshow_show', $show);;
}
function theme_fade_slideshow_show($show) {
$width = variable_get( "fade_slideshow_width_ss" . $show, '');
$height = variable_get( "fade_slideshow_height_ss" . $show, '');
$border = variable_get( "fade_slideshow_borderwidth_ss" . $show, '0');
$delay = variable_get( "fade_slideshow_delay_ss" . $show, '3') * 1000;
$pause = variable_get('fade_slideshow_pause_ss' . $show, 1);
$random = variable_get('fade_slideshow_random_ss' . $show, 1) ? 'R' : '';
$files = _fade_slideshow_explore_dir('.' . $base_path . '/files/' . variable_get( "fade_slideshow_image_dir_ss" . $show, 'slideshow_images/') . '/');
$js = '
$js .= ' '; $js .= 'var fade_images_' . $show . '=new Array();'; $cnt = 0; global $base_path; foreach ($files as $file) { $file = preg_replace('/^\.\//', '/'.$base_path.'/', $file); $js .= 'fade_images_' . $show . '[' . $cnt . ']=["/' . $file . '", "", ""];'; $cnt++; } if ($random == 'R') { $js .= 'new fadeshow(fade_images_' . $show . ', ' . $width . ', ' . $height . ', ' . $border . ', ' . $delay . ', ' . $pause . ', "' . $random . '")'; } else { $js .= 'new fadeshow(fade_images_' . $show . ', ' . $width . ', ' . $height . ', ' . $border . ', ' . $delay . ', ' . $pause . ')'; } $js .= '
';
$js .= '
';
return $js;
}
function _fade_slideshow_explore_dir($path = '', $recursive = FALSE) {
// A list of image extensions. It should be on lower and
// upper cases to work on non GNU systems, like Solaris and Windows
$exts = array('png', 'gif', 'jpeg', 'jpg', 'bmp', 'PNG', 'GIF', 'JPEG', 'JPG', 'BMP');
// Get all files from a given path
$files = array();
foreach ($exts as $ext) {
$files = array_merge($files, glob("$path*.$ext"));
}
// If its a recursive scan, enter in all directories
// and scan for more image files
if ($dirs = glob("$path*", GLOB_ONLYDIR) and !empty($recursive)) {
foreach ($dirs as $dir) {
$files = array_merge($files, _fade_slideshow_explore_dir("$dir/"));
}
}
return $files;
}
Comment #4
RachelR-1 CreditAttribution: RachelR-1 commentedwould probably help a hell of a lot more if you told us what to do with it... I'm just saying. Anyhoo, I have a similar problem I think. The whole thing just doesn't show up - does anyone actually know how to use this or is it now defunct like so many others?
Perhaps I should add that the code straight from DD works in a blank document outside Drupal, but cannot be hardcoded into the page template nor does the module seem to show anything in the pages although when viewing the source it appears to be there.
Comment #5
RachelR-1 CreditAttribution: RachelR-1 commentedCan't figure it out - is it still a working module? Is it possible to get some decent instructions on this?
Comment #6
halftone CreditAttribution: halftone commentedI spent days trying to get this working too. As you say, the page code seemed OK, but no image display resulted. Consigned to the great dustbin of Drupal until someone cleverer than me fixes it. Which is unlikely as all the clever people have charged ahead to newer versions of Drupal.
Comment #7
jpowell CreditAttribution: jpowell commentedThe docs indicate that it works with v1.51 of the DynamicDrive Javascript, but the download on the site is now v2.1. There may be an incompatibility between the JS and the module.
Comment #8
drudancer CreditAttribution: drudancer commentedThe following procedure works with Drupal 6.16 and dynamic drive’s ultimate fade-in slideshow(v2.1). I also got this to work with Drupal 5.22
Create a folder named fade on your pc. Install node++ or some other text editor on your pc.
Create a files folder on the same level as includes, misc, modules, profiles, scripts, sites and themes
on your Drupal website.
Step 1
Go to
http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm
Locate the javascript for fade-in slideshow version 2.1
Step 2
/*********************************************** * Ultimate Fade In Slideshow v2.0- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com) * This notice MUST stay intact for legal use * Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more ….. And paste it into a file in a folder called fade that you’ve created on your pc. I called my file fadhd.js. Step 3 Click on fadeslideshow.js, which is part of the 1 external file and 3 images referred to in the page. Copy the code and paste it into a file on your pc called fadeslideshow.js Right click on the 3 graphic images, x.png, restore.png, loading.gif, one by one and save them to the folder called fade somewhere on your pc Step 4 Review the files you should have in your folder. They are fadhd.js, fadeslideshow.js, x.png, restore.png, loading.gif. Step 5 Go to: http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js and download the file jquery.min.js to your folder named fade Step 6 Open fadhd.js in a text editor. I use notepad++. Delete these two lines: Step 7 Delete these two lines Which occur after the /*********************************************** * Ultimate Fade In Slideshow v2.0- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com) Explanation. Step 8 Go to the end of the file fadhd.js and eliminate the last lineCopy the code that the page indicates should go into the head of the html document
</script>
SAVE the file. You shouldn’t have any<script>
or</script>
statements. Step 9 Upload the folder fade to the files folder on your Drupal 6.16 installation. Step 10 Go to a page in your drupal content where you want the slideshow, open it, and make sure php code is checked and saved under input format. I used the fckeditor. I had problems with the tiny mce editor which converted the<?php to <- -
Step 11 On your page, click on the source button in the FCK editor, then enter the following code: SAVE the page. Step 12 The code in step 11 will show only the first slideshow. If you want the second slideshow, just put in the rest of the code. Step 13 You might get an error trying to show only one slideshow. In the file fadhd.js, The code, Needs to be replaced with To allow the first slideshow to run without error. With this change the second slideshow will not run. Step 14 Content of the slideshow. You need to open fadhd.js and look at line 12 which should sayvar mygallery=new fadeSlideShow({
Then below that it should say: This content needs to be modified to show images from a file and folder of your choosing.Comment #9
apadernoI am closing this issue, since it's for a Drupal version no longer supported.