UNITED STATES
2008-05-11 19:51:14
I'm working on a lightbox plug-in which requires some extra parameters in order to run properly, so I'm trying to add 2 more input fields ('Image Width' & 'Image Height'), to the already existant fields for each image ('Image Title' & 'Image Caption').
here's what I'm doing:
- opened the MySQL database used by indexhibit and created 2 more fields after the 'media_caption' field, following its same settings, and naming them: 'media_width' & 'media_height' respectively.
- opened ndxz-studio/module/exhibits/index.php and after line 510 I've added:
then after line 1059 I've added:
$body .= ips($this->lang->word('image width'), 'input', 'media_width',
$rs['media_width'], "id='media_width' maxlength='1000'", 'text');
$body .= ips($this->lang->word('image height'), 'input', 'media_height',
$rs['media_height'], "id='media_height' maxlength='1000'", 'text');
$clean['media_width'] = $processor->process('media_width', array('nophp'));
$clean['media_height'] = $processor->process('media_height', array('nophp'));
and finally, after line 1452:
$clean['media_width'] = ($_POST['x'] == '') ? '' : utf8Urldecode($_POST['x']);
$clean['media_height'] = ($_POST['x'] == '') ? '' : utf8Urldecode($_POST['x']);
after doing this, the 2 new input fields do show up on the exhibit page when I click on the 'Edit' button for each image. I fill these fileds and click 'Update', but somehow the values are not being saved on the database, leaving both fields empty the next time I click on 'Edit'.
my knowledge of PHP & MySQL is rather limited, so I'm probably missing some basic steps here, or maybe this really is more complex than what I think...
the plug-ins run beautifully on indexhibit's plattform and I'd love to see them fully functional. here's a couple examples I'm currently testing on my website:
Lightbox Example (original code by Chris Campbell)
Zoom Example (original code by Cabel Sasser)
