elite_prodigy Posted November 23, 2008 Share Posted November 23, 2008 I know this question has more than likely been asked a thousand times, but how does phpBB use tags like: <if S_USER_IS_LOGGE_IN> If I could create variables and things like this in PHP it would make developement so much easier but I can't figure it out. I tried searching, but to be honest I have no idea what to search for! Any help would be appreciated, and thanks for your patience with me. Quote Link to comment https://forums.phpfreaks.com/topic/133886-how-does-phpbb-use-those-odd-tags/ Share on other sites More sharing options...
wildteen88 Posted November 23, 2008 Share Posted November 23, 2008 I expect it is part of phpBB's template engine. For something similar look into smarty Quote Link to comment https://forums.phpfreaks.com/topic/133886-how-does-phpbb-use-those-odd-tags/#findComment-696992 Share on other sites More sharing options...
corbin Posted November 23, 2008 Share Posted November 23, 2008 If you want to code it your self (although I would probably just use Smarty, unless you need something more lightweight), then you could just code something that parses those statements. IE: preg_replace('~<if([^>]+)>(.*?)</if>~me', 'HandleIf("$1", "$2");', $content); function HandleIf($condition, $do) { //somehow check the condition if(it's true) { return $do; } else { //you would want to either return nothing here, or more likely you would want to handle else clauses. } } Quote Link to comment https://forums.phpfreaks.com/topic/133886-how-does-phpbb-use-those-odd-tags/#findComment-697040 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.