Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: moyack on August 15, 2016, 03:09:47 PM

Title: Where is defined "$context['class']"
Post by: moyack on August 15, 2016, 03:09:47 PM
Hi:

As the title says, I need to know in where php source file is defined this variable. This variable defines the icon for the kind of topic it is.
Title: Re: Where is defined "$context['class']"
Post by: Kindred on August 15, 2016, 03:20:31 PM
it depends where you are using it...

the icon is definitely defined in messageindex.template.php
but it may also be be defined in other palces that use the icon.

that variable is not filled unless a message or thread is being loade.d..
Title: Re: Where is defined "$context['class']"
Post by: moyack on August 16, 2016, 12:15:05 AM
Quote from: Kindred on August 15, 2016, 03:20:31 PM
it depends where you are using it...

the icon is definitely defined in messageindex.template.php
but it may also be be defined in other palces that use the icon.

that variable is not filled unless a message or thread is being loade.d..
I've checked that php file and the only way I see this variable array defined is in the $context['topic'] @messageindex.template.php is with the function "determineTopicClass($context['topics'][$row['id_topic']])".

Where is this function defined?

EDIT: it's found @subs.php.

Title: Re: Where is defined "$context['class']"
Post by: Kindred on August 16, 2016, 11:51:52 PM
Well, yes... But the contents change in nearly every source files as different pages are loaded.