Forums

Showing Image from table created by Chronoforms

ronijoven 07 Dec, 2009
I used Chronoform to create a form with file upload. The file upload is fine. I used chronoconnectivity to view and edit the form, however I need to show the image that was uploaded using the form i created.

I am a newbie, can anybody help me.

Thanks
GreyHead 07 Dec, 2009
Hi ronijoven,

If you have the image name in the database than you can call this up in ChronoConnectivity in the same way as any other value. You then need to turn this into a URL that will link to the image and use the url in an img tag.

Here's an example (this also sets s default photo if one hasn't been uploaded)
<?php
$photo = $MyRow->photo;
if ( !$photo ) {
  $photo = 'no_photo.gif';
}
$photo = JURI::Base().'components/com_chronocontact/uploads/form_name/'.$photo;
?>
. . .
<td class='picture'><img src='<?php echo $photo; ?>' /></td>

Bob
remrom 11 Dec, 2009
Hi Bob..

I put the code in my for but a get an error like this "Parse error: parse error in com_chronoconnectivity\libraries\connection.php(303) : eval()'d code on line 6"

Then i check my code and the line 6 is $photo = JURI::Base()'components/com_chronocontact/uploads/Ingreso_Personal/'.$photo;

i think that a changed the parameters, or am i wrong?

thank you
GreyHead 12 Dec, 2009
Hi remron,

There's a . missing in line 6 after JURI::base() - I went back and fixed my earlier post.

Bob
ronijoven 04 Jan, 2010
Bob,
Thanks for the reply, I am new in chronoforms, and I am confused about the "MyRow->photo".

is the MyRow an lias of the recordset, is this built in literal to refer to the current table assigned in chronoform? Is there a code to set the MyRow that i need to include in the code? Please help me, thanks in advance.

Also is is possible to call the thumbnail creation function in virtuemart in chronoforms?

Regards

Roni
GreyHead 04 Jan, 2010
Hi Roni,

$MyRow is the object that ChronoForms creates to hold the row data.

I've no idea about the Virturemart photo thumbnailer - you can create them with the ChronoForms Image Resize plugin though (you need a fixed version from the forums here).

Bob
This topic is locked and no more replies can be posted.