Announcement

Collapse
No announcement yet.

Problem with Condition

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

  • Problem with Condition

    Hi there...
    Code:
     $info
     <if conditional="$info==/forum/index.php">Startseite an.
     <else />
     Forumsboard
     </if>
    This dont work....
    why?
    getinfo.pfp include this for $info
    Code:
     <?php
     Echo $_ENV["PATH_INFO"];
     //echo $_SERVER["QUERY_STRING"];
     ?>
    This is tehe php-include...
    Code:
     echo "<!-- header -->";
     ob_start(); 
     include("...../includes/getheader.php"); 
     $info = ob_get_contents(); 
     ob_end_clean();
    Whats wrong?

  • #2
    You have to put /forum/index.php in single quotes, i.e.

    '/forum/index.php'

    Then, of course, $info has to actually be that value.

    If you want to check if the user is on index.php, it would be simpler to use

    THIS_SCRIPT == 'index'

    Since we define THIS_SCRIPT uniquely for each .php file.
    Last edited by Freddie Bingham; Sat 11 Oct '03, 8:05am.

    Comment


    • #3
      Originally posted by Freddie
      You have to put /forum/index.php in single quotes, i.e.
      '/forum/index.php'
      Then, of course, $info has to actually be that value.
      If yuo want to check if the user on index.php, it would be simpler to use
      THIS_SCRIPT == 'index'
      Since we define THIS_SCRIPT uniquely for each .php file.
      ---
      $info
      <if conditional="$info=='/forum/index.php'">Startseite an.
      <else />
      Forumsboard
      </if>
      ---
      dont work...Why?

      THX for hint with this_script , but I will use the vb as portal and i must know what the user have done,
      have he called swishzone.net (Portal) or have called the Forum....
      under swishzone.net/forum.

      On this point is the redirect from swishzone.net -> swishzone.net/forum

      This mean, first page are come from vb3 as index and the when he click to forum he will get the index.php from vb3.....
      Any hints

      Comment


      • #4
        With vb3, you can actually rename the index.php to forum.php or whatever, and use index.php as portal index

        You could try to play with variables;

        <if condition="$SCRIPT_NAME == '/index.php'">frontpage<else />forum</if>

        (wonders how to use script_name properly)
        Last edited by Floris; Sat 11 Oct '03, 7:37am.

        Comment


        • #5
          Originally posted by xiphoid
          With vb3, you can actually rename the index.php to forum.php or whatever, and use index.php as portal index
          Good, but how can i change the start-template from index.php?

          I will start as portal with a custemized template....

          PS: I dont know whats wrong...
          in teh common template header over the buttons and logo I place this code
          Code:
           <if conditional="1==2"> 1=2
           <elseif />
           1<>2
           </if>
          On the screen you can see this...
          1=2 1<>2

          What the hell is that? Conditions are not work on my board...why? any hints...
          Last edited by Wildthinks; Sat 11 Oct '03, 7:38am.

          Comment


          • #6
            uhm
            maybe its
            $HTTP_GET_VARS['SCRIPT_NAME']

            Comment


            • #7
              Originally posted by xiphoid
              uhm
              maybe its
              $HTTP_GET_VARS['SCRIPT_NAME']
              THX i will try it...
              #

              aaaarghh the fog is gone...

              mistake with code and no errors...

              ok code is cleared..all works well... and im happy an go to the lunch.

              My big big big thx to all helpers...

              Comment


              • #8
                What is the code that you use now?

                Comment


                • #9
                  Originally posted by xiphoid
                  What is the code that you use now?
                  $startseite
                  <if condition="$startseite==SZO"> Startseite!
                  <else />
                  Forum
                  </if>

                  The mistake was conditional and
                  <elseif />
                  .....

                  Comment

                  Loading...
                  Working...
                  X