Announcement

Collapse
No announcement yet.

Quick Coding Question : Which Script am I running?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Quick Coding Question : Which Script am I running?

    Help please folks - this one is driving me MAD and I know I'm going to kick myself but...

    Q : How can I find out from within a template which script I am running?

    I've spent hours, Googling, experimenting, searching but to no avail. I know that within each .php script there is the ledgend -
    Code:
    // #################### DEFINE IMPORTANT CONSTANTS #######################
    define('THIS_SCRIPT', 'index');
    so it's got as far as the PHP constants - but how do I get at simple info like that from within a template? What I want to do is very simple, basically it's -

    Code:
    <if condition="$?????what_goes_here????? == 'specificscript'">
       this bit of html
    <else>
       that bit of html
    </if>
    Go on, put me out of my misery

    Thanks

    Keith L

  • #2
    PHP Code:
    <if condition="THIS_SCRIPT == 'nameofscript' ">
    this bit of html
    <else>
       
    that bit of html
    </if> 
    That should work...

    Comment

    widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
    Working...
    X