The reason this doesnt work is because you have the syntax all wrong, you are missing curly brackets and when u are trying to match text/string to a variable you use double equals == for integers or eq for text.
I presume u want to set the nick name to the users name if it exists, if it doesn't set it to guest.
try
if ($user ne "") { $nick=$user; } else { $nick="Guest"; }
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.