Forums / General Questions / IF statement for EZ-Page

IF statement for EZ-Page

Locked

Views: 1,441

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
11 Jan 2007, 10:50 AM
#1
milkyway avatar

milkyway

Inactive

Join Date:
Aug 2006
Location:
Singapore
Posts:
167
Plugin Contributions:
1

IF statement for EZ-Page

Hi all...

I would like to know what is the IF statement for a specific EZ-Page,

example the page is at:

/index.php?main_page=page&id=1&chapter=0

I dont kow what variable control the page&id=1,

if ($current_what_to_put_here ==1) {
}

The purpose is I would like make the header changed when visitor visit that page. So I want to insert that if statement on tpl_header.php

Thanks!

Responsive ZenCart Templates that automatically adapt itself with iPad, iPhone, BlackBerry, Androids and any monitor screen size
Buy a coffee for Zen-Cart devs. http://www.zen-cart.com/donate

11 Jan 2007, 12:52 PM
#2
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: IF statement for EZ-Page

Try $ezpage_id

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

12 Jan 2007, 1:25 AM
#3
milkyway avatar

milkyway

Inactive

Join Date:
Aug 2006
Location:
Singapore
Posts:
167
Plugin Contributions:
1

Re: IF statement for EZ-Page

kuroi:

Try $ezpage_id

Hey Kuroi it is working. You always been very helpful.

Now the header changed when I visit that specific EZ_Page, but... but only when there is no 'zenid', if zenid exist then no changes happen...

When I set IF statement as below:

if $ezpage_id=1

Few possibilities below will happen:

If in the URL $ezpage_id exist and no zenid <--- changes happen
If in the URL $ezpage_id exist and zenid exist <---- no changes

So now we have to find variable control for zenid to add in if statement, I tried $zenid, $zen_id but none works.

And I also not sure what the correct operator, sinze $ezpage_id can be a standalone or in other case depend with zenid

maybe something like

if ($ezpage_id=1 or $zenid>0) ?

Please enlighten me... =)

Thanks a lot

Responsive ZenCart Templates that automatically adapt itself with iPad, iPhone, BlackBerry, Androids and any monitor screen size
Buy a coffee for Zen-Cart devs. http://www.zen-cart.com/donate

12 Jan 2007, 3:02 AM
#4
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: IF statement for EZ-Page

The syntax that you have posted is incorrect, though from your original post I suspect that you may already know this. Correct would be > if ($ezpages_id == 1) {

<statements> }I've tested this, including when there is a zenid in the URL and it works fine. If with correct syntax it's not working for you, and/or you are seeing zenid in the URL a lot then I suspect you have a rather different problem.

zenid should only appear on the first click on a site, or when you click on a secure page (which your EZ-Pages would not normally be). If you are experiencing something different, I would recommend taking a look at this thread.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

12 Jan 2007, 3:23 AM
#5
milkyway avatar

milkyway

Inactive

Join Date:
Aug 2006
Location:
Singapore
Posts:
167
Plugin Contributions:
1

Re: IF statement for EZ-Page

kuroi:

The syntax that you have posted is incorrect, though from your original post I suspect that you may already know this. Correct would be I've tested this, including when there is a zenid in the URL and it works fine. If with correct syntax it's not working for you, and/or you are seeing zenid in the URL a lot then I suspect you have a rather different problem.

zenid should only appear on the first click on a site, or when you click on a secure page (which your EZ-Pages would not normally be). If you are experiencing something different, I would recommend taking a look at this thread.

Thanks again for your good info.

I put the syntax correctly;

if ($ezpage_id == 1) {
<my statement>
}

then it will not working if zenid exist in URL, but unfortunately the first click will be likely the ez-page that I tried to modify which is an important page, so visitor will likely click it the first time arrived at the store with zenid in the URL.

Anyhow I guess I also have the problem of zenid always appear on the URL, so I will check your suggestion.

Thanks for great help Kuroi!

Responsive ZenCart Templates that automatically adapt itself with iPad, iPhone, BlackBerry, Androids and any monitor screen size
Buy a coffee for Zen-Cart devs. http://www.zen-cart.com/donate

12 Jan 2007, 3:38 AM
#6
milkyway avatar

milkyway

Inactive

Join Date:
Aug 2006
Location:
Singapore
Posts:
167
Plugin Contributions:
1

Re: IF statement for EZ-Page

Kuroi,

I check my session configuration, it was good.
Then I found that the cache directory path is incorrect, I fixed it and zenid now working fine, zenid only appear on the first click, but it still a problem for me if visitor click the modified ez-pages at the first click.

Do you have further suggestion?

Thanks

Responsive ZenCart Templates that automatically adapt itself with iPad, iPhone, BlackBerry, Androids and any monitor screen size
Buy a coffee for Zen-Cart devs. http://www.zen-cart.com/donate