Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2006
    Location
    Austin, TX
    Posts
    84
    Plugin Contributions
    2

    Php Conditional Statement

    What conditional statement would I use to so that a flash slideshow only shows up on the home page?

    Something like:

    <?php if (something) == (home page url) { ?>
    <div flash>
    ....
    </div>
    <?php } ?>

  2. #2
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Php Conditional Statement

    The principle is described in the comments of /includes/templates/your_template/common/tpl_main_page.php, along with examples.

    PHP Code:
    // example to not display right column on main page when Always Show Categories is OFF

    if ($current_page_base == 'index' and $cPath == '') {
      
    $flag_disable_right true;

    Change the ...flag... line to refer to your flash, and it will only execute on the main page.

    The idea can be adapted to many different uses.

  3. #3
    Join Date
    May 2006
    Location
    Anywhere USMC points
    Posts
    368
    Plugin Contributions
    0

    Default Re: Php Conditional Statement

    Okay I see where that line is, and I read the comments. Literally that means nothing useful to me. Do I copy and paste that line somewhere? Do I put something in between the ' ' ?? That code is as understandable to me as a foreign language. The more I read code stuff and explanations the more lost I'm getting.

    Flash files are .swf right?? So I'd put the name of my .swf file somewhere in that line?

    These questions may seem redundant but I honestly don't know heads from tails reading those lines. I wish I knew where to go to get a handle on understanding what I'm trying to read!!!

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Php Conditional Statement

    I don't know anything about flash files, but if you do know the code to run flash, you would replace the ...flag... line with whatever code you need (any number of lines.)

    You would put the whole if (this is true...) {then do that...} statement in whatever location you wanted the code to execute.

    P.S. - There are online tutorials that can give you a beginning overview of how PHP, CSS etc. work. A good one is www.w3schools.com.
    Last edited by gjh42; 15 Jun 2006 at 05:20 PM.

  5. #5
    Join Date
    May 2006
    Location
    Anywhere USMC points
    Posts
    368
    Plugin Contributions
    0

    Default Re: Php Conditional Statement

    I read that one! All the time! LOL !~!

    I have them bookmarked and refer to them all the time to figure out what something is in my stylesheet. Still though for some reason most of this stuff is GREEK to me. I will keep playing with that code. I want a separate page (an ez page perhaps.. or something) and put a flash thing on it.

 

 

Similar Threads

  1. Conditional statement in shopping_cart
    By The_Mech in forum Templates, Stylesheets, Page Layout
    Replies: 10
    Last Post: 9 Mar 2014, 11:29 PM
  2. Conditional statement in product info
    By twdhosting in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 13 Aug 2011, 02:44 AM
  3. Conditional Statement - Parent and Child Category Display Additional Information
    By crlannen in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 6 Feb 2011, 04:13 AM
  4. Stock quantity conditional statement?
    By doodlebee in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 18 Jun 2007, 03:57 PM
  5. PHP conditional for Bread Crumbs display
    By Picci in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 26 Jun 2006, 09:45 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR