This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 2

Showing images on view_entry.php


  1. jwebdd
    Member

    I have a form set up for a modeling agency which has for image upload fields and what I would like so for those images to show above the download link. How can I do this?

    Posted 14 years ago #
  2. redityo

    You need to customize some machform files for this. Try to follow these steps :

    1. Edit "view-entry.php" file and go to line 48 for this code :

    $entry_details = get_entry_details($form_id,$entry_id);

    then replace the code with this one

    $options['display_attach_image'] = true;
    $entry_details = get_entry_details($form_id,$entry_id,$options);

    2. Edit "includes/entry-functions.php" file and go to around line 405 ~ 407. You'll see these code :

    if(!empty($options['show_attach_image'])){
    	$entry_details[$i]['value'] = '<img src="'.$options['machform_path'].'images/icons/attach.gif" align="absmiddle" />&nbsp;'.$filename_value;
    }

    then add these code exactly bellow that line

    if(!empty($options['display_attach_image'])){
    	$entry_details[$i]['value'] = '<img src="http'.$ssl_suffix.'://'. $_SERVER['HTTP_HOST'] .dirname($_SERVER['PHP_SELF']) .  '/data/form_' . $form_id . '/files/'.$entry_data['element_'.$element_id]  . '" /> <br />'
    								  . $entry_details[$i]['value'] ;
    }

    MachForm Support

    Posted 14 years ago #
  3. jwebdd
    Member

    Forget it. Couldn't see the images because of an issue with htaccess file. Problem solved. :-)

    Posted 14 years ago #
  4. jwebdd
    Member

    Now how can I exclude images from appearing when I print an entry? Anyone?

    Posted 14 years ago #
  5. yuniar

    Try to edit this file "machform/css/entry_print.css" and then add this code:

    img {
      display: none !important;
    }

    Then delete your browser cache and try to print again.


    MachForm Founder

    Posted 14 years ago #
  6. tundeogidi
    Member

    Hi,

    I tried the steps to show image files uploaded on Entries as stated above, but it is not displaying the attached image. I only have a placeholder with X displayed.

    How can I resolve this?

    Posted 14 years ago #
  7. yuniar

    Try to view the HTML source of your entry page, what is the path to the image?
    Is it pointing to the correct URL?


    MachForm Founder

    Posted 14 years ago #
  8. tundeogidi
    Member

    Hi,

    The HTML Source of the entry page display the path of the image as;

    http://sitedomain/data/form_1/files/element_7_ce065a33cebd5f2d9fc67ff2dd3dc377-5-big_img.jpg"

    big_img.jpg is the image name.

    Regards

    Posted 14 years ago #
  9. yuniar

    Do you have MachForm installed directly under your document root folder?
    If not, I think the path is missing your machform folder.

    It should be something like this:
    http://sitedomain/machform/data/form_1/files/element_7_ce065a33cebd5f2d9fc67ff2dd3dc377-5-big_img.jpg


    MachForm Founder

    Posted 14 years ago #
  10. tundeogidi
    Member

    Yes, you are right and it is like that but it still not showing.

    You can check it out if you want, i can send you all the required information, the site URL and admin details.

    The full path again is;

    src="http://www.thekingscourt.org.uk/mach/data/form_1/files/element_4_ef9c06522a0dbc02b842953270d4c6d0-1-Tunde.jpg" />
    <img src="images/icons/attach.gif" align="absmiddle" /> Tunde.jpg</td>

    The image name on this is Tunde.jpg

    Posted 14 years ago #
  11. yuniar

    Yes, please send me the admin details and URL.
    Also, send me the modified files, I'll check it.

    Please mail to: customer.service [at] appnitro.com


    MachForm Founder

    Posted 14 years ago #

RSS feed for this topic

Reply