News:

Wondering if this will always be free?  See why free is better.

Main Menu

Error in /Themes/default/Display.template.php

Started by Rattler, June 10, 2011, 09:31:57 AM

Previous topic - Next topic

Rattler

I have an annoying error in my forum (SMF version 1.1.13, http://www.warandtactics.com/smf/index.php) that has to do with the "last edit" and manifests itself in the Display template.

The error does not seem to do much harm, but the daily 70 pages of error messages in the error log are annoying.

The repeated error msg  from my error log:

Quote
8: Uninitialized string offset: 0
File: /home/warandta/public_html/smf/Themes/default/Display.template.php
Line: 547

The line in question is contained in the following part of the code (2nd line):
// Show "« Last Edit: Time by Person »" if this post was edited.
if ($settings['show_modify'] && !empty($message['modified']['name']) && $message['member']['group']['id'] !=1)
echo '
&#171; <i>', $txt[211], ': ', $message['modified']['time'], ' ', $txt[525], ' ', $message['modified']['name'], !empty($message['modified']['edit_reason']) ? ', Reason: ' . $message['modified']['edit_reason'] : '' , '  </i> &#187;';

echo '
</td>
<td align="', !$context['right_to_left'] ? 'right' : 'left', '" valign="bottom" class="smalltext">';


The actual line is
if ($settings['show_modify'] && !empty($message['modified']['name']) && $message['member']['group']['id'] !=1)

I could not find the same problem described in any of the forums.

Anybody got an idea what might be causing this error?

The forum itself is heavily modded, but we carry this error for years and long before the mayority of our mods were installed. The only mod that influences this part of the display is the "Reason for edit" mod, but I cannot make any sensible connection that would explain the error, as none of the mentioned variables is changed and the only change in Display of this mode is as documented below (this is line 549):

Original code:
echo '
« <i>', $txt[211], ': ', $message['modified']['time'], ' ', $txt[525], ' ', $message['modified']['name'], '</i> »';


Replaced with modded code
echo '
« <i>', $txt[211], ': ', $message['modified']['time'], ' ', $txt[525], ' ', $message['modified']['name'], !empty($message['modified']['edit_reason']) ? ', Reason: ' . $message['modified']['edit_reason'] : '' , '  </i> »';


Thanks in advance for any help, especially as I did not find anything on the mod support page and am not sure it has to with it alltogether.

Rattler
You can discuss with people, and sometimes it even makes sense to do so. Forget that when confronted with the cruel facts of life... (inspired by SiGnature™).

impreza

Basic question, if you installed some fashion?
Portal ToTemat.pl - Filmy i Artykuły

Rattler

You can discuss with people, and sometimes it even makes sense to do so. Forget that when confronted with the cruel facts of life... (inspired by SiGnature™).

impreza

Portal ToTemat.pl - Filmy i Artykuły

Rattler

Quote from: tomeh on June 10, 2011, 02:33:19 PM
fashion? = modyfications (mod)

O I C.

Answered already in the original post (now highlighted) and with mod code that I am having suspicions about.

Anybody?

Rattler
You can discuss with people, and sometimes it even makes sense to do so. Forget that when confronted with the cruel facts of life... (inspired by SiGnature™).

Rattler

You can discuss with people, and sometimes it even makes sense to do so. Forget that when confronted with the cruel facts of life... (inspired by SiGnature™).

Joker™

I think you need to make these changes in the code

Code (Find:) Select
$message['member']['group']['id']


Code (Replace it with) Select
$message['member']['group_id']
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Rattler

Thanks.

Was away for some three month, willtry instantly.

Kind regards,

Rattler

Quote from: Joker™ on July 10, 2011, 07:48:54 AM
I think you need to make these changes in the code

Code (Find:) Select
$message['member']['group']['id']


Code (Replace it with) Select
$message['member']['group_id']
You can discuss with people, and sometimes it even makes sense to do so. Forget that when confronted with the cruel facts of life... (inspired by SiGnature™).

Angelina Belle

Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

Advertisement: