Jump to content

How does phpBB use those odd tags?


elite_prodigy

Recommended Posts

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.

Link to comment
Share on other sites

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.

    }

}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.