Page 1 of 1

Why is the Icon of Subforum not visible?

Posted: Fri Dec 14, 2018 4:37 pm
by cryptoevo.de
I use a bought theme, and when I set a Icon it is only visible for the Forumtest1 and Testforum2 shows a listing dot/circle instead.
Bildschirmfoto 2018-12-13 um 16.18.09.png
The coder of the theme said that changes had to be made in to core phpBB for that.
Why can I then give a path for a icon when its not shown?
Bildschirmfoto 2018-12-13 um 16.23.17.png
The test environment: www.bnn.ooo

Re: Why is the Icon of Subforum not visible?

Posted: Fri Dec 14, 2018 4:38 pm
by KevC
You would need to ask the person you bought the style from.

Re: Why is the Icon of Subforum not visible?

Posted: Fri Dec 14, 2018 6:18 pm
by cryptoevo.de
KevC wrote:
Fri Dec 14, 2018 4:38 pm
You would need to ask the person you bought the style from.
Hey KevC :)

Erm, with the term coder I meant the guy who wrote the code of the theme, here specially he is also coincidentally the seller.
So i asked him already.

And he claimed that he would need to change phpBB core for it and that i should ask here around.

But I already thought, if the icon works for the "mother"-forum than it should be nearly the same code for the subform?

Re: Why is the Icon of Subforum not visible?

Posted: Fri Dec 14, 2018 8:22 pm
by stevemaury
We have no idea what phpBB core edits might be required to make his style work as you wish, since we know nothing about his style. If he knows that edits are required, he should know what those edits are.

Re: Why is the Icon of Subforum not visible?

Posted: Sat Dec 15, 2018 11:51 am
by cryptoevo.de
stevemaury wrote:
Fri Dec 14, 2018 8:22 pm
We have no idea what phpBB core edits might be required to make his style work as you wish, since we know nothing about his style. If he knows that edits are required, he should know what those edits are.
Isn't there like a conventional way for "requesting" the icon?
I mean like there must be a usual way for that?
Because in the back panel i can set an Icon therefore, there must be a conventional way to ask for the icon...

Re: Why is the Icon of Subforum not visible?

Posted: Sat Dec 15, 2018 11:56 am
by david63
cryptoevo.de wrote:
Sat Dec 15, 2018 11:51 am
Isn't there like a conventional way for "requesting" the icon?
As you have found out - yes there is but if the style developer does not respect that method then there is nothing that we can do here. This is one of the downsides of using styles that have not been approved in the CDB.

Re: Why is the Icon of Subforum not visible?

Posted: Sat Dec 15, 2018 12:07 pm
by cryptoevo.de
david63 wrote:
Sat Dec 15, 2018 11:56 am
cryptoevo.de wrote:
Sat Dec 15, 2018 11:51 am
Isn't there like a conventional way for "requesting" the icon?
As you have found out - yes there is but if the style developer does not respect that method then there is nothing that we can do here. This is one of the downsides of using styles that have not been approved in the CDB.
Dude, why are everybody concentrating what one individual have done... when I ask in generell how it has to be done?
It doesn't matter how he has implemented it ("wrong")... what matters is what has to be done in generell to get that work done guys...
I can talk the whole day about why something is not working, but this is waste of time... instead focus on how it has to be done right.

I can't code at all, but I can in theory i understand the logics at least.
None of your posts helped me really in anyway, I want to know what he has to do or if his claim that it is caused by phpBB core is true...

SO i searched trough some random open source template and found that line.

Code: Select all

<!-- IF forumrow.FORUM_IMAGE --><span class="forum-image">{forumrow.FORUM_IMAGE}</span>
https://github.com/bpiec/we_clearblue/b ... y.html#L45

This seems like the snipped or "convention" i talk of, i am sure there is no big way around then some stupid hardcoded paths or other shit you talk of.

Isn't it enough to paste that line somewhere {forumrow.FORUM_IMAGE} or something similar to see the icon of the subform?

Re: Why is the Icon of Subforum not visible?

Posted: Sat Dec 15, 2018 12:43 pm
by battye
EDIT: Update at viewtopic.php?p=15153621#p15153621
cryptoevo.de wrote:
Fri Dec 14, 2018 4:37 pm
Why can I then give a path for a icon when its not shown?
Bildschirmfoto 2018-12-13 um 16.23.17.png
The test environment: www.bnn.ooo
Because at https://bnn.ooo/viewforum.php?f=4 - see, Testforum2 has the icon there :)

AFAIK there is no "conventional" way to get a forum icon appearing in that little list of subforums because a) it would look really out of place; and b) there is not that much space there (eg. there's no subforum descriptions or anything like that either - just the name of the subforum).

I don't recommend this because we've moved away from hard-coded changes and do things with extensions now - to make updating easier, and so nobody has to make manual edits to the code any more. But I don't want you to leave empty handed either because what you are asking is possible with some small tweaks - as you said the code for forums and subforums isn't hugely different.

I haven't tested this, so this is more of a point in the right direction so you can see what is required to get something like this working. Perhaps this will help the person who designed your style inform you of your options as well, with regard to the style they have made. :)

Basically, it would be something like this. Open includes/functions_display.php

find: $subforums[$parent_id][$forum_id]['type'] = $row['forum_type'];
after add: $subforums[$parent_id][$forum_id]['forum_image'] = $row['forum_image'];

find:

Code: Select all

					$subforums_list[] = array(
						'link'		=> append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $subforum_id),
						'name'		=> $subforum_row['name'],
						'unread'	=> $subforum_unread,
						'type'		=> $subforum_row['type'],
					);
on the line above 'link', add: 'forum_image' => $subforum_row['forum_image'],

find:

Code: Select all

			$subforums_row[] = array(
				'U_SUBFORUM'	=> $subforum['link'],
				'SUBFORUM_NAME'	=> $subforum['name'],
				'S_UNREAD'		=> $subforum['unread'],
				'IS_LINK'		=> $subforum['type'] == FORUM_LINK,
			);
on the line above U_SUBFORUM, add: 'U_SUBFORUM_IMAGE' => $subforum['forum_image'],

Then in forumlist_body.html your designer should then be able to access the forum image with {forumrow.subforum.U_SUBFORUM_IMAGE}

Re: Why is the Icon of Subforum not visible?

Posted: Sat Dec 15, 2018 3:17 pm
by Mannix_
If you are asking for the way to display forum images set in acp for subforum on index page, it is possible to do without touching the core files of phpbb it just few edits to the template file. But it would require to have subforum name and the forum image of that subforum to be the same to make it work.

Re: Why is the Icon of Subforum not visible?

Posted: Sat Dec 15, 2018 4:49 pm
by battye
I'm putting together a small extension that will show subforum images on the index page, cryptoevo.de.
If you give me another day or so I'll have something that you can use on your forum without making any code changes at all.
ch5.png
ch5.png (8.92 KiB) Viewed 441 times

Re: Why is the Icon of Subforum not visible?

Posted: Sun Dec 16, 2018 8:29 am
by battye
Extension in Development viewtopic.php?f=456&t=2495511

Re: Why is the Icon of Subforum not visible?

Posted: Sun Dec 16, 2018 4:45 pm
by Mick
Nice one!