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 1 - Line: 1415 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1370 fetch_forum_permissions
/printthread.php 76 forum_permissions
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
Cannot view image in html export - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1)
+--- Forum: API (https://forums.formtools.org/forumdisplay.php?fid=17)
+--- Thread: Cannot view image in html export (/showthread.php?tid=121)



Cannot view image in html export - scaphis - Apr 14th, 2009

I can view the lightbox image when I edit the submission and click on the file name, however I can only view the file name when exporting html.

also a related subject:
I very much need to know where to edit the format of the html export page. I have looked in the module- Export Manager and found this line commented in the start of the php:

"It calls the export.tpl found in the /modules/export_manager/templates folder."

However I found no such file: export.tpl

I have also looked for a way to do this using the api, however that documentation is apparently incomplete:

http://modules.formtools.org/export_manager/documentation.php?page=advanced_usage

I hope you are not to busy to assist. You were very helpful before...


RE: Cannot view image in html export - Ben - Apr 15th, 2009

Quote:I can view the lightbox image when I edit the submission and click on the file name, however I can only view the file name when exporting html.

Yes, by default, the HTML / Printer-friendly content (defined by the Export Manager) just links to the files - not embeds them in the page. But it's not too tricky to tweak - everything in the HTML generated pages can be edited so you can make them look however you want.

Just so we're on the same page: the Export Manager handles the actual HTML generation. So to edit it, go to Modules -> Export Manager -> select the HTML / Printer-friendly format -> click on the "Export Types" tab. Here, it lists the three Smarty templates which are used to generate the three.

That's the bit you'll need to edit.

Here's a quick example. I've modified the "Table format" export type to handle displaying files a little differently. Specifically, it assumes that all file fields are IMAGE fields (if this isn't the case for all your forms, let me know and I'll explain how to tweak it to only display the image for specific file fields).

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

<table cellpadding="2" cellspacing="0" width="100%" class="print_table">
{* display the column headings *}
<tr>
  {foreach from=$display_fields item=column name=row}
    <th>{$column.field_title}</th>
  {/foreach}
</tr>

{* loop through all submissions in this current result set, and display each item in a manner
   appropriate to the field type *}
{foreach from=$submissions item=submission name=row}
  <tr>
    {foreach from=$display_fields item=field name=col_row}
      {assign var=field_id value=$field.field_id}
      {assign var=field_type value=$field.field_info.field_type}
      {assign var=col_name value=$field.col_name}
      {assign var=value value=$submission.$col_name}

      <td>
        {if $field_type == "select" || $field_type == "radio-buttons"}
          {smart_display_field_values field_id=$field_id selected=$value}
        {elseif $field_type == "checkboxes" || $field_type == "multi-select"}
          {smart_display_field_values field_id=$field_id selected=$value multiple=true}
        {elseif $field_type == "file"}      
          <img src="{$field.field_info.settings.file_upload_url}/{$value}" />        
        {elseif $field_type == "system"}
          {if $col_name == "submission_id"}
            {$submission.submission_id}
          {elseif $col_name == "submission_date"}
            {$submission.submission_date|custom_format_date:$timezone_offset:$date_format}
          {elseif $col_name == "last_modified_date"}
            {$submission.last_modified_date|custom_format_date:$timezone_offset:$date_format}
          {elseif $col_name == "ip_address"}
            {$submission.ip_address}
          {/if}
        {else}
          {$value}
        {/if}
      </td>

    {/foreach}
  </tr>
{/foreach}
</table>


The new lines that I added are:


Code:
{elseif $field_type == "file"}      
          <img src="{$field.field_info.settings.file_upload_url}/{$value}" />

Does this help at all? Let me know if you need help tweaking the other templates or anything else. I confess that this functionality IS more heavily geared towards programmers than end-users, unlike other aspects of the software. But ultimately I thought it was important to provide as much functionality as possible, hence the added complexity.

Quote:I very much need to know where to edit the format of the html export page. I have looked in the module- Export Manager and found this line commented in the start of the php:

"It calls the export.tpl found in the /modules/export_manager/templates folder."

However I found no such file: export.tpl

Nope! Wow, that comment is VERY out of date. Smile I'll have to find & remove it. The actual HTML is generated via the Export Manager UI, as mentioned above.

Quote:I have also looked for a way to do this using the api, however that documentation is apparently incomplete

Ah, thanks for this. I'll update that page right now. Smile

Hope the above helps a bit...!


RE: Cannot view image in html export - scaphis - Apr 15th, 2009

[quote='Ben' pid='502' dateline='1239841185']
[quote]
Hope the above helps a bit...!
[/quote]

As always Ben, your advice is invaluable. Thanks.

Yes, my files are all image files, so this should do the trick. Can you apply a template to the html output page?

Just curious...
[quote='scaphis' pid='503' dateline='1239842438']
[quote='Ben' pid='502' dateline='1239841185']
[quote]
Hope the above helps a bit...!
[/quote]

Ok- just got it to work, uploaded my logo as a test, but the link was broken at first so I had to right click and see what it was referencing. It was looking for the image in my root, even though I have specified in settings>files to look in the formtools/upload folder. When I changed these settings to my root the image became visible once I re-uploaded it. I would rather not keep all of my images in the root folder, as not to become a cluttered mess.

I am sure you know how to fix this when I would spend hours trying.

Thanks Ben!


RE: Cannot view image in html export - rootsys6 - Feb 19th, 2015

that the block of PHP you're included appears BENEATH the opening <html> tags. It should always appear at the very top of the page, before anything else.