Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 12/21/2019 in all areas

  1. 1 point
    ecartz

    Someone firm with oscTemplate Class ?

    Zahid's suggestion is that you just put the modal template in a separate module. Then the separate module will only add the link once regardless. The only bad part is that the user has to enable that module separately. So it may be that sometimes they will forget. $_SESSION is not built every page load. It is explicitly for sharing between pages. If you want something that is built per page and dies at the end of the page, try a static variable. E.g. function load_template_if_necessary() { static $template_needs_loaded = true; if ($template_needs_loaded) { load_template(); $template_needs_loaded = false; } } Then load_template will get called at most once per page and you can call load_template_if_necessary as often as you want. But as Zahid pointed out, you could just as well do include_once 'load_template.php'; and get the same effect.
  2. 1 point
    JcMagpie

    Someone firm with oscTemplate Class ?

    Sorry maybe I misunderstood, perhaps you can supply more info or example of what you are trying to achive but.... If site owner is able to decide what is or is not loaded then simply seperate the scripts in question to hooks or header tags and explain these only need to be turned on if a box x is active. If it's simply pulling more php from another file the just use "require_once" But again without understanding clearly what is required this could all be wrong? Anyway merry christmas and happy new year to you and everyone.....
×