Jump to content

Custom code not working


Tom Wilson

Recommended Posts

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 
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

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