if ($network == $null) { return CHATSPACE }
why use that? wouldn't it be easier to just do
if (!$network) { return CHATSPACE }
:P