/** * Determine the icon for a topic */ public function topicIcon($topic) { $img = 'topic'; if ($this->topicIsRead($topic->id)) { $img .= '2'; } else { $img .= '1'; } if ($topic->global) { $img .= 'g'; } if ($topic->sticky) { $img .= 's'; } if (YBoardPoll::find()->where(['post_id' => $topic->first_post_id])->one()) { $img .= 'p'; } if ($topic->locked) { $img .= 'l'; } return $img; }