Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
  1. #1
    Junior Member
    Join Date
    Nov 2002
    Posts
    5
    Member #
    300
    ...is there between using PHP's built-in templating (i.e. <HTML code><?php doSomething();?></HTML code>) and summoning templates from a MySQL database and eval()ing them (such as in vBulletin)?

    The reason I ask is I'm writing a bulletin board based on PHP but I want to be able to have the option to set it into a minimal load mode, e.g. no view counts, longer post flood limit, and no templating, but I was wondering if it was possible to have a big enough gain in performance by using the PHP templating system to warrant bothering trying to use it, or if I should just go for making a mysql-stored template system like vB.

  2.  

  3. #2
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    eval'ing always takes a relatively long time. If you want pure performance, hard-coding is best.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  4. #3
    Junior Member
    Join Date
    Nov 2002
    Posts
    5
    Member #
    300
    Is there an efficient way to fall back to the hard-coded defaults if the user has not specified a custom template for a specific page?

  5. #4
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    Not really; the problem would be that in order to pick between the two you'd still have to fetch the custom one and compare it with the default one.

    What you can do is set some sort of array of flags for changed templates and then iterate through them, picking hard-coded and custom templates where appropriate.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  6. #5
    Junior Member
    Join Date
    Nov 2002
    Posts
    5
    Member #
    300
    OK, Thanks



Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 10:20 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com