Webmastersite.net
Register Log In

<IF templates/bootstrap/viewcomments.tpl contains tour.tpl OR
what's the correct formating of the above IF

Comments on <IF templates/bootstrap/viewcomments.tpl contains tour.tpl OR

david
Forum Regular

Usergroup: Customer
Joined: Jun 22, 2005

Total Topics: 91
Total Comments: 305
david
Posted Mar 08, 2006 - 4:19 AM:

Hey Paul,

Is it me not formatting this correctly, or the script cannot handle multiple IF { TID } statements?

This is what I was trying:

< IF {TID} contains tour.tpl OR {TID} contains details.tpl >

tour.tpl is a custom template.

If I create a simple
< IF {TID} contains tour.tpl >

or

< IF {TID} contains details.tpl >

statement, they work fine. But I need to be able to do an OR in that single IF statement.

Thanks
David
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Mar 08, 2006 - 8:05 AM:

There isn't an 'OR' in conditionals syntax that I know of. There is an 'or' I believe, though it's buggy so it could be better to use php (<?php if (strstr("{TID}", "tour.tpl") or strstr("{TID}", "details.tpl")) { ?>)
david
Forum Regular

Usergroup: Customer
Joined: Jun 22, 2005

Total Topics: 91
Total Comments: 305
david
Posted Mar 08, 2006 - 3:49 PM:

Thanks Paul. smiling face
david
Forum Regular

Usergroup: Customer
Joined: Jun 22, 2005

Total Topics: 91
Total Comments: 305
david
Posted Mar 16, 2006 - 1:20 AM:

Hey Paul,

Just got around to actually trying this. Is this the correct syntax?

<?php if (strstr("{TID}", "tour.tpl") or strstr("{TID}", "details.tpl")) { ?>

I see that { at the end there. Is that supposed to be there? Not a PHP kinda guy, sorry. smiling face

Also, I just basically put this where? Instead of the whole <IF {TID} ....> ? If so, how do I close it? I mean, the </IF> tag in PHP is what?

Thanks
David
capitaine
Forum Regular

Usergroup: Customer
Joined: Aug 05, 2005

Total Topics: 94
Total Comments: 272
Posted Mar 16, 2006 - 8:36 AM:

strstr doesn't sound right either....
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Mar 16, 2006 - 9:41 AM:

I typed it correctly... are you getting an error? To close it you can use </IF> if you like, but for the sake of consistency it's perhaps better to use <?php } ?>, which is what </IF> is automatically translated into at run time.
david
Forum Regular

Usergroup: Customer
Joined: Jun 22, 2005

Total Topics: 91
Total Comments: 305
david
Posted Mar 16, 2006 - 4:43 PM:

Cheers. All is working now! smiling face

Thanks again
David
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.