MyBB Community Forums

Full Version: Issue with postbit_attachments_images_image
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I'm running 1.8.22 with a Swedish language version that I've translated partly from the English version myself.

When attaching an image date and time are not displayed in English, but it's displayed in Swedish. In the Swedish version it shows " /> after the time.

The html-code in Firefox looks like this:

English
<!-- start: postbit_attachments_images_image -->
<img src="attachment.php?aid=295" class="attachment" alt="" title="Filename: 20200427_130343.jpg
Size: 3,68 MBToday, 00:04">
&nbsp;&nbsp;&nbsp;
<!-- end: postbit_attachments_images_image -->

Swedish
<!-- start: postbit_attachments_images_image -->
<img src="attachment.php?aid=295" class="attachment" alt="" title="Filnamn: 20200427_130343.jpg
Storlek: 3,68 MB<span title=" {1}"="">
Idag, 00:04" /&gt;&nbsp;&nbsp;&nbsp;
<!-- end: postbit_attachments_images_image -->

As far I can see, the language variables are the same between the following two language files: global.lang.php and showthread.lang.php.

I believe the date and time should be shown in the English version, which it doesn't do, and the characters (" />) after the time in the Swedish version should not be shown.

What could be the cause of this strange behaviour?
Could you please paste the content of template postbit_attachments_images_image of your theme/template?

The default one should say:
<img src="attachment.php?aid={$attachment['aid']}" class="attachment" alt="" title="{$lang->postbit_attachment_filename} {$attachment['filename']}
{$lang->postbit_attachment_size} {$attachment['filesize']}
{$attachdate}" />&nbsp;&nbsp;&nbsp;

If it's OK, will you please run a File verification at AdminCP > Tools & Maintenance ?
Edit: noyle's reply was faster Smile

which theme you are using ?

Also, check for below language variables in global.lang.php file
$l['today_rel'] = "<span title=\"{1}\">Today</span>";
$l['yesterday_rel'] = "<span title=\"{1}\">Yesterday</span>";
$l['today'] = "Today";
$l['yesterday'] = "Yesterday";

Also, run file verification tool from below location. what does it report ?
forum admin panel >> tools & maintenance >> file verification

ignore reported images & ignore files reported from install folder & its sub-folders

(edited)
(2020-04-28, 06:05 AM).m. Wrote: [ -> ]Also, check for below language variables in global.lang.php file
$l['today_rel'] = "<span title=\"{1}\">Today</span>";
$l['yesterday_rel'] = "<span title=\"{1}\">Yesterday</span>";
$l['today'] = "Today";
$l['yesterday'] = "Yesterday";

I guess @.m. should be right.

Probably OP has removed the backslash from some language entries when editing language files, resulting in for example $l['today_rel'] = "<span title="{1}">Today</span>.

Sorry, I had been wrong. The issues should lie in $l['today'] = "Today"; and $l['yesterday'] = "Yesterday";.
(2020-04-28, 06:05 AM).m. Wrote: [ -> ]Edit: noyle's reply was faster Smile

which theme you are using ?

Also, check for below language variables in global.lang.php file
$l['today_rel'] = "<span title=\"{1}\">Today</span>";
$l['yesterday_rel'] = "<span title=\"{1}\">Yesterday</span>";
$l['today'] = "Today";
$l['yesterday'] = "Yesterday";

Also, run file verification tool from below location. what does it report ?
forum admin panel >> tools & maintenance >> file verification

ignore reported images & ignore files reported from install folder & its sub-folders

(edited)

There was an issue with the content of the two variables: $l['today'] and $l['yesterday'], which I have missed when updating the Swedish language files.
$l['today_rel'] = "<span title=\"{1}\">Idag</span>";
$l['yesterday_rel'] = "<span title=\"{1}\">Igår</span>";
$l['today'] = "<span title=\"{1}\">Idag</span>";
$l['yesterday'] = "<span title=\"{1}\">Igår</span>";

Now they're changed to:

$l['today_rel'] = "<span title=\"{1}\">Idag</span>";
$l['yesterday_rel'] = "<span title=\"{1}\">Igår</span>";
$l['today'] = "Idag";
$l['yesterday'] = "Igår";

That correspond with the variables in the English language files:

$l['today_rel'] = "<span title=\"{1}\">Today</span>";
$l['yesterday_rel'] = "<span title=\"{1}\">Yesterday</span>";
$l['today'] = "Today";
$l['yesterday'] = "Yesterday";

Now there're no difference between how the two languages display, but there's still i problem. The date and time doesn't show.

It seam that the "> comes in the wrong place. This is what the code looks like in the browser:

<!-- start: postbit_attachments_images_image -->
<img src="attachment.php?aid=295" class="attachment" alt="" title="Filnamn: 20200427_130343.jpg
Storlek: 3,68 MBIdag, 00:04">
&nbsp;&nbsp;&nbsp;
<!-- end: postbit_attachments_images_image -->
	

This doesn't look right:

<img src="attachment.php?aid=295" class="attachment" alt="" title="Filnamn: 20200427_130343.jpg 
Storlek: 3,68 MBIdag, 00:04">

I believe it should look like this instead:
<img src="attachment.php?aid=295" class="attachment" alt="" title="Filnamn: 20200427_130343.jpg 
Storlek: 3,68 MB">Idag, 00:04
^ have you run files verification ? what does it report ?
(2020-04-28, 06:03 AM)noyle Wrote: [ -> ]Could you please paste the content of template postbit_attachments_images_image of your theme/template?

The default one should say:
<img src="attachment.php?aid={$attachment['aid']}" class="attachment" alt="" title="{$lang->postbit_attachment_filename} {$attachment['filename']}
{$lang->postbit_attachment_size} {$attachment['filesize']}
{$attachdate}" />&nbsp;&nbsp;&nbsp;

If it's OK, will you please run a File verification at AdminCP > Tools & Maintenance ?

My postbit_attachments_images_image theme/template is identical to the one above.

<img src="attachment.php?aid={$attachment['aid']}" class="attachment" alt="" title="{$lang->postbit_attachment_filename} {$attachment['filename']}
{$lang->postbit_attachment_size} {$attachment['filesize']}
{$attachdate}" />&nbsp;&nbsp;&nbsp;

I have run the File verification and all files were right. The only thing I've done since then is to change search.php, and the global.lang.php in both Swedish and English to change from to show "Today's posts" to "Week's posts".

I just run the File Verification again and now it shows changes in functions.php and functions_post.php. I will upload clean versions of these files and run the File Verification again.

Now it's just search.php and english/global.lang.php that come up as being changed. The problem that the date and time not being displayed remains.
(2020-04-28, 11:44 AM)Sokrates Wrote: [ -> ]This doesn't look right:

<img src="attachment.php?aid=295" class="attachment" alt="" title="Filnamn: 20200427_130343.jpg 
Storlek: 3,68 MBIdag, 00:04">

I believe it should look like this instead:
<img src="attachment.php?aid=295" class="attachment" alt="" title="Filnamn: 20200427_130343.jpg 
Storlek: 3,68 MB">Idag, 00:04

No, it should be like:

<img src="attachment.php?aid=295" class="attachment" alt="" title="Filnamn: 20200427_130343.jpg
Storlek: 3,68 MB
Idag, 00:04" />

Just be careful they're three lines.

If you've reverted$l['today'] and $l['yesterday'] to their original forms, then I think the page should output correctly.

Would you mind checking the template postbit_attachments_images_image once again? If you're in doubt, could you please PM me with an account with AdminCP permissions for me to check?
(2020-04-28, 12:11 PM)noyle Wrote: [ -> ]No, it should be like:

<img src="attachment.php?aid=295" class="attachment" alt="" title="Filnamn: 20200427_130343.jpg
Storlek: 3,68 MB
Idag, 00:04" />

Just be careful they're three lines.

If you've reverted$l['today'] and $l['yesterday'] to their original forms, then I think the page should output correctly.

Would you mind checking the template postbit_attachments_images_image once again? If you're in doubt, could you please PM me with an account with AdminCP permissions for me to check?

I've uploaded fresh files of even those that I've changed, so now the File Verification doesn't shoe any corrupt files. Still the Date and Time below the attachment doesn't show, neither in the English or Swedish language versions. The code in the browser is the same:

<img src="attachment.php?aid=295" class="attachment" alt="" title="Filnamn: 20200427_130343.jpg
Storlek: 3,68 MB
Idag, 00:04">

Maybe, I'm wrong that the Date and Time should show below the attachement, as it did earlier in MyBB.

I'm not particularly keen to let anyone in with AdminCP permissions. Here is a link to a post with an attachment of a photo of a sailing-boat. One has to register though to view the attachment: 

https://campingforum.net/showthread.php?tid=855&page=7
probably there is a misunderstanding based on earlier experience.
title tag content is shown on hovering over it.
Pages: 1 2