hi,

simple question: how come this isn't working

 <?php if ((!$is_front) || (arg(0) != "travelbuddy")) echo '<div class="box">'; ?>

the div should NOT show if one of the conditions is true.

thanks!

kai

Comments

wpd’s picture

An OR statement is TRUE is if either statement is TRUE.
I am not sure what you are trying to happen.

White Paper Designs

brakai295’s picture

as i said, what i'm trying to achieve is:

If we are NOT on the front page [OR] if we are not in the travelbuddy section, then the DIV should be shown.

Is there any other approach to do this? My above example doesn't work.

Cheers
Kai

Webdesign Melbourne Australia
www.brizk.com

Michelle’s picture

Unless the front and travelbuddy sections are the same, every page you are on will not be one or the other. I think you mean:

if !($is_front || (arg(0) = "travelbuddy"))

I'm no PHP expert, but that seems to make more sense to me...

Michelle

--------------------------------------
My site: http://shellmultimedia.com

brakai295’s picture

hey,

that seems like it makes sense to me too, but it ain't working ;-)

Parse error: syntax error, unexpected '=' in /home/www/ausmag/australien-community/themes/ausmag/box.tpl.php on line 1

ANy other ideas? I can't believe it's so hard to connect those two conditions with an OR operator!? :o|

Webdesign Melbourne Australia
www.brizk.com

Michelle’s picture

Should be == not =. I always forget PHP is picky about that.

Michelle

--------------------------------------
My site: http://shellmultimedia.com

brakai295’s picture

nope, unfortunately, still no luck :-/

Parse error: syntax error, unexpected '!', expecting '(' in /home/www/ausmag/australien-community/themes/ausmag/box.tpl.php on line 1

Webdesign Melbourne Australia
www.brizk.com

Michelle’s picture

Sorry, I don't use PHP on a regular basis and I was trying to give a quick answer... Try:

if (!($is_front || (arg(0) = "travelbuddy"))) { ...

If that's not quite right, look at the PHP website for the exact syntax. I'm trying to go off the top of my head with a toddler screaming at my feet.

Michelle

--------------------------------------
My site: http://shellmultimedia.com

brakai295’s picture

hey I think this is it! :-) it seems to be working! I just changed the = into == from your last post.

thanks very much! regards to little toddy. ;-)

kai

Webdesign Melbourne Australia
www.brizk.com