Jump to content
Tom Wilson

Custom code not working

Recommended Posts

Hi,

We have got the below code:

 {if $mcproducts.codeguard gt 0 || $mcaddons.codeguard gt 0}<p>You have an active CodeGuard!</p>{/if}

 

But it it not working, any ideas why? Let me know if you need anything t help. And yes, the client does have CodeGuard active 😛

Share this post


Link to post
Share on other sites

Hi Tom,

16 hours ago, Tom Wilson said:

We have got the below code:

 {if $mcproducts.codeguard gt 0 || $mcaddons.codeguard gt 0}<p>You have an active CodeGuard!</p>{/if} 

I recognise that code! 😎

16 hours ago, Tom Wilson said:

But it it not working, any ideas why? Let me know if you need anything t help. And yes, the client does have CodeGuard active 😛

if memory serves, the hook that generates those arrays is coded to only work on specific pages, e.g help etc... so first question would be are you trying to use the arrays on a page that doesn't have access to them ??

if yes, then add their names to the if templatefile statement...

if no, then add {$mcproducts|print_r} to the template and see if the array exists (or just use {debug} if that's easier)... if it exists, it will output the array; if it doesn't exist, it will just print 1

Array ( [codeguard] => 1 [sitelock] => 1 [spamexperts] => 0 [sslcerts] => 0 [weebly] => 1 ) 1 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated