The code would be more efficient (although it barely makes a dent really) by using a case structure or an if then else type structure, which would set the variable to a given value only once with any given Activity value.
Is that real production code? Where can I find it?
I am not a programmer, but this code looked so weird and inefficient to me, so I was just wondering if it was just an example, or it is possible to actually look at the production code of the forum.