Code Duplication    Length = 7-8 lines in 2 locations

class/online.php 2 locations

@@ 40-46 (lines=7) @@
37
     */
38
    public function init($forum = null, $forumtopic = null)
39
    {
40
        if (is_object($forum)) {
41
            $this->forum_id     = $forum->getVar('forum_id');
42
            $this->forumObject = $forum;
43
        } else {
44
            $this->forum_id     = (int)$forum;
45
            $this->forumObject = $forum;
46
        }
47
        if (is_object($forumtopic)) {
48
            $this->topic_id = $forumtopic->getVar('topic_id');
49
            if (empty($this->forum_id)) {
@@ 47-54 (lines=8) @@
44
            $this->forum_id     = (int)$forum;
45
            $this->forumObject = $forum;
46
        }
47
        if (is_object($forumtopic)) {
48
            $this->topic_id = $forumtopic->getVar('topic_id');
49
            if (empty($this->forum_id)) {
50
                $this->forum_id = $forumtopic->getVar('forum_id');
51
            }
52
        } else {
53
            $this->topic_id = (int)$forumtopic;
54
        }
55
56
        $this->update();
57
    }