Skip to main content
Topic: Post Icons (Read 3066 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Post Icons

Hello!

My error log was empty during the last days... ;) I think, now I know the reason:

A few days ago I deleted a post icon, wich I had uploaded in themes/default /images/post. This icon was shown in the first post of a topic and in the board, but not in "action=unread".

All the errors I had in forum were just about this icon, as I believe now. Every time if someone was going to read or to write in this topic or was collapsing the category with this topic, there was an error in the log.

Today - after the patch - I have tried to upload this post icon again. First again in themes/default/images/post, and the same errors in forum were shown. Then I tried themes/mytheme /images/post, but it was not possible to manage this icon in ACP - custom post icons must always be in default, as I believe?

Re: Post Icons

Reply #1

What is the error exactly? (It may be worth a fix. ;))

You can manage icons in the admin panel only if they are in the default theme, but then you need a copy of the same icon in your theme.
In other words you need the icons in any theme you have.
Bugs creator.
Features destroyer.
Template killer.

Re: Post Icons

Reply #2

I didn't know, that  the post icons must be uploaded in both files, emanuele... :-[
(I hope that smileys will work in my theme, if they are only in default? We have got thousands of smileys.)

I have tried to upload this post icon again, now it is in both files and I could manage it in the admin panel, without an error.

But it is still not displayed in "action recent". There are a lot of errors in the log, they all look like this:

Quote Art des Fehlers: Undefiniert
Undefined index:
http://ea.XXX.de/index.php?action=unread
Datei: /var/www/XXX/html/ea/sources/controllers/Recent.controller.php
Zeile: 1054

The same error is shown on line 1054, 1038, 1020

Re: Post Icons

Reply #3

Quote from: Ruth – I didn't know, that  the post icons must be uploaded in both files, emanuele... :-[
It may be I just said something stupid looking at the wrong code, but I can't check again.

Quote from: Ruth – (I hope that smileys will work in my theme, if they are only in default? We have got thousands of smileys.)
Smiley are not even in the themes directory. ;)

Quote from: Ruth – But it is still not displayed in "action recent". There are a lot of errors in the log, they all look like this:

Quote Art des Fehlers: Undefiniert
Undefined index:
http://ea.XXX.de/index.php?action=unread
Datei: /var/www/XXX/html/ea/sources/controllers/Recent.controller.php
Zeile: 1054

The same error is shown on line 1054, 1038, 1020
I'll check it.
Bugs creator.
Features destroyer.
Template killer.

Re: Post Icons

Reply #4

There are the same errors if  the forum is in default and I don't use my theme.

Re: Post Icons

Reply #5

How "serious" are those errors about the icons, emanuele? Can I ignore them?

I can manage this icons if I upload them in both files and those icons are shown everywhere in forum and portal - they are just not displayed in action=unread and in action=unreadreplies. I think, nobody will notice  this - except me. ;)
Last Edit: October 07, 2014, 07:23:53 pm by Ruth

Re: Post Icons

Reply #6

Errors can always be ignored. :P
They are annoying, though.

I think it is a bug.

In Recent.controller.php, find:
Code: [Select]
			// We need to check the topic icons exist... you can never be too sure!
if (!empty($modSettings['messageIconChecks_enable']))
{
// First icon first... as you'd expect.
if (!isset($context['icon_sources'][$row['first_icon']]))
$context['icon_sources'][$row['first_icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['first_icon'] . '.png') ? 'images_url' : 'default_images_url';

// Last icon... last... duh.
if (!isset($context['icon_sources'][$row['last_icon']]))
$context['icon_sources'][$row['last_icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['last_icon'] . '.png') ? 'images_url' : 'default_images_url';
}

and add immediately after:
Code: [Select]
			else
{
if (!isset($context['icon_sources'][$row['first_icon']]))
$context['icon_sources'][$row['first_icon']] = 'images_url';

if (!isset($context['icon_sources'][$row['last_icon']]))
$context['icon_sources'][$row['last_icon']] = 'images_url';
}

It should do the trick.

If it works, please let us know, so that it can be pushed to 1.0.2. ;)
Bugs creator.
Features destroyer.
Template killer.

Re: Post Icons

Reply #7

Thank you very much, emanuele... :) It works perfect...no errors in the log and the icons are now everywhere to see.

But they must be uploaded in both post-files.

Re: Post Icons

Reply #8

Tracked:
https://github.com/elkarte/Elkarte/issues/1862

Quote from: Ruth – But they must be uploaded in both post-files.
Yes, there is an hidden setting if you really want to have them only in one, but in general it's good habit to have images in each theme. ;)
Bugs creator.
Features destroyer.
Template killer.