Hi guys,

I am sitting here trying to understand some PHP code that was written in a website I have to maintain, but I can't figure out what the author has done and there is no documentation for it. I hope some of you can help me on this one:

Rather than using a normal include() function, the author has used lines like this:

{:include_template_CBS standardA.tpl}

And also in some of the files he seems to be using the "{}" to insert other code elements:

<td width="140" height="22" valign="middle" background="{url_image_rmitBG_bl}" rowspan="2">&nbsp;

Would be great if somebody could put me onto the right track with this one!

Thanks

    What you're looking at is probably a template file. A template file is not a PHP file; it's a file that is parsed by a PHP script in order to get the final version of a page.
    More than likely, the author's used a script that replaces instances of, for example, {variable} with the value of $variable. Also, the {:include_template_CBS standardA.tpl} is probably a way of including files using the template system.

      Hi Python,

      you are right. I just noticed that it is PHPLib that is being used as a template system. I haven't worked with it before, but the online documentation seems quite alright.

      The only thing I can't figure out, and maybe somebody else knows how to solve it, is why non of my changes I make to any of the *.tpl files come up on the website?

      Here an example:

      I have got a file called shortcourses.php3 with the following line:

      include_template_CBS("shortcoursesM.tpl");

      shortcoursesM.tpl has got a bit of HTML and a few more template {variables}. If I make any changes to the HTML (for the sake of testing I just changed the content text), and view "shortcourses.php3" on the server, none of the changes are being recognised.

      If I add content to shortcourses.php3 itself, they show up on the server. Only the *.tpl changes are remaining unnoticed.

      I know this sounds as if I am editing the incorrect file, but I searched everywhere and there is only this one "shortcoursesM.tpl".

      I can't understand why this is happening? Is there any setting on the server or an issue with template files that I might not have considered?

      Thanks heaps!

        Write a Reply...