Merge into $show
by
30 Oct 2004
Hello everyone - here's a quick tip: I'm fond of giving my users a lot of controllable options using user profile fields and then using the phpinclude start template to express those as $show conditionals. I do this because it makes the resultant stylesheets more portable - the user profile field in the $bbuserinfo almost certainly will change from server to server - and if you refer to the same condition multiple times it becomes a pain in the tail to move the style to a new setup. So I move the $bbuserinfo['fieldX'] stuff over to $show. The reason is that, like $bbuserinfo, $show is declared global in almost every function that deals with data display (the sole exception I know of is the function that parses subforums). You can also choose names for your show variables that are descriptive, which in turn makes your code easier for others to read. Initialize your custom $show variables in your phpinclude_start template like so... PHP Code:
$show = array_merge($show,
|