Support Forums

"if" statement

This is a discussion on "if" statement within the TemplateCodes forums, part of the Third Party Support category; In your Fluid template I trying to wrap Google Adsense code to prevent it from appearing on the reset password ...


Go Back   68 Classifieds Forums > Third Party Support > TemplateCodes

Reply
 
Thread Tools Display Modes
Old 02-15-2010, 03:50 PM   #1
Customer
 
mgravlee's Avatar
 
Join Date: Mar 2009
Posts: 34
Rep Power: 11
mgravlee is on a distinguished road
Default "if" statement

In your Fluid template I trying to wrap Google Adsense code to prevent it from appearing on the reset password page. (See Template FAQ - 68 Classifieds)

I'm using this:
<td>
{if $body != "user/userlogin.tpl" || $smarty.post.action == '' || $smarty.get.key != ""}
{literal}
<script type="text/javascript"><!--
google_ad_client = "pub-1555257310458";
/* classifieds 300x250, created 8/22/09 */
google_ad_slot = "0119464298";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
{/literal}
{/if}
</td>

I cleared templates_c but as you can see it still appears as the large google ad at the top left of the page:
AgAds at CattleToday.com

Where is my 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-15-2010, 04:28 PM   #2
curmudgeon
 
Join Date: Mar 2006
Posts: 5,414
Rep Power: 138
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

whay are you ckecking against the values of $smarty.post.action and $smarty.get.key?
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline   Reply With Quote
Old 02-15-2010, 04:45 PM   #3
Customer
 
mgravlee's Avatar
 
Join Date: Mar 2009
Posts: 34
Rep Power: 11
mgravlee is on a distinguished road
Default

Heck if I know. I'm just copying this Template FAQ - 68 Classifieds

What does it need to be?
__________________
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-15-2010, 05:52 PM   #4
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

give this a go
Code:
{if $body !=user/userlogin.tpl}
__________________
Nick Bowers
68c v4.1.10 Developer Custom Template
bowers01 is offline   Reply With Quote
Old 02-15-2010, 06:27 PM   #5
Customer
 
mgravlee's Avatar
 
Join Date: Mar 2009
Posts: 34
Rep Power: 11
mgravlee is on a distinguished road
Default

That works for login.php but when you click on "Forgot Password" it goes to userforgot.php and the ad is back and you get the double emails.
__________________
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-15-2010, 06:47 PM   #6
curmudgeon
 
Join Date: Mar 2006
Posts: 5,414
Rep Power: 138
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

then add the check for the userforgot template....


{if $body !=user/userlogin.tpl || $body !=user/userforgot.tpl }
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline   Reply With Quote
Old 02-15-2010, 07:11 PM   #7
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 3,361
Rep Power: 85
seymourjames is a jewel in the rough
Default

Sorry to butt in but I had a similar problem and found in the end I had to do this so that adsense was excluded from certain pages when logged in aswell. I reversed the logic but it seems to be complete - thought it may help. .

{if $smarty.session.username =="" && $smarty.cookies.username =="" && $SCRIPT_NAME <> "/login.php" && $SCRIPT_NAME <> "/userjoin.php" && $SCRIPT_NAME <> "/userforgot.php"}
display adsense
{/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-16-2010, 08:03 AM   #8
Customer
 
mgravlee's Avatar
 
Join Date: Mar 2009
Posts: 34
Rep Power: 11
mgravlee is on a distinguished road
Default

Larry,

{if $body !=user/userlogin.tpl || $body !=user/userforgot.tpl }
gives me an error
because userforgot.tpl is in /templates/default/user/userforgot.tpl
but
userlogin.tpl is in /templates/Fluid-Custom/user/userlogin.tpl
and
layout.tpl is in /templates/Fluid-Custom/

I tried
{if $body != "../default/user/userforgot.tpl"}
{script}
</if>
but it does nothing.
__________________
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:07 AM   #9
curmudgeon
 
Join Date: Mar 2006
Posts: 5,414
Rep Power: 138
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

template codes just sends you tempates that change from default, just like the 68C included templates outside of default, they only have files that are different than default and when the system cant find a file in its curent template folder it looks to the default folder.

With that in mind, copy the file from the default template and put it in your template codes folder, clear /templates_c and try again.
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline   Reply With Quote
Old 02-16-2010, 08:12 AM   #10
Customer
 
mgravlee's Avatar
 
Join Date: Mar 2009
Posts: 34
Rep Power: 11
mgravlee is on a distinguished road
Default

James,

Can you modify this script so it excludes adsense on userforgot.php? That's what I'm looking for.

I assume that everybody who has adsense ads sitewide is having this same problem, no?
__________________
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
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 02:56 AM.


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