![]() |
|
Article Options |
Merge into $show
Michael Morris
Join Date: Nov 2003
Posts: 774
Employee of Digital Media Graphix of Knoxville TN, currently developing a new framework / CMS Knoxville TN
by
![]() 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...
And so on. After you initialize them, you can then assign their values. Changing the $bbuserinfo over into them - that's a lesson for another time (this is supposed to be a "quick tip") ![]() No members have liked this post.
Last edited by Xenon; 30 Oct 2004 at 14:04.. Reason: closing tag was missing |
||||
Views: 2195
|
Comments |
#2
|
||||||||
|
||||||||
I do this to, but as so to prevent some mess:
Also everyone should be aware that array_merge changed in php version 5:
![]() No members have liked this post.
|
![]() |
«
Previous Article
|
Next Article
»
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Article Options | |
|
|
New To Site? | Need Help? |
All times are GMT. The time now is 09:47.