Hi Geraint,
I've coded the stuff including the random image chosen from a bank of images in case event has no image. Actually I had to force the directory name. It could be a feature of interest for your future developments.
But I have lost the animation because I could not make it work. So I deleted the script and the buttons to clean up.
It now shows a static carousel - horizontal - of 4 images next to each other. I would like a horizontal scroll <=> a page scroll = 4 images at a time.
<?php
/**
* JEvents Component for Joomla!
*
* @version $Id: mod_jevents_slideshow.php 3309 2012-03-01 10:07:50Z geraintedwards $
* @package JEvents
* @subpackage Module Slideshow JEvents
* @copyright Copyright (C) 2006-2014 GWE Systems Ltd
* @license GNU/GPLv2, see
http://www.gnu.org/licenses/gpl-2.0.html
* @link
http://www.jevents.net
*/
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die();
/**
* HTML View class for the module frontend
*
* @static
*/
/** CaDe **/
include_once(JPATH_SITE . "/modules/mod_jevents_latest/tmpl/default/latest.php"

;
class OverrideDefaultModSlideshowViewCade extends DefaultModLatestView {
public function displaySlideshowEvents() {
$cfg = JEVConfig::getInstance();
$compname = JEV_COM_COMPONENT;
$dispatcher = JDispatcher::getInstance();
$datenow = JEVHelper::getNow();
$eventcounted = array();
$this->getLatestEventsData();
$content = "";
$hasEventsWithImages = false;
$moduleclass_sfx = htmlspecialchars($this->modparams->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8');
// create array with images, to be used in case of no image contained in events
// the folder has to have the same name as the one created by the jevent file pluggin, when specifing width and height sizes
$folder = 'images/cade/jevents/300x150';
$type = 'jpg';
$files = array();
$images = array();
$dir = JPATH_BASE . '/' . $folder;
// Check if directory exists
if (is_dir($dir)) {
if ($handle = opendir($dir)) {
while (false !== ($file = readdir($handle))) {
if ($file != '.' && $file != '..' && $file != 'CVS' && $file != 'index.html') {
$files[] = $file;
}
}
}
closedir($handle);
$i = 0;
foreach ($files as $img) {
if (!is_dir($dir . '/' . $img)) {
if (preg_match('/' . $type . '/', $img)) {
//$dayEvent->_imageurl1=$img;
$i++;
}
}
}
}
if (isset($this->eventsByRelDay) && count($this->eventsByRelDay)) {
//$this->customFormatStr = '<div class="item active">${imageimg1}<div class="carousel-caption">${title}</div></div>';
// only the first should be active!!
// !!! The customFormatStr comes from the module !!!
//$this->customFormatStr = $this->modparams->get('modlatest_CustFmtStr', '<div class="item ISACTIVE"><a href="${eventDetailLink}" target="_self">${imageimg1}</a><div class="carousel-caption">${title}<span class="jevcstart"><a href="${eventDetailLink}" target="_self">${startDate(%e %b %Y)}</a></span></div></div>');
$this->processFormatString();
JHtml::_('bootstrap.carousel', 'jevlatestcarousel', array('interval' => $this->modparams->get('sldelay', 500), 'pause' => 'hover'));
JHTML::stylesheet("modules/mod_jevents_slideshow/css/mod_jevents_slideshow.css"

;
JHTML::stylesheet("modules/mod_jevents_slideshow/css/custom.css"

;
//JFactory::getDocument()->addScript("//
http://ajax.googleapis.com/ajax/libs/jquerymobile/1.4.2/jquery.mobile.min.js"

;
ob_start();
?>
<div class="jevcarousel hidden-xs hidden-sm row <?php echo $moduleclass_sfx; ?>">
<div id="jevlatestcarousel" class="carousel slide jevlatest jevlatestcarousel" data-ride="carousel">
<?php
$count = 0;
foreach ($this->eventsByRelDay as $relDay => $daysEvents) {
// get all of the events for this day
foreach ($daysEvents as $dayEvent) {
$alreadycounted=false;
if (!isset($dayEvent->_imageurl1) || $dayEvent->_imageurl1 == '') {
// no image in event -> we will associate an image from the image bank
foreach ($eventcounted as $eventtitle){
if ($eventtitle==$dayEvent->_title){
$alreadycounted=true;
}
}
if ($alreadycounted){
continue;
}
// select a random image
$i = count($files);
$random = mt_rand(0, $i - 1);
$dayEvent->_imageurl1= $files[$random];
}
if (!$alreadycounted){
$eventcounted[]=$dayEvent->_title;
}
$hasEventsWithImages = true;
?>
<?php
$count++;
}
}
?>
<div class="carousel-inner">
<?php
$firstfour = true;
$imgcount=0;
foreach ($this->eventsByRelDay as $relDay => $daysEvents) {
reset($daysEvents);
// get all of the events for this day
foreach ($daysEvents as $dayEvent) {
if (!isset($dayEvent->_imageurl1) || $dayEvent->_imageurl1 == ""

{
continue;
}
$html = "";
$dayEvent->_title=mb_strimwidth($dayEvent->_title, 0, 80, "..."

;
switch ($dayEvent->_catid) {
case 10:
$cat = "Category 1";
break;
case 11:
$cat = "Category 2";
break;
case 15:
$cat = "Category 3";
break;
}
// generate output according custom string
foreach ($this->splitCustomFormat as $condtoken) {
if (isset($condtoken['cond'])) {
if ($condtoken['cond'] == 'a' && !$dayEvent->alldayevent())
continue;
else if ($condtoken['cond'] == '!a' && $dayEvent->alldayevent())
continue;
else if ($condtoken['cond'] == 'e' && !($dayEvent->noendtime() || $dayEvent->alldayevent()))
continue;
else if ($condtoken['cond'] == '!e' && ($dayEvent->noendtime() || $dayEvent->alldayevent()))
continue;
else if ($condtoken['cond'] == '!m' && $dayEvent->getUnixStartDate() != $dayEvent->getUnixEndDate())
continue;
else if ($condtoken['cond'] == 'm' && $dayEvent->getUnixStartDate() == $dayEvent->getUnixEndDate())
continue;
}
foreach ($condtoken['data'] as $token) {
// The customFormatStr comes from the module - ISACTIVE is in th string of the module in menu extensions->module...
if (is_string($token) && strpos($token, "ISACTIVE"

) {
if ($firstfour) {
$token = str_replace("ISACTIVE", "active", $token);
$imgcount++;
if ($imgcount==4):
$firstfour = false;
$imgcount=0;
endif;
} else {
$token = str_replace("ISACTIVE", "", $token);
}
}
unset($match);
unset($dateParm);
$dateParm = "";
$match = '';
if (is_array($token)) {
$match = $token['keyword'];
$dateParm = isset($token['dateParm']) ? trim($token['dateParm']) : "";
} else if (strpos($token, '${') !== false) {
$match = $token;
} else {
$html .= $token;
continue;
}
$this->processMatch($html, $match, $dayEvent, $dateParm, $relDay);
}
}
echo $html;
}
}
?>
</div>
</div>
</div>
<?php
$content = ob_get_clean();
if (!$hasEventsWithImages) {
$content = "";
}
}
if ($this->modparams->get('modlatest_NoEvents', 0) == 1 && !$hasEventsWithImages) {
$content = JText::_('JEV_SLIDE_LATEST_NO_EVENTS');
}
return $content;
}
}