Support Forums

"if" statement

This is a discussion on "if" statement within the TemplateCodes forums, part of the Third Party Support category; Larry, Tried that yesterday but got an error. I'll do it again and post the error....


Go Back   68 Classifieds Forums > Third Party Support > TemplateCodes

Reply
 
Thread Tools Display Modes
Old 02-16-2010, 08:14 AM   #11
Customer
 
mgravlee's Avatar
 
Join Date: Mar 2009
Posts: 34
Rep Power: 11
mgravlee is on a distinguished road
Default

Larry,
Tried that yesterday but got an error. I'll do it again and post the error.
__________________
Using Developer 4.1.5 with Custom Fluid Template

http://agads.net/
http://horsepages.com/
http://cattletoday.com/classified_ads/
http://ranchers.net/classifieds/
mgravlee is offline   Reply With Quote
Old 02-16-2010, 08:22 AM   #12
Customer
 
mgravlee's Avatar
 
Join Date: Mar 2009
Posts: 34
Rep Power: 11
mgravlee is on a distinguished road
Default

Larry,

I must have dreamed I tried that. Worked perfectly!

Thanks!
__________________
Using Developer 4.1.5 with Custom Fluid Template

http://agads.net/
http://horsepages.com/
http://cattletoday.com/classified_ads/
http://ranchers.net/classifieds/
mgravlee is offline   Reply With Quote
Old 02-16-2010, 08:27 AM   #13
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 3,361
Rep Power: 85
seymourjames is a jewel in the rough
Default

Test well as I see no reason why it would just be this page.

This is what I already posted because it excludes adsense from other similar type pages.

{if $smarty.session.username =="" && $smarty.cookies.username =="" && $SCRIPT_NAME <> "/login.php" && $SCRIPT_NAME <> "/userjoin.php" && $SCRIPT_NAME <> "/userforgot.php"}
display adsense
{/if}


If you want to keep adsense from just that single page then it is this

{if $SCRIPT_NAME <> "/userforgot.php"}
display adsense
{/if}


No they do not have issues and nor do we on our dev and demo sites. It is specific to your site and what you may or may not have introduced or files like robots.txt that you may have. It may also have something to do with your hosting provider. It is difficult to pin down.
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68C, Version 4 Templates & Modules
Get the Best U.S Hosting, Best U.K Hosting
seymourjames is offline   Reply With Quote
Old 02-16-2010, 05:43 PM   #14
Developer & Moderator
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 2,322
Rep Power: 69
Mike-N-Tosh is just really nice Mike-N-Tosh is just really nice
Default

Why not use the {$SCRIPT_NAME} variable instead?
PHP Code:
{if $SCRIPT_NAME !=yourdomain/login.php || $SCRIPT_NAME !=yourdomain/userforgot.php
Check the {Debug} for the exact {$SCRIPT_NAME} variables.
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified & used as the CMS)
Sandbox [localhost(v3.1.10, v4.0.9, 4.1.10,4.2,5.0)] for development and customization
Visit My blog: reviews, tips, tricks, tutorials and my store with Templates, Mods & Docs
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out
Mike-N-Tosh is offline   Reply With Quote
Old 02-16-2010, 06:07 PM   #15
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 3,361
Rep Power: 85
seymourjames is a jewel in the rough
Default

Mike - I just posted that twice in this thread above .
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68C, Version 4 Templates & Modules
Get the Best U.S Hosting, Best U.K Hosting
seymourjames is offline   Reply With Quote
Old 02-19-2010, 03:52 AM   #16
Genius At Work
 
bowers01's Avatar
 
Join Date: May 2008
Location: Geelong, Victoria, Australia
Posts: 1,089
Rep Power: 35
bowers01 is on a distinguished road
Default

How does one do if script?
{if $SCRIPT_NAME <> "/usercheckout.php"}
If usercheckout.php do the following
{/if}
__________________
Nick Bowers
68c v4.1.10 Developer Custom Template
bowers01 is offline   Reply With Quote
Old 02-19-2010, 04:34 AM   #17
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 3,361
Rep Power: 85
seymourjames is a jewel in the rough
Default

Nick,

If I take literally what you have written then it is impossible isn't it? The tests cannot be both true ever ? or do you mean

{if $SCRIPT_NAME <> "/usercheckout.php"}
do something
{else}
do this
{/if}
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68C, Version 4 Templates & Modules
Get the Best U.S Hosting, Best U.K Hosting
seymourjames is offline   Reply With Quote
Old 02-19-2010, 08:28 AM   #18
Genius At Work
 
bowers01's Avatar
 
Join Date: May 2008
Location: Geelong, Victoria, Australia
Posts: 1,089
Rep Power: 35
bowers01 is on a distinguished road
Default

Quote:
Originally Posted by seymourjames
Nick,

If I take literally what you have written then it is impossible isn't it? The tests cannot be both true ever ? or do you mean

{if $SCRIPT_NAME <> "/usercheckout.php"}
do something
{else}
do this
{/if}
Hi,
Thanks that works too, but like if $body eg
{if $body != "user/userlogin.tpl"
{if $body == "user/userlogin.tpl"

Is there something like {if $SCRIPT_NAME !> "/usercheckout.php"} for if scriptname?
Cheers,
Nick
__________________
Nick Bowers
68c v4.1.10 Developer Custom Template
bowers01 is offline   Reply With Quote
Old 02-19-2010, 09:14 AM   #19
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 3,361
Rep Power: 85
seymourjames is a jewel in the rough
Default

You have lost me Nick. A test in normal computing is either true or false in logic. In this case you are saying, it is either usercheckout.php being processed or it is not usercheckout.php being processed. You can't be in both camps.
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68C, Version 4 Templates & Modules
Get the Best U.S Hosting, Best U.K Hosting
seymourjames is offline   Reply With Quote
Old 04-19-2011, 01:11 PM   #20
Customer
 
Join Date: Jun 2006
Location: Rhode Island USA
Posts: 56
Rep Power: 23
b3d will become famous soon enough
Default

I am having this multiple password problem on new installation. I tried
{if $SCRIPT_NAME <> "/userforgot.php"}
display adsense
{/if}

in layout.tpl to block google ads but it is not blocking them.

oops... sorry i am not using templatecodes for this site.. this is just the thread I found when searching for this problem.

I would like to note that my domain is not live so I am using a temp address like http://111.111.111.111/~user/userforgot.php and wondering if that could be why the above if statement isn't working.

Last edited by b3d; 04-19-2011 at 01:33 PM.
b3d is offline   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
$viewaddress showing as "Y" when it is "N" seanhale Technical Support 0 07-15-2009 04:59 PM
problem with "guest" and "logout" ganaf Technical Support 2 12-27-2008 02:14 PM
Adding a "Product Directory" & "Find a Dealer" system spaceboy Technical Support 1 09-18-2008 06:16 PM
How to change title name "Place" to "post" on main page? YourPalAl Technical Support 4 04-28-2008 10:39 PM


All times are GMT -4. The time now is 03:07 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2011, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0