Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Php Conditional Statement

Php Conditional Statement

Locked

Views: 2,457

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
13 Jun 2006, 4:11 PM
#1
zforrest avatar

zforrest

New Zenner

Join Date:
Jun 2006
Location:
Austin, TX
Posts:
85
Plugin Contributions:
0

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 } ?>
13 Jun 2006, 5:20 PM
#2
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Php Conditional Statement

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

* // 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.

15 Jun 2006, 9:17 AM
#3
ladysaat avatar

ladysaat

Zen Follower

Join Date:
May 2006
Location:
Anywhere USMC points
Posts:
330
Plugin Contributions:
0

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!!!

15 Jun 2006, 4:15 PM
#4
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

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 https://www.w3schools.com.

16 Jun 2006, 12:07 AM
#5
ladysaat avatar

ladysaat

Zen Follower

Join Date:
May 2006
Location:
Anywhere USMC points
Posts:
330
Plugin Contributions:
0

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.