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.
Hello guys , i made some modififiction i want to share with you but i dont know how to make a patch yet.
i worked on
; $Id: views_slideshow_imageflow.info,v 1.1.4.1 2010/04/16 16:59:58 aaron Exp $
i made a modification in file
theme/views_slideshow_imageflow.theme.inc
search for
/**
* We'll grab only the first image from each row.
*/
function template_preprocess_views_slideshow_imageflow(&$vars) {
// Initialize our $images array.
$vars['images'] = array();
// Strip all images from the $rows created by the original view query.
foreach($vars['rows'] as $item) {
and replace with
/**
* if postion is middle re order the first item to get it in middle
*/
function middle_reorder($array){
$array =array_reverse($array);
// newst always come last
$lastmodifier = sizeof($array)-1;
$middlemodifier= floor(sizeof($array)/2);
$newwArray=array();
// start check to build our new array order
for($i=0; $i<sizeof($array); $i++){
// if middle
if($i==0){
$newwArray[] = $array[$middlemodifier];
}
else
{
//if last
if($i==$middlemodifier){
$newwArray[] = $array[0];
}
else
{
$newwArray[] = $array[$i];
}
}
}// end loop
return $newwArray;
}
/**
* We'll grab only the first image from each row.
*/
function template_preprocess_views_slideshow_imageflow(&$vars) {
//print_r();
$postion =$vars['view']->display['default']->display_options['style_options']['views_slideshow_imageflow']['start'];
if($postion=='middle'){
$data = middle_reorder($vars['rows']);
}else{
$data =$vars['rows'];
}
// Initialize our $images array.
$vars['images'] = array();
//print_r($vars);
//print_r('<br>----------flow test---------<br>');
// Strip all images from the $rows created by the original view query.
foreach($data as $item) {
this modification will take the newest item comes from the views and make it the middle one in condition you chooses to view the images as middle case.
Comments
Comment #1
sabrawy CreditAttribution: sabrawy commentedi forgot some comment you can remove them if you want
like
also remove following i thought i'm doing a sort by date desc but i wasn't so i thought the array comes reversed so i reversed again then i notes i did't sort the result and default behavior is sorting ASC so please remove