The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 909 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
Print photos - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Modules / Other (https://forums.formtools.org/forumdisplay.php?fid=8)
+--- Forum: Modules (https://forums.formtools.org/forumdisplay.php?fid=16)
+--- Thread: Print photos (/showthread.php?tid=1618)



Print photos - valch - Sep 13th, 2011

I need to print uploaded photos.
When i open submission to print, now we saw only uploaded photos names. It is possible to change smarty printing template to print out photos with other submissons data?


RE: Print photos - Ben - Sep 19th, 2011

Hi Valch,

Sorry for the wait.

Yes, it is possible - but it'll require a bit of programming. You'll need to output that URL within an <img src="..." /> tag, instead of just outputting the single value. I don't suppose you have a programming stashed away in a closet somewhere that you'd have access to...? Wink

- Ben




RE: Print photos - valch - Sep 21st, 2011

(Sep 19th, 2011, 12:42 PM)Ben Wrote: Hi Valch,

Sorry for the wait.

Yes, it is possible - but it'll require a bit of programming. You'll need to output that URL within an <img src="..." /> tag, instead of just outputting the single value. I don't suppose you have a programming stashed away in a closet somewhere that you'd have access to...? Wink

- Ben

Thanks for replay, may be you can help with this code programming. It's be a helpfully resource for others. On forum I saw that many peoples asking this question, but no ideas, concreate answer... how...

Create new export type, but how look smarty template for printing images.It's a question...


RE: Print photos - valch - Sep 26th, 2011

BEN please help with smarty template code...


RE: Print photos - Ben - Sep 27th, 2011

Hi Valch,

Sorry for the wait!

To output an image as an actual image instead of just the URL/filename, you'll need something like this. I made it as simple as possible. This is based on the "table format" HTML/Printer-friendly Export Type.

Code:
<h1>{$form_name} - {$view_name}</h1>

<table cellpadding="2" cellspacing="0" width="100%" class="print_table">
<tr>
  {foreach from=$display_fields item=column}
    <th>{$column.field_title}</th>
  {/foreach}
</tr>
{strip}
{foreach from=$submissions item=submission}
  {assign var=submission_id value=$submission.submission_id}
  <tr>
    {foreach from=$display_fields item=field_info}
      {assign var=col_name value=$field_info.col_name}
      {assign var=value value=$submission.$col_name}
      <td>
        {if $field_info.field_name == "field2"}
          <img src="http://www.yoursite.com/folder/{$value}" />
        {else}
          {smart_display_field form_id=$form_id view_id=$view_id
            submission_id=$submission_id field_info=$field_info
            field_types=$field_types settings=$settings value=$value}
        {/if}
      </td>
    {/foreach}
  </tr>
{/foreach}
{/strip}
</table>

The important bit is this:
Code:
{if $field_info.field_name == "field2"}
          <img src="http://www.yoursite.com/folder/{$value}" />
        {else}
          {smart_display_field form_id=$form_id view_id=$view_id
            submission_id=$submission_id field_info=$field_info
            field_types=$field_types settings=$settings value=$value}
        {/if}

That looks at the current field name. If it's "field2" (which here, contains the image field - you will need to change that to whatever field name your image field(s) have).

You'll also need to update the URL to the file as well.

Hope this helps -

Ben



RE: Print photos - valch - Sep 30th, 2011

Thanks Ben, it's work. Only small thing - i have a 4 photo fields. Near the photos we see also photo names fotoname.jpg., only near the last photo image name are not showing. I think that is small correction, but i don't know how. For better understand I add a photo .

And second thing - how can we change the pront friendly code for printing only concrete,fixed colums with data. On one export type i want this option. (i have a database with 25 colums, but for printing wont to 1, 2, 4, 5 column).

A big thanks


RE: Print photos - Ben - Oct 2nd, 2011

Hi Valch,

Quote:Only small thing - i have a 4 photo fields. Near the photos we see also photo names fotoname.jpg., only near the last photo image name are not showing. I think that is small correction, but i don't know how. For better understand I add a photo.

To display the photo name as well as the image, you just need to add a {$value} after the <img /> tag. I don't quite follow though, you've done that, but it doesn't display for the final image?

Quote:And second thing - how can we change the pront friendly code for printing only concrete,fixed colums with data. On one export type i want this option. (i have a database with 25 colums, but for printing wont to 1, 2, 4, 5 column).

Good question! The Export Manager is designed to work dynamically: it always exports whatever content is found in the form View that you're currently using. You actually can't tell it to always export the same group of fields for every View.

The only way around this that I can think of is to create a totally new Export Group, then add your Export Type to that. Lastly, change the permissions on the Export Group so that it only shows for the View(s) that you want.

Sorry I couldn't be more help!

- Ben




RE: Print photos - valch - Oct 3rd, 2011

(Oct 2nd, 2011, 10:51 AM)Ben Wrote: Hi Valch,

Quote:Only small thing - i have a 4 photo fields. Near the photos we see also photo names fotoname.jpg., only near the last photo image name are not showing. I think that is small correction, but i don't know how. For better understand I add a photo.

To display the photo name as well as the image, you just need to add a {$value} after the <img /> tag. I don't quite follow though, you've done that, but it doesn't display for the final image?

Quote:And second thing - how can we change the pront friendly code for printing only concrete,fixed colums with data. On one export type i want this option. (i have a database with 25 colums, but for printing wont to 1, 2, 4, 5 column).

Good question! The Export Manager is designed to work dynamically: it always exports whatever content is found in the form View that you're currently using. You actually can't tell it to always export the same group of fields for every View.

The only way around this that I can think of is to create a totally new Export Group, then add your Export Type to that. Lastly, change the permissions on the Export Group so that it only shows for the View(s) that you want.

Sorry I couldn't be more help!

- Ben

On first question i think we don't understand each other. I would like to that the field names (photonames foto.jpg) are not showing like on last photo field. On the first till third field - field names are showing How i can remove this one.