if ($forum = 724166)
Surely, you mean == not = .
[edit]
Since you updated your question with the critical information, the answer is that you should be treating 724166, 2330 and so on as strings, not numbers. Wrap them in quotes so $forum becomes a string type, not a number.
[/edit]