How do they do it...

Discussion in 'PHP' started by trixs, Aug 6, 2007.

  1. #1
    Hey Everyone,

    Just so you know I am frustrated.. Ive been working on a site and finally decided to take a look at phpbb - Well I noticed something I didnt know was possible. It is also keeping me from blending phpbb with my webpage.

    Heres an example of what I mean:

    In phpbb overall_header.tpl we have lots of this:
    <title>{SITENAME} :: {PAGE_TITLE}</title>

    now, of course the objective here is to give the page a title..
    My question is how? How does it know to run PAGE_TITLE or SITENAME --- I really dont get this at all. I always thought you had to echo any type of output.

    Anyway, i cant find anything about htis on the web and am lost :(

    Also.. Anyone knwo what TPL file standsfor and how it its embedded?
     
    trixs, Aug 6, 2007 IP
  2. Triexa

    Triexa Active Member

    Messages:
    580
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #2
    It's templating. I think they use their own template system...

    Basically in the PHP file(s) that process that template, they have a value assigned to SITENAME and PAGE_TITLE and then the template engine processes those in the page prior to displaying it...
     
    Triexa, Aug 6, 2007 IP
  3. trixs

    trixs Peon

    Messages:
    111
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I see..

    Which basically means in cant really integrate my own code unless I completely backeng what they did..

    Oh joy oh joy, this is going to be a pain. Maybe ill just desing my own forum; probably be easier lol.
     
    trixs, Aug 6, 2007 IP
  4. trixs

    trixs Peon

    Messages:
    111
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Out of curiousity I would think a template would be slower than embedding php..? True?
     
    trixs, Aug 6, 2007 IP
  5. Barpro

    Barpro Active Member

    Messages:
    219
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    58
    #5
    can i ask what php program that you are using. I am looking for the best one right now. Phpfox looks tempting? What do yoou guys think?
     
    Barpro, Aug 6, 2007 IP
  6. Triexa

    Triexa Active Member

    Messages:
    580
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #6
    Basically, yes. But the good/major ones are quite optimized and most create a "cache" which basically converts it to PHP code anyways, so the difference is quite negligible.
     
    Triexa, Aug 6, 2007 IP
  7. gwkg

    gwkg Peon

    Messages:
    143
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #7
    smarty.php.net is an excellent templating system and easy to learn.

    Beginning PHP5 and MySQL E-Commerce is an excellent book for a beginner to learn about object oriented programming with PHP and smarty templates.
     
    gwkg, Aug 6, 2007 IP
  8. gwkg

    gwkg Peon

    Messages:
    143
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Heres some info on the phpBB templating system

    hxxp://www.phpbb.com/kb/article/phpbb2-template-tutorial/

    and a forum for phpBB template questions

    hxxp://www.phpbbhacks.com/forums/phpbb-2-templates-and-graphics-support-vf15.html
     
    gwkg, Aug 6, 2007 IP