1. Publiс function. No "public static" -> public function forumstyles( $forum ) { ... }
2. no type declaration on function variable
3. in template you must add param to function -> {{if $forum->forumstyle( $forum->name )}} - for example.
if ( \IPS\Settings::i()->forumstyle == 'style2' AND in_array( $forum, explode(',', \IPS\Settings::i()->fs_forums)) ) - this you can insert directly into the template, no hook needed
{{if \IPS\Settings::i()->forumstyle == 'style2' AND in_array( $forum->id(or what?), explode(',', \IPS\Settings::i()->fs_forums)) }} - i don't know what is stored in\IPS\Settings::i()->fs_forums...
\IPS\Settings::i()->fs_forums - array of ID, you must use $forum->id