Forums » Support

advanced editing

mariano
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:
$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');
then after line 1059 I've added:


$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)

ceeb
UNITED STATES
2008-05-11 19:54:21
 

I'm glad you're working with Cabel's FancyZoom plugin. I've been working on that too but have been too busy with other stuff to get anywhere with it.

Vaska
I WROTE THIS
2008-05-12 07:06:50
 

Why do you need these extra parameters? They are already stored in the ndxz_media table...or you could simply extract the values when the exhibit plugin executes (getimagesize). These, if I understand it correctly, are really not necessary.

The problem with this is you will be unable to upgrade your system...

FancyZoom will appear as the new version is rolled out. I think we're going to replace Thickbox with Shadowbox.

mariano
UNITED STATES
2008-05-12 15:34:59
 

you are right about the upgrade incompatibility Vaska, I didn't thought about that -

how does getmagesize work with Flash movies? that's the only reason why I need these extra paramaters, otherwise the SWFs are not displayed correctly

I'm going to experiment more with the Files Manager, maybe I can get input all the parameters I need from here and I won't need to call getimagesize.

Vaska
I WROTE THIS
2008-05-12 16:07:10
 

You have to upload Flash files via the Files Manager. Once it's uploaded you can edit the info about the file and add the dimensions.

Vaska
I WROTE THIS
2008-05-12 16:08:11
 

And v0.75 does read the file size of the Flash file as well...

mariano
UNITED STATES
2008-05-12 17:34:04
 

I've just solved it replacing LIghtbox with Shadowbox: Lightbox needs two separate fields for width & height respectively, while Shadowbox passes these in just one line:


rel="shadowbox;width=400;height=300"

so I just placed them in the Image Caption field and... presto!

it'd be great to have both FancyZoom & Shadowbox integrated with the next indexhibit release, I think GUIs running under current web standards can't get much more advanced and intuitive than these.

Showing 1 - 7 of 7 posts in Forum > Support > advanced editing
 

You need to be logged in to post.