Uploaded images on mobile

 
Douzeper
Benutzer
Avatar
Geschlecht:
Herkunft: Antrim, Northern Ireland
Alter: 55
Homepage: motorhomecraic.com
Beiträge: 555
Dabei seit: 10 / 2004
Betreff:

Uploaded images on mobile

 · 
Gepostet: 08.03.2017 - 21:08 Uhr  ·  #1
Chris,

Is there a way to show a thumbnail of uploaded images rather than it just leaving a link? people finding it frustrating to download and then view images on a phone.
OWS
Benutzer
Avatar
Geschlecht:
Herkunft: Niedersachsen
Homepage: oetjen-webservice.…
Beiträge: 305
Dabei seit: 03 / 2006
Betreff:

Re: Uploaded images on mobile

 · 
Gepostet: 08.03.2017 - 22:00 Uhr  ·  #2
Hi Ally.
I could provide you a quick and dirty fix until Chris fixes this issue maybe with the next update if he thinks it is necessary.

Open your topic.htm and search for:
Code
<td rowspan="5" class="cf-attach-preview-tbl uk-hidden-small"><div class="cf-attach-preview">{if $pd.system_attachment_output[atpout].a_prev && $pd.system_attachment_output[atpout].a_p_code != ''}{$pd.system_attachment_output[atpout].a_p_code}{else}<img src="upload/file_icons/{$pd.system_attachment_output[atpout].a_fimg}" alt="" title="" class="cf-attach-row-ficon" />{/if}</div></td>


Replace it with:
Code
<td rowspan="5" class="cf-attach-preview-tbl"><div class="cf-attach-preview">{if $pd.system_attachment_output[atpout].a_prev && $pd.system_attachment_output[atpout].a_p_code != ''}{$pd.system_attachment_output[atpout].a_p_code}{else}<img src="upload/file_icons/{$pd.system_attachment_output[atpout].a_fimg}" alt="" title="" class="cf-attach-row-ficon" />{/if}</div></td>


PS: Dont forget to make a backup of the original topic.htm
cback
Admin
Avatar
Geschlecht:
Herkunft: Saarland
Alter: 37
Homepage: cback.net
Beiträge: 17610
Dabei seit: 12 / 2003
Betreff:

Re: Uploaded images on mobile

 · 
Gepostet: 08.03.2017 - 22:03 Uhr  ·  #3
Hi Ally,

sure, just change the Attachment-Template to whatever you want it to look like. :)

Example:

OPEN: templates/mira/topic.htm (or the topic.htm from the template you use)

FIND:
Code

                        <tr>
                          <td rowspan="5" class="cf-attach-preview-tbl uk-hidden-small"><div class="cf-attach-preview">{if $pd.system_attachment_output[atpout].a_prev && $pd.system_attachment_output[atpout].a_p_code != ''}{$pd.system_attachment_output[atpout].a_p_code}{else}<img src="upload/file_icons/{$pd.system_attachment_output[atpout].a_fimg}" alt="" title="" class="cf-attach-row-ficon" />{/if}</div></td>
                          <td class="cf-attach-preview-inforow"><b>{$LANG.t_filename}:</b></td>
                          <td><a href="attachment_processor.{$EXT}?mode=download_file&amp;id={$pd.system_attachment_output[atpout].a_id}">{$pd.system_attachment_output[atpout].a_fname}</a><a href="attachment_processor.{$EXT}?mode=download_file&amp;id={$pd.system_attachment_output[atpout].a_id}" class="uk-float-right"><i class="cf-text-bigger uk-icon-justify uk-icon-cloud-download"></i></a></td>
                        </tr>


REPLACE WITH
Code

                        {if $pd.system_attachment_output[atpout].a_prev && $pd.system_attachment_output[atpout].a_p_code != ''}<tr><td colspan="3"><div class="uk-text-center">{$pd.system_attachment_output[atpout].a_p_code}</div></td></tr>{/if}
                        <tr>
                          <td rowspan="5" style="width:1px;"></td>
                          <td class="cf-attach-preview-inforow"><b>{$LANG.t_filename}:</b></td>
                          <td><a href="attachment_processor.{$EXT}?mode=download_file&amp;id={$pd.system_attachment_output[atpout].a_id}">{$pd.system_attachment_output[atpout].a_fname}</a><a href="attachment_processor.{$EXT}?mode=download_file&amp;id={$pd.system_attachment_output[atpout].a_id}" class="uk-float-right"><i class="cf-text-bigger uk-icon-justify uk-icon-cloud-download"></i></a></td>
                        </tr>



Change and style however you prefer it to be. ;)
This example will also prevent that your mobile phone will horizontally scroll the post-box.


Sincerely,
Chris



EDIT
Kenny was faster - but this will not be a fix: Since the Attachrow is very small on mobile the behaviour to open it in default in a new browser window via download link is a CF4 feature, no bug. ;) So this change is basically just personal preference. :) Smaller Images on the big row are also no more retina on big desktops since the image will mostly stretch to its full 100% width. :) So the default behaviour is no issue, the CF4 works there exactly how intended and tested. Beside that the CF4 Default behaviour will save your mobile users mobile bandwith (rare thing). That's why its done like this. ;) Sometimes Attachments are huge even though the CF4 makes thumbnail images out of it. But always gives users the decision wheather they want to download the attachment or not. That's why it was done like this. Bandwith and Screen-Size. ;) But if you prefer to display it always like the CF3 OVER the Table (saves space) just use my example and you're good to go. :)

So remember that change because it will not be integrated in the next update. ;)
Douzeper
Benutzer
Avatar
Geschlecht:
Herkunft: Antrim, Northern Ireland
Alter: 55
Homepage: motorhomecraic.com
Beiträge: 555
Dabei seit: 10 / 2004
Betreff:

Re: Uploaded images on mobile

 · 
Gepostet: 09.03.2017 - 11:16 Uhr  ·  #4
Many thanks for the help Kenny.

Chris, of course that worked a treat! thanks! :)

I think I prefer it with the change.
OWS
Benutzer
Avatar
Geschlecht:
Herkunft: Niedersachsen
Homepage: oetjen-webservice.…
Beiträge: 305
Dabei seit: 03 / 2006
Betreff:

Re: Uploaded images on mobile

 · 
Gepostet: 09.03.2017 - 12:55 Uhr  ·  #5
You`re welcome. :)
cback
Admin
Avatar
Geschlecht:
Herkunft: Saarland
Alter: 37
Homepage: cback.net
Beiträge: 17610
Dabei seit: 12 / 2003
Betreff:

Re: Uploaded images on mobile

 · 
Gepostet: 09.03.2017 - 13:40 Uhr  ·  #6
Douzeper
Benutzer
Avatar
Geschlecht:
Herkunft: Antrim, Northern Ireland
Alter: 55
Homepage: motorhomecraic.com
Beiträge: 555
Dabei seit: 10 / 2004
Betreff:

Re: Uploaded images on mobile

 · 
Gepostet: 21.09.2017 - 19:24 Uhr  ·  #7
cback
Admin
Avatar
Geschlecht:
Herkunft: Saarland
Alter: 37
Homepage: cback.net
Beiträge: 17610
Dabei seit: 12 / 2003
Betreff:

Re: Uploaded images on mobile

 · 
Gepostet: 21.09.2017 - 19:32 Uhr  ·  #8
Gewählte Zitate für Mehrfachzitierung:   0

Registrierte in diesem Topic

Aktuell kein registrierter in diesem Bereich

Die Statistik zeigt, wer in den letzten 5 Minuten online war. Erneuerung alle 90 Sekunden.