captions gallery/image slider

Permalink
I've bought the image-slider block, which for anyone is is considering it is well worth it.

I'm trying to add captions to the images, a bit like you can in the gallery block but so far not had too much luck as this is most i've ever tried to edit a block (usually i stick to what i can do making templates from the view.php)

It may be naieve but basically what i have been doing is carefully pulling every mention of the 'caption' element from in the gallery block (in db.xml, image_row_include.php and controller.php)

I've been partially successful – the correct line has been added to the table in the db, and the field has been added to the form in add form. But when i actually click "add" i get the following error

Fatal error: Uncaught exception 'ADODB_Exception' with message 'mysql error: [-9999: Input Array does not match ?: INSERT INTO btImageSliderImg (bID,fID,url,position,caption) values (92,26,'ss',0,] in Execute(, ) ' in /Applications/MAMP/htdocs/website/concrete/libraries/3rdparty/adodb/adodb-exceptions.inc.php:78 Stack trace: #0 /Applications/MAMP/htdocs/website/concrete/libraries/3rdparty/adodb/adodb.inc.php(611): adodb_throw('mysql', 'Execute', -9999, 'Input Array doe...', '', false, Object(ADODB_mysql)) #1 /Applications/MAMP/htdocs/website/concrete/libraries/3rdparty/adodb/adodb.inc.php(994): ADOConnection->outp_throw('Input Array doe...', 'Execute') #2 /Applications/MAMP/htdocs/website/concrete/libraries/3rdparty/adodb/adodb.inc.php(766): ADOConnection->Execute('INSERT INTO btI...', Array) #3 [internal function]: ADOConnection->Query('INSERT INTO btI...', Array) #4 /Applications/MAMP/htdocs/website/concrete/libraries/database.php(73): call_user_func_array(Array, Array) #5 [internal function]: Database->_ in /Applications/MAMP/htdocs/website/concrete/libraries/3rdparty/adodb/adodb-exceptions.inc.php on line 78



The error seems to have come in to play when i started editing this part of the code in the controller.php

//loop through and add the images
         $pos=0;
         foreach($data['imgFIDs'] as $imgFID){ 
            if(intval($imgFID)==0 || $data['fileNames'][$pos]=='tempFilename') continue; 
            $vals = array(intval($this->bID),intval($imgFID), trim($data['url'][$pos]),$pos); trim($data['caption'][$pos]);trim($data['caption'][$pos]);
            $this->db->query("INSERT INTO btImageSliderImg 
            (bID,fID,url,position,caption) 
            values (?,?,?,?,?)",$vals);
            $pos++;
         }


Any help would be greatly appreciated, hopefully adding even more flexibility to this great block.

olay